├── .circleci └── config.yml ├── .editorconfig ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── ci-scripts ├── osmosis │ ├── .gitignore │ ├── README.md │ ├── env │ ├── generate_template.sh │ ├── start.sh │ ├── stop.sh │ └── template │ │ └── .osmosisd │ │ ├── 6fc458e78b00b50b013a0fa11b2d5e1fdcc4029c.address │ │ ├── config │ │ ├── app.toml │ │ ├── client.toml │ │ ├── config.toml │ │ ├── genesis.json │ │ ├── gentx │ │ │ └── gentx-8c3f5817e96cc2a75d729f89a8ddfe23883f6c34.json │ │ ├── node_key.json │ │ └── priv_validator_key.json │ │ ├── data │ │ └── priv_validator_state.json │ │ ├── keyhash │ │ └── validator.info └── wasmd │ ├── README.md │ ├── env │ ├── generate_template.sh │ ├── scripts │ └── setup_wasmd.sh │ ├── start.sh │ ├── stop.sh │ └── template │ └── .wasmd │ ├── config │ ├── app.toml │ ├── client.toml │ ├── config.toml │ ├── genesis.json │ ├── gentx │ │ └── gentx-e00476a52bbadced4266814cee02b61c4cbdb860.json │ ├── node_key.json │ └── priv_validator_key.json │ ├── data │ └── priv_validator_state.json │ ├── f669faa106f9249f5a90c4fb05093f76e722a248.address │ ├── keyhash │ └── validator.info ├── contracts ├── cw-ibc-queries │ ├── .cargo │ │ └── config │ ├── Cargo.toml │ ├── README.md │ ├── examples │ │ └── schema.rs │ └── src │ │ ├── contract.rs │ │ ├── error.rs │ │ ├── ibc.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs └── cw-ibc-query-receiver │ ├── .cargo │ └── config │ ├── Cargo.toml │ ├── README.md │ ├── examples │ └── schema.rs │ └── src │ ├── contract.rs │ ├── error.rs │ ├── lib.rs │ ├── msg.rs │ └── state.rs ├── devtools ├── build_integration_wasm.sh ├── format_md.sh ├── format_sh.sh └── format_yml.sh ├── packages └── cw-ibc-query │ ├── .cargo │ └── config │ ├── Cargo.toml │ ├── examples │ └── schema.rs │ └── src │ ├── checks.rs │ ├── ibc_msg.rs │ └── lib.rs └── tests ├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── README.md ├── external ├── cw1_whitelist.wasm ├── download_releases.sh └── version.txt ├── package-lock.json ├── package.json ├── src ├── cosmwasm.spec.ts └── utils.ts └── tsconfig.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | codecov: codecov/codecov@3.2.2 5 | 6 | workflows: 7 | version: 2 8 | test: 9 | jobs: 10 | - contract_simple_ica_controller 11 | - contract_simple_ica_host 12 | - package_simple_ica 13 | - lint 14 | - wasm-build 15 | - ts-build 16 | - integration: 17 | requires: 18 | - wasm-build 19 | - ts-build 20 | - contract_simple_ica_controller 21 | - contract_simple_ica_host 22 | # filters: 23 | # branches: 24 | # only: 25 | # # Long living branches 26 | # - main 27 | # # 👇Add your branch here if benchmarking matters to your work 28 | deploy: 29 | jobs: 30 | - build_and_upload_contracts: 31 | filters: 32 | tags: 33 | only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/ 34 | branches: 35 | ignore: /.*/ 36 | - build_and_upload_schemas: 37 | filters: 38 | tags: 39 | only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/ 40 | branches: 41 | ignore: /.*/ 42 | 43 | jobs: 44 | contract_simple_ica_controller: 45 | docker: 46 | - image: rust:1.58.1 47 | working_directory: ~/project/contracts/simple-ica-controller 48 | steps: 49 | - checkout: 50 | path: ~/project 51 | - run: 52 | name: Version information 53 | command: rustc --version; cargo --version; rustup --version 54 | - restore_cache: 55 | keys: 56 | - cargocache-simple-ica-controller-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 57 | - run: 58 | name: Unit Tests 59 | environment: 60 | RUST_BACKTRACE: 1 61 | command: cargo unit-test --locked 62 | - run: 63 | name: Build and run schema generator 64 | command: cargo schema --locked 65 | - save_cache: 66 | paths: 67 | - /usr/local/cargo/registry 68 | - target 69 | key: cargocache-simple-ica-controller-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 70 | 71 | contract_simple_ica_host: 72 | docker: 73 | - image: rust:1.58.1 74 | working_directory: ~/project/contracts/simple-ica-host 75 | steps: 76 | - checkout: 77 | path: ~/project 78 | - run: 79 | name: Version information 80 | command: rustc --version; cargo --version; rustup --version 81 | - restore_cache: 82 | keys: 83 | - cargocache-simple-ica-host-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 84 | - run: 85 | name: Unit Tests 86 | environment: 87 | RUST_BACKTRACE: 1 88 | command: cargo unit-test --locked 89 | - run: 90 | name: Build and run schema generator 91 | command: cargo schema --locked 92 | - save_cache: 93 | paths: 94 | - /usr/local/cargo/registry 95 | - target 96 | key: cargocache-simple-ica-host-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 97 | 98 | package_simple_ica: 99 | docker: 100 | - image: rust:1.58.1 101 | working_directory: ~/project/packages/simple-ica 102 | steps: 103 | - checkout: 104 | path: ~/project 105 | - run: 106 | name: Version information 107 | command: rustc --version; cargo --version; rustup --version; rustup target list --installed 108 | - restore_cache: 109 | keys: 110 | - cargocache-v2-simple-ica:1.58.1-{{ checksum "~/project/Cargo.lock" }} 111 | - run: 112 | name: Build library for native target 113 | command: cargo build --locked 114 | - run: 115 | name: Run unit tests 116 | command: cargo test --locked 117 | - save_cache: 118 | paths: 119 | - /usr/local/cargo/registry 120 | - target 121 | key: cargocache-v2-simple-ica:1.58.1-{{ checksum "~/project/Cargo.lock" }} 122 | 123 | lint: 124 | docker: 125 | - image: rust:1.58.1 126 | steps: 127 | - checkout 128 | - run: 129 | name: Version information 130 | command: rustc --version; cargo --version; rustup --version; rustup target list --installed 131 | - restore_cache: 132 | keys: 133 | - cargocache-v2-lint-rust:1.58.1-{{ checksum "Cargo.lock" }} 134 | - run: 135 | name: Add rustfmt component 136 | command: rustup component add rustfmt 137 | - run: 138 | name: Add clippy component 139 | command: rustup component add clippy 140 | - run: 141 | name: Check formatting of workspace 142 | command: cargo fmt -- --check 143 | - run: 144 | name: Clippy linting on workspace 145 | command: cargo clippy --all-targets -- -D warnings 146 | - save_cache: 147 | paths: 148 | - /usr/local/cargo/registry 149 | - target/debug/.fingerprint 150 | - target/debug/build 151 | - target/debug/deps 152 | key: cargocache-v2-lint-rust:1.58.1-{{ checksum "Cargo.lock" }} 153 | 154 | # This runs one time on the top level to ensure all contracts compile properly into wasm. 155 | # We don't run the wasm build per contract build, and then reuse a lot of the same dependencies, so this speeds up CI time 156 | # for all the other tests. 157 | # Resulting wasm files are stored to the workspace, so they can be used by the integration test downstream 158 | wasm-build: 159 | docker: 160 | - image: rust:1.58.1 161 | steps: 162 | - checkout: 163 | path: ~/project 164 | - run: 165 | name: Version information 166 | command: rustc --version; cargo --version; rustup --version 167 | - restore_cache: 168 | keys: 169 | - cargocache-wasm-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 170 | - run: 171 | name: Add wasm32 target 172 | command: rustup target add wasm32-unknown-unknown 173 | - run: 174 | name: Build Wasm Release 175 | command: | 176 | for C in ./contracts/*/ 177 | do 178 | echo "Compiling `basename $C`..." 179 | (cd $C && RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked) 180 | done 181 | - save_cache: 182 | paths: 183 | - /usr/local/cargo/registry 184 | - target 185 | key: cargocache-wasm-rust:1.58.1-{{ checksum "~/project/Cargo.lock" }} 186 | - persist_to_workspace: 187 | name: Save wasm contracts for integration test usage 188 | root: ./target/wasm32-unknown-unknown/release 189 | paths: 190 | - simple_ica_controller.wasm 191 | - simple_ica_host.wasm 192 | 193 | ts-build: 194 | docker: 195 | - image: circleci/node:16 196 | working_directory: ~/ibc/tests 197 | steps: 198 | - checkout: 199 | path: ~/ibc 200 | - restore_cache: 201 | keys: 202 | - v1-dependencies-{{ checksum "package-lock.json" }} 203 | - run: npm install --frozen-lockfile 204 | - save_cache: 205 | paths: 206 | - node_modules 207 | key: v1-dependencies-{{ checksum "package-lock.json" }} 208 | - run: npm run build 209 | - run: npm run test:lint 210 | - run: npm run test:prettier 211 | 212 | integration: 213 | machine: 214 | # We can't use a containerized environment since it requires remote docker to start custom containers. 215 | # However, we can't access the remote docker's network from the primary container. This is a 216 | # feature, as documented in https://circleci.com/docs/2.0/building-docker-images/#separation-of-environments 217 | # As a consequence, we cannot use the circleci CLI for this job because "You cannot use the machine 218 | # executor in local jobs." (https://circleci.com/docs/2.0/local-cli/#limitations-of-running-jobs-locally) 219 | # 220 | # Available images: https://circleci.com/docs/2.0/configuration-reference/#available-machine-images 221 | image: ubuntu-2004:202010-01 222 | working_directory: ~/ibc/tests 223 | steps: 224 | - checkout: 225 | path: ~/ibc 226 | - run: # start early for less wait time below 227 | name: Start wasmd 228 | command: ../ci-scripts/wasmd/start.sh 229 | background: true 230 | - run: # start early for less wait time below 231 | name: Start osmosisd 232 | command: ../ci-scripts/osmosis/start.sh 233 | background: true 234 | - run: 235 | # TODO: check if still needed with 20.04 236 | # The images ubuntu-1604 comes with preinstalled nvm, which does not work well with non-login shells 237 | name: Uninstall nvm 238 | # Moving to trash is faster than deleting (gvfs-trash is not installed on this image) 239 | command: mkdir -p ~/.local/share/Trash && mv "$NVM_DIR" ~/.npm ~/.local/share/Trash 240 | - run: 241 | name: Install nodejs 242 | # In the current image, `sudo apt install nodejs` requires `sudo apt update` which is too slow 243 | command: | 244 | curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - 245 | sudo apt-get install -y nodejs 246 | - run: 247 | name: Version information 248 | command: echo "node $(node --version)"; echo "npm $(npm --version)" 249 | - restore_cache: 250 | name: Restore Npm Package Cache 251 | keys: 252 | - v1-packages-{{ checksum "package-lock.json" }} 253 | - run: npm install --frozen-lockfile 254 | - run: 255 | name: Wait for chains to start up 256 | command: | 257 | echo "Wait for wasmd..." 258 | timeout 60 bash -c "until curl -s http://localhost:26659/status > /dev/null; do sleep 0.5; done" 259 | echo "Wait for osmsoisd..." 260 | timeout 60 bash -c "until curl -s http://localhost:26653/status > /dev/null; do sleep 0.5; done" 261 | sleep 1 262 | echo "Chains up and running!" 263 | - attach_workspace: 264 | at: internal 265 | - run: 266 | command: ls -l internal 267 | - run: 268 | command: npm run build 269 | - run: 270 | command: npm run test:unit 271 | - save_cache: 272 | name: Save Npm Package Cache 273 | key: v1-packages-{{ checksum "package-lock.json" }} 274 | paths: 275 | - node_modules 276 | - run: 277 | name: Stop chains 278 | command: | 279 | ../ci-scripts/wasmd/stop.sh 280 | ../ci-scripts/osmosis/stop.sh 281 | 282 | 283 | # This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/ 284 | build_and_upload_contracts: 285 | docker: 286 | # Image from https://github.com/cibuilds/github, based on alpine 287 | - image: cibuilds/github:0.13 288 | steps: 289 | - run: 290 | name: Install Docker client 291 | command: apk add docker-cli 292 | - setup_remote_docker 293 | - checkout 294 | - run: 295 | # We cannot mount local folders, see https://circleci.com/docs/2.0/building-docker-images/#mounting-folders 296 | name: Prepare volume with source code 297 | command: | 298 | # create a dummy container which will hold a volume with config 299 | docker create -v /code --name with_code alpine /bin/true 300 | # copy a config file into this volume 301 | docker cp Cargo.toml with_code:/code 302 | docker cp Cargo.lock with_code:/code 303 | # copy code into this volume 304 | docker cp ./contracts with_code:/code 305 | docker cp ./packages with_code:/code 306 | - run: 307 | name: Build development contracts 308 | command: | 309 | docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.12.6 310 | docker cp with_code:/code/artifacts ./artifacts 311 | - run: 312 | name: Show data 313 | command: | 314 | ls -l artifacts 315 | cat artifacts/checksums.txt 316 | - run: 317 | name: Publish artifacts on GitHub 318 | command: | 319 | TAG="$CIRCLE_TAG" 320 | TITLE="$TAG" 321 | BODY="Attached there are some build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release." 322 | ghr -t "$GITHUB_TOKEN" \ 323 | -u "$CIRCLE_PROJECT_USERNAME" -r "$CIRCLE_PROJECT_REPONAME" \ 324 | -c "$CIRCLE_SHA1" \ 325 | -n "$TITLE" -b "$BODY" \ 326 | -replace \ 327 | "$TAG" ./artifacts/ 328 | 329 | build_and_upload_schemas: 330 | docker: 331 | - image: rust:1.58.1 332 | working_directory: ~/project 333 | steps: 334 | - checkout: 335 | path: ~/project 336 | - run: 337 | name: Create schemas directory 338 | command: mkdir -p schemas 339 | - run: 340 | name: Install ghr 341 | command: wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz -O - | tar -zxvf - -C /usr/local/bin --wildcards --strip-components 1 */ghr 342 | - run: 343 | name: Build and run schema generator for packages 344 | command: | 345 | for S in ./packages/*/examples/schema.rs 346 | do 347 | P=$(dirname $S)/.. 348 | echo "Generating schema for $P ..." 349 | (cd $P && cargo schema --locked && tar -zcf ~/project/schemas/$(basename $(pwd))_schema.tar.gz ./schema) 350 | done 351 | - run: 352 | name: Build and run schema generator for contracts 353 | command: | 354 | for C in ./contracts/*/ 355 | do 356 | echo "Generating schema for $C ..." 357 | (cd $C && cargo schema --locked && tar -zcf ~/project/schemas/$(basename $(pwd))_schema.tar.gz ./schema) 358 | done 359 | - run: 360 | name: Show data 361 | command: ls -l ./schemas 362 | - run: 363 | name: Publish schemas on GitHub 364 | command: | 365 | TAG="$CIRCLE_TAG" 366 | TITLE="$TAG" 367 | BODY="Attached there are some schemas and build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release." 368 | ghr -t "$GITHUB_TOKEN" \ 369 | -u "$CIRCLE_PROJECT_USERNAME" -r "$CIRCLE_PROJECT_REPONAME" \ 370 | -c "$CIRCLE_SHA1" \ 371 | -n "$TITLE" -b "$BODY" \ 372 | -replace \ 373 | "$TAG" ./schemas/ 374 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | indent_size = 2 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | max_line_length = 120 11 | 12 | [*.rs] 13 | indent_size = 4 14 | max_line_length = 100 15 | 16 | [*.md] 17 | max_line_length = 0 18 | trim_trailing_whitespace = false 19 | 20 | [*.js] 21 | max_line_length = 80 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | .DS_Store 3 | 4 | # Text file backups 5 | **/*.rs.bk 6 | 7 | # Build results 8 | target/ 9 | debug.log 10 | 11 | # IDEs 12 | .vscode/ 13 | .idea/ 14 | *.iml 15 | 16 | # Auto-gen 17 | .cargo-ok 18 | 19 | # Build artifacts 20 | hash.txt 21 | contracts.txt 22 | artifacts/ 23 | tests/internal 24 | 25 | # code coverage 26 | tarpaulin-report.* 27 | 28 | packages/*/schema 29 | contracts/*/schema 30 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "base16ct" 7 | version = "0.1.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" 10 | 11 | [[package]] 12 | name = "base64" 13 | version = "0.13.0" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 16 | 17 | [[package]] 18 | name = "base64ct" 19 | version = "1.5.1" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "3bdca834647821e0b13d9539a8634eb62d3501b6b6c2cec1722786ee6671b851" 22 | 23 | [[package]] 24 | name = "block-buffer" 25 | version = "0.9.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 28 | dependencies = [ 29 | "generic-array", 30 | ] 31 | 32 | [[package]] 33 | name = "byteorder" 34 | version = "1.4.3" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 37 | 38 | [[package]] 39 | name = "cfg-if" 40 | version = "1.0.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 43 | 44 | [[package]] 45 | name = "const-oid" 46 | version = "0.7.1" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" 49 | 50 | [[package]] 51 | name = "cosmwasm-crypto" 52 | version = "1.0.0" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "5eb0afef2325df81aadbf9be1233f522ed8f6e91df870c764bc44cca2b1415bd" 55 | dependencies = [ 56 | "digest", 57 | "ed25519-zebra", 58 | "k256", 59 | "rand_core 0.6.3", 60 | "thiserror", 61 | ] 62 | 63 | [[package]] 64 | name = "cosmwasm-derive" 65 | version = "1.0.0" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4" 68 | dependencies = [ 69 | "syn", 70 | ] 71 | 72 | [[package]] 73 | name = "cosmwasm-schema" 74 | version = "1.0.0" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "772e80bbad231a47a2068812b723a1ff81dd4a0d56c9391ac748177bea3a61da" 77 | dependencies = [ 78 | "schemars", 79 | "serde_json", 80 | ] 81 | 82 | [[package]] 83 | name = "cosmwasm-std" 84 | version = "1.0.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195" 87 | dependencies = [ 88 | "base64", 89 | "cosmwasm-crypto", 90 | "cosmwasm-derive", 91 | "forward_ref", 92 | "schemars", 93 | "serde", 94 | "serde-json-wasm", 95 | "thiserror", 96 | "uint", 97 | ] 98 | 99 | [[package]] 100 | name = "cpufeatures" 101 | version = "0.2.2" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" 104 | dependencies = [ 105 | "libc", 106 | ] 107 | 108 | [[package]] 109 | name = "crunchy" 110 | version = "0.2.2" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 113 | 114 | [[package]] 115 | name = "crypto-bigint" 116 | version = "0.3.2" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" 119 | dependencies = [ 120 | "generic-array", 121 | "rand_core 0.6.3", 122 | "subtle", 123 | "zeroize", 124 | ] 125 | 126 | [[package]] 127 | name = "crypto-mac" 128 | version = "0.11.1" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" 131 | dependencies = [ 132 | "generic-array", 133 | "subtle", 134 | ] 135 | 136 | [[package]] 137 | name = "curve25519-dalek" 138 | version = "3.2.1" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" 141 | dependencies = [ 142 | "byteorder", 143 | "digest", 144 | "rand_core 0.5.1", 145 | "subtle", 146 | "zeroize", 147 | ] 148 | 149 | [[package]] 150 | name = "cw-ibc-queries" 151 | version = "0.1.0" 152 | dependencies = [ 153 | "cosmwasm-schema", 154 | "cosmwasm-std", 155 | "cw-ibc-query", 156 | "cw-storage-plus", 157 | "cw-utils", 158 | "cw1-whitelist", 159 | "schemars", 160 | "serde", 161 | "thiserror", 162 | ] 163 | 164 | [[package]] 165 | name = "cw-ibc-query" 166 | version = "0.1.0" 167 | dependencies = [ 168 | "cosmwasm-schema", 169 | "cosmwasm-std", 170 | "schemars", 171 | "serde", 172 | "thiserror", 173 | ] 174 | 175 | [[package]] 176 | name = "cw-ibc-query-receiver" 177 | version = "0.1.0" 178 | dependencies = [ 179 | "cosmwasm-schema", 180 | "cosmwasm-std", 181 | "cw-ibc-query", 182 | "cw-storage-plus", 183 | "cw-utils", 184 | "cw1-whitelist", 185 | "schemars", 186 | "serde", 187 | "thiserror", 188 | ] 189 | 190 | [[package]] 191 | name = "cw-storage-plus" 192 | version = "0.13.4" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "648b1507290bbc03a8d88463d7cd9b04b1fa0155e5eef366c4fa052b9caaac7a" 195 | dependencies = [ 196 | "cosmwasm-std", 197 | "schemars", 198 | "serde", 199 | ] 200 | 201 | [[package]] 202 | name = "cw-utils" 203 | version = "0.13.4" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "9dbaecb78c8e8abfd6b4258c7f4fbeb5c49a5e45ee4d910d3240ee8e1d714e1b" 206 | dependencies = [ 207 | "cosmwasm-std", 208 | "schemars", 209 | "serde", 210 | "thiserror", 211 | ] 212 | 213 | [[package]] 214 | name = "cw1" 215 | version = "0.13.4" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "362649aa18f898ff8a7a18f2bfc5568e9ba56417f3c9ce0e01bc32ccb2e125e0" 218 | dependencies = [ 219 | "cosmwasm-std", 220 | "schemars", 221 | "serde", 222 | ] 223 | 224 | [[package]] 225 | name = "cw1-whitelist" 226 | version = "0.13.4" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "5f4d6d212426746c4c052892166cf239d6604deec850d94c6eb57f8019b1afaa" 229 | dependencies = [ 230 | "cosmwasm-std", 231 | "cw-storage-plus", 232 | "cw-utils", 233 | "cw1", 234 | "cw2", 235 | "schemars", 236 | "serde", 237 | "thiserror", 238 | ] 239 | 240 | [[package]] 241 | name = "cw2" 242 | version = "0.13.4" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "04cf4639517490dd36b333bbd6c4fbd92e325fd0acf4683b41753bc5eb63bfc1" 245 | dependencies = [ 246 | "cosmwasm-std", 247 | "cw-storage-plus", 248 | "schemars", 249 | "serde", 250 | ] 251 | 252 | [[package]] 253 | name = "der" 254 | version = "0.5.1" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" 257 | dependencies = [ 258 | "const-oid", 259 | ] 260 | 261 | [[package]] 262 | name = "digest" 263 | version = "0.9.0" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 266 | dependencies = [ 267 | "generic-array", 268 | ] 269 | 270 | [[package]] 271 | name = "dyn-clone" 272 | version = "1.0.8" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "9d07a982d1fb29db01e5a59b1918e03da4df7297eaeee7686ac45542fd4e59c8" 275 | 276 | [[package]] 277 | name = "ecdsa" 278 | version = "0.13.4" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" 281 | dependencies = [ 282 | "der", 283 | "elliptic-curve", 284 | "rfc6979", 285 | "signature", 286 | ] 287 | 288 | [[package]] 289 | name = "ed25519-zebra" 290 | version = "3.0.0" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" 293 | dependencies = [ 294 | "curve25519-dalek", 295 | "hex", 296 | "rand_core 0.6.3", 297 | "serde", 298 | "sha2", 299 | "thiserror", 300 | "zeroize", 301 | ] 302 | 303 | [[package]] 304 | name = "elliptic-curve" 305 | version = "0.11.12" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" 308 | dependencies = [ 309 | "base16ct", 310 | "crypto-bigint", 311 | "der", 312 | "ff", 313 | "generic-array", 314 | "group", 315 | "rand_core 0.6.3", 316 | "sec1", 317 | "subtle", 318 | "zeroize", 319 | ] 320 | 321 | [[package]] 322 | name = "ff" 323 | version = "0.11.1" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" 326 | dependencies = [ 327 | "rand_core 0.6.3", 328 | "subtle", 329 | ] 330 | 331 | [[package]] 332 | name = "forward_ref" 333 | version = "1.0.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" 336 | 337 | [[package]] 338 | name = "generic-array" 339 | version = "0.14.5" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 342 | dependencies = [ 343 | "typenum", 344 | "version_check", 345 | ] 346 | 347 | [[package]] 348 | name = "getrandom" 349 | version = "0.1.16" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 352 | dependencies = [ 353 | "cfg-if", 354 | "libc", 355 | "wasi 0.9.0+wasi-snapshot-preview1", 356 | ] 357 | 358 | [[package]] 359 | name = "getrandom" 360 | version = "0.2.7" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" 363 | dependencies = [ 364 | "cfg-if", 365 | "libc", 366 | "wasi 0.11.0+wasi-snapshot-preview1", 367 | ] 368 | 369 | [[package]] 370 | name = "group" 371 | version = "0.11.0" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" 374 | dependencies = [ 375 | "ff", 376 | "rand_core 0.6.3", 377 | "subtle", 378 | ] 379 | 380 | [[package]] 381 | name = "hex" 382 | version = "0.4.3" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 385 | 386 | [[package]] 387 | name = "hmac" 388 | version = "0.11.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" 391 | dependencies = [ 392 | "crypto-mac", 393 | "digest", 394 | ] 395 | 396 | [[package]] 397 | name = "itoa" 398 | version = "1.0.2" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" 401 | 402 | [[package]] 403 | name = "k256" 404 | version = "0.10.4" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" 407 | dependencies = [ 408 | "cfg-if", 409 | "ecdsa", 410 | "elliptic-curve", 411 | "sec1", 412 | "sha2", 413 | ] 414 | 415 | [[package]] 416 | name = "libc" 417 | version = "0.2.126" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" 420 | 421 | [[package]] 422 | name = "opaque-debug" 423 | version = "0.3.0" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 426 | 427 | [[package]] 428 | name = "pkcs8" 429 | version = "0.8.0" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" 432 | dependencies = [ 433 | "der", 434 | "spki", 435 | "zeroize", 436 | ] 437 | 438 | [[package]] 439 | name = "proc-macro2" 440 | version = "1.0.40" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" 443 | dependencies = [ 444 | "unicode-ident", 445 | ] 446 | 447 | [[package]] 448 | name = "quote" 449 | version = "1.0.20" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" 452 | dependencies = [ 453 | "proc-macro2", 454 | ] 455 | 456 | [[package]] 457 | name = "rand_core" 458 | version = "0.5.1" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 461 | dependencies = [ 462 | "getrandom 0.1.16", 463 | ] 464 | 465 | [[package]] 466 | name = "rand_core" 467 | version = "0.6.3" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 470 | dependencies = [ 471 | "getrandom 0.2.7", 472 | ] 473 | 474 | [[package]] 475 | name = "rfc6979" 476 | version = "0.1.0" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" 479 | dependencies = [ 480 | "crypto-bigint", 481 | "hmac", 482 | "zeroize", 483 | ] 484 | 485 | [[package]] 486 | name = "ryu" 487 | version = "1.0.10" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" 490 | 491 | [[package]] 492 | name = "schemars" 493 | version = "0.8.10" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "1847b767a3d62d95cbf3d8a9f0e421cf57a0d8aa4f411d4b16525afb0284d4ed" 496 | dependencies = [ 497 | "dyn-clone", 498 | "schemars_derive", 499 | "serde", 500 | "serde_json", 501 | ] 502 | 503 | [[package]] 504 | name = "schemars_derive" 505 | version = "0.8.10" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "af4d7e1b012cb3d9129567661a63755ea4b8a7386d339dc945ae187e403c6743" 508 | dependencies = [ 509 | "proc-macro2", 510 | "quote", 511 | "serde_derive_internals", 512 | "syn", 513 | ] 514 | 515 | [[package]] 516 | name = "sec1" 517 | version = "0.2.1" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" 520 | dependencies = [ 521 | "der", 522 | "generic-array", 523 | "pkcs8", 524 | "subtle", 525 | "zeroize", 526 | ] 527 | 528 | [[package]] 529 | name = "serde" 530 | version = "1.0.140" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" 533 | dependencies = [ 534 | "serde_derive", 535 | ] 536 | 537 | [[package]] 538 | name = "serde-json-wasm" 539 | version = "0.4.1" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" 542 | dependencies = [ 543 | "serde", 544 | ] 545 | 546 | [[package]] 547 | name = "serde_derive" 548 | version = "1.0.140" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" 551 | dependencies = [ 552 | "proc-macro2", 553 | "quote", 554 | "syn", 555 | ] 556 | 557 | [[package]] 558 | name = "serde_derive_internals" 559 | version = "0.26.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" 562 | dependencies = [ 563 | "proc-macro2", 564 | "quote", 565 | "syn", 566 | ] 567 | 568 | [[package]] 569 | name = "serde_json" 570 | version = "1.0.82" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" 573 | dependencies = [ 574 | "itoa", 575 | "ryu", 576 | "serde", 577 | ] 578 | 579 | [[package]] 580 | name = "sha2" 581 | version = "0.9.9" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 584 | dependencies = [ 585 | "block-buffer", 586 | "cfg-if", 587 | "cpufeatures", 588 | "digest", 589 | "opaque-debug", 590 | ] 591 | 592 | [[package]] 593 | name = "signature" 594 | version = "1.4.0" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" 597 | dependencies = [ 598 | "digest", 599 | "rand_core 0.6.3", 600 | ] 601 | 602 | [[package]] 603 | name = "spki" 604 | version = "0.5.4" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" 607 | dependencies = [ 608 | "base64ct", 609 | "der", 610 | ] 611 | 612 | [[package]] 613 | name = "static_assertions" 614 | version = "1.1.0" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 617 | 618 | [[package]] 619 | name = "subtle" 620 | version = "2.4.1" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 623 | 624 | [[package]] 625 | name = "syn" 626 | version = "1.0.98" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" 629 | dependencies = [ 630 | "proc-macro2", 631 | "quote", 632 | "unicode-ident", 633 | ] 634 | 635 | [[package]] 636 | name = "thiserror" 637 | version = "1.0.31" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" 640 | dependencies = [ 641 | "thiserror-impl", 642 | ] 643 | 644 | [[package]] 645 | name = "thiserror-impl" 646 | version = "1.0.31" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" 649 | dependencies = [ 650 | "proc-macro2", 651 | "quote", 652 | "syn", 653 | ] 654 | 655 | [[package]] 656 | name = "typenum" 657 | version = "1.15.0" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 660 | 661 | [[package]] 662 | name = "uint" 663 | version = "0.9.3" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" 666 | dependencies = [ 667 | "byteorder", 668 | "crunchy", 669 | "hex", 670 | "static_assertions", 671 | ] 672 | 673 | [[package]] 674 | name = "unicode-ident" 675 | version = "1.0.2" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" 678 | 679 | [[package]] 680 | name = "version_check" 681 | version = "0.9.4" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 684 | 685 | [[package]] 686 | name = "wasi" 687 | version = "0.9.0+wasi-snapshot-preview1" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 690 | 691 | [[package]] 692 | name = "wasi" 693 | version = "0.11.0+wasi-snapshot-preview1" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 696 | 697 | [[package]] 698 | name = "zeroize" 699 | version = "1.3.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" 702 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["packages/*", "contracts/*"] 3 | 4 | [profile.release.package.cw-ibc-queries] 5 | codegen-units = 1 6 | incremental = false 7 | 8 | [profile.release.package.cw-ibc-query] 9 | codegen-units = 1 10 | incremental = false 11 | 12 | [profile.release] 13 | rpath = false 14 | lto = true 15 | overflow-checks = true 16 | opt-level = 3 17 | debug = false 18 | debug-assertions = false 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CosmWasm IBC Queries 2 | Implements generic IBC queries in CosmWasm. This implementation requires the same contract to be deployed on both chains wishing to query each other. 3 | 4 | This contract is inspired by Confio's [cw-ibc-demo](https://github.com/confio/cw-ibc-demo), and from work done during HackAtom 2022. 5 | 6 | ## Unit Tests 7 | 8 | All unit tests are in Rust and assume a mocked out environment. 9 | They don't actually send packets between contracts in any way, 10 | but return a fully mocked response. This can run through many 11 | code paths and get a reasonable level of confidence in the basic 12 | logic. However, you will need to run through full-stack 13 | integration tests to actually have any confidence it will work 14 | as expected in production. 15 | 16 | To ensure they are proper, run the following in the repo root: 17 | 18 | ```shell 19 | cargo test 20 | ``` 21 | 22 | ## Integration Tests 23 | 24 | See the `tests` directory. 25 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/.gitignore: -------------------------------------------------------------------------------- 1 | debug.log -------------------------------------------------------------------------------- /ci-scripts/osmosis/README.md: -------------------------------------------------------------------------------- 1 | # Local Osmosisd development network 2 | 3 | Configuration is in the `env` file, that is the most likely place you want to adjust 4 | 5 | ## Initializing new data 6 | 7 | ```bash 8 | scripts/osmosis/generate_template.sh 9 | ``` 10 | 11 | Note that the addresses receiving tokens in genesis are set here, you can customize by editting this file 12 | 13 | ## Starting the blockchain 14 | 15 | Run the following: 16 | 17 | ```bash 18 | scripts/osmosis/start.sh 19 | ``` 20 | 21 | You get filtered output on the console. If it crashes and you want the full logs, look at `debug.log`. 22 | 23 | ## Stopping the blockchain 24 | 25 | While running the blockchain in one terminal, open a second one and run this: 26 | 27 | ```bash 28 | scripts/osmosis/stop.sh 29 | ``` 30 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/env: -------------------------------------------------------------------------------- 1 | REPOSITORY="confio/osmosis-ci" 2 | # Choose from https://hub.docker.com/r/cephalopodequipment/osmosisd/tags 3 | VERSION="9.0.0" 4 | CONTAINER_NAME="osmosis" 5 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/generate_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 6 | echo $SCRIPT_DIR 7 | # shellcheck source=./env 8 | # shellcheck disable=SC1091 9 | source "$SCRIPT_DIR"/env 10 | 11 | mkdir -p "$SCRIPT_DIR"/template 12 | 13 | echo "Trying docker $REPOSITORY:$VERSION" 14 | 15 | # The usage of the accounts below is documented in README.md of this directory 16 | docker run --rm \ 17 | --user=root \ 18 | -e TRANSFER_PORT=transfer \ 19 | --mount type=bind,source="$SCRIPT_DIR/template",target=/root \ 20 | "$REPOSITORY:$VERSION" \ 21 | /opt/setup.sh \ 22 | osmo1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83hdcc5d 23 | 24 | sudo chmod -R g+rwx template/.osmosisd/ 25 | sudo chmod -R a+rx template/.osmosisd/ 26 | 27 | # The ./template folder is created by the docker daemon's user (root on Linux, current user 28 | # when using Docker Desktop on macOS), let's make it ours if needed 29 | if [ ! -x "$SCRIPT_DIR/template/.osmosisd/config/gentx" ]; then 30 | sudo chown -R "$(id -u):$(id -g)" "$SCRIPT_DIR/template" 31 | fi 32 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Please keep this in sync with the Ports overview in HACKING.md 6 | TENDERMINT_PORT_GUEST="26657" 7 | TENDERMINT_PORT_HOST="26653" 8 | 9 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 10 | # shellcheck source=./env 11 | # shellcheck disable=SC1091 12 | source "$SCRIPT_DIR"/env 13 | 14 | # Use a fresh volume for every start 15 | docker volume rm -f osmosis_data 16 | # only pull if we don't have it 17 | (docker images | grep "$REPOSITORY" | grep -q "$VERSION") || docker pull "$REPOSITORY:$VERSION" 18 | 19 | echo "starting osmosisd running on http://localhost:$TENDERMINT_PORT_HOST" 20 | 21 | docker run --rm \ 22 | --user=root \ 23 | --name "$CONTAINER_NAME" \ 24 | -p "$TENDERMINT_PORT_HOST":"$TENDERMINT_PORT_GUEST" \ 25 | --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ 26 | --mount type=volume,source=osmosis_data,target=/root \ 27 | "$REPOSITORY:$VERSION" \ 28 | 2>&1 | tee debug.log | grep 'executed block' 29 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 6 | # shellcheck source=./env 7 | # shellcheck disable=SC1091 8 | source "$SCRIPT_DIR"/env 9 | 10 | echo "Killing osmosisd container..." 11 | docker container kill "$CONTAINER_NAME" 12 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/6fc458e78b00b50b013a0fa11b2d5e1fdcc4029c.address: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMi0wNy0yMCAxOTo0NToxMi41NjA2NzAzODkgKzAwMDAgVVRDIG09KzAuNjUzOTIzMzc2IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiaENnU202RTBtWFhlY1l5VyJ9.8Efu-9QYciwxAT5pmQAuAyBNJtbMM9TdKI-ENVYaGsB4_djL7BrbPA.4F_EKWRdkvTDp6ql.Qqt5AoHVIUkQFqYodggrvm41dy-ztkfrVo1EUF_pb-VDakKY8WpLmY49RfNioxciQ2uwjCTIss6Tn7upooeUPh75N2zZeLtTVl41zbqyvL8b7Lb2tmw1k3FmMQUAw_zx8u4FPklXQ3guIkhXEkB_IF635ZK5GK7iZh3s30M-Wk4UrzVwefZiyMB4PaTnjpSKFblt7dwZ4C4DPAAofyH9P9urrJQN_qaNVvaFV70auYZRyXgQ79ybG5gD.CvvYRZn-hFxXGqvaRJ9REQ -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/app.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | ############################################################################### 5 | ### Base Configuration ### 6 | ############################################################################### 7 | 8 | # The minimum gas prices a validator is willing to accept for processing a 9 | # transaction. A transaction's fees must meet the minimum of any denomination 10 | # specified in this config (e.g. 0.25token1;0.0001token2). 11 | minimum-gas-prices = "0uosmo" 12 | 13 | # default: only the last 100,000 states(approximately 1 week worth of state) are kept; pruning at 100 block intervals 14 | # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) 15 | # everything: 10 latest states will be kept; pruning at 10 block intervals. 16 | # custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' 17 | pruning = "default" 18 | 19 | # These are applied if and only if the pruning strategy is custom. 20 | # pruning-keep-recent = N means keep all of the last N states 21 | pruning-keep-recent = "0" 22 | # pruning-interval = N means we delete old states from disk every Nth block. 23 | pruning-interval = "0" 24 | 25 | # HaltHeight contains a non-zero block height at which a node will gracefully 26 | # halt and shutdown that can be used to assist upgrades and testing. 27 | # 28 | # Note: Commitment of state will be attempted on the corresponding block. 29 | halt-height = 0 30 | 31 | # HaltTime contains a non-zero minimum block time (in Unix seconds) at which 32 | # a node will gracefully halt and shutdown that can be used to assist upgrades 33 | # and testing. 34 | # 35 | # Note: Commitment of state will be attempted on the corresponding block. 36 | halt-time = 0 37 | 38 | # MinRetainBlocks defines the minimum block height offset from the current 39 | # block being committed, such that all blocks past this offset are pruned 40 | # from Tendermint. It is used as part of the process of determining the 41 | # ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates 42 | # that no blocks should be pruned. 43 | # 44 | # This configuration value is only responsible for pruning Tendermint blocks. 45 | # It has no bearing on application state pruning which is determined by the 46 | # "pruning-*" configurations. 47 | # 48 | # Note: Tendermint block pruning is dependant on this parameter in conunction 49 | # with the unbonding (safety threshold) period, state pruning and state sync 50 | # snapshot parameters to determine the correct minimum value of 51 | # ResponseCommit.RetainHeight. 52 | min-retain-blocks = 0 53 | 54 | # InterBlockCache enables inter-block caching. 55 | inter-block-cache = true 56 | 57 | # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, 58 | # which informs Tendermint what to index. If empty, all events will be indexed. 59 | # 60 | # Example: 61 | # ["message.sender", "message.recipient"] 62 | index-events = [] 63 | 64 | # IavlCacheSize set the size of the iavl tree cache. 65 | # Default cache size is 50mb. 66 | iavl-cache-size = 781250 67 | 68 | ############################################################################### 69 | ### Telemetry Configuration ### 70 | ############################################################################### 71 | 72 | [telemetry] 73 | 74 | # Prefixed with keys to separate services. 75 | service-name = "" 76 | 77 | # Enabled enables the application telemetry functionality. When enabled, 78 | # an in-memory sink is also enabled by default. Operators may also enabled 79 | # other sinks such as Prometheus. 80 | enabled = false 81 | 82 | # Enable prefixing gauge values with hostname. 83 | enable-hostname = false 84 | 85 | # Enable adding hostname to labels. 86 | enable-hostname-label = false 87 | 88 | # Enable adding service to labels. 89 | enable-service-label = false 90 | 91 | # PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. 92 | prometheus-retention-time = 0 93 | 94 | # GlobalLabels defines a global set of name/value label tuples applied to all 95 | # metrics emitted using the wrapper functions defined in telemetry package. 96 | # 97 | # Example: 98 | # [["chain_id", "cosmoshub-1"]] 99 | global-labels = [ 100 | ] 101 | 102 | ############################################################################### 103 | ### API Configuration ### 104 | ############################################################################### 105 | 106 | [api] 107 | 108 | # Enable defines if the API server should be enabled. 109 | enable = true 110 | 111 | # Swagger defines if swagger documentation should automatically be registered. 112 | swagger = false 113 | 114 | # Address defines the API server to listen on. 115 | address = "tcp://0.0.0.0:1317" 116 | 117 | # MaxOpenConnections defines the number of maximum open connections. 118 | max-open-connections = 1000 119 | 120 | # RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). 121 | rpc-read-timeout = 10 122 | 123 | # RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). 124 | rpc-write-timeout = 0 125 | 126 | # RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). 127 | rpc-max-body-bytes = 1000000 128 | 129 | # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). 130 | enabled-unsafe-cors = true 131 | 132 | ############################################################################### 133 | ### Rosetta Configuration ### 134 | ############################################################################### 135 | 136 | [rosetta] 137 | 138 | # Enable defines if the Rosetta API server should be enabled. 139 | enable = true 140 | 141 | # Address defines the Rosetta API server to listen on. 142 | address = ":8080" 143 | 144 | # Network defines the name of the blockchain that will be returned by Rosetta. 145 | blockchain = "app" 146 | 147 | # Network defines the name of the network that will be returned by Rosetta. 148 | network = "network" 149 | 150 | # Retries defines the number of retries when connecting to the node before failing. 151 | retries = 3 152 | 153 | # Offline defines if Rosetta server should run in offline mode. 154 | offline = false 155 | 156 | ############################################################################### 157 | ### gRPC Configuration ### 158 | ############################################################################### 159 | 160 | [grpc] 161 | 162 | # Enable defines if the gRPC server should be enabled. 163 | enable = true 164 | 165 | # Address defines the gRPC server address to bind to. 166 | address = "0.0.0.0:9090" 167 | 168 | # MaxRecvMsgSize defines the max message size in bytes the server can receive. 169 | # The default value is 4MB. 170 | max-recv-msg-size = "10485760" 171 | 172 | # MaxSendMsgSize defines the max message size in bytes the server can send. 173 | # The default value is math.MaxInt32. 174 | max-send-msg-size = "2147483647" 175 | 176 | ############################################################################### 177 | ### gRPC Web Configuration ### 178 | ############################################################################### 179 | 180 | [grpc-web] 181 | 182 | # GRPCWebEnable defines if the gRPC-web should be enabled. 183 | # NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. 184 | enable = true 185 | 186 | # Address defines the gRPC-web server address to bind to. 187 | address = "0.0.0.0:9091" 188 | 189 | # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). 190 | enable-unsafe-cors = false 191 | 192 | ############################################################################### 193 | ### State Sync Configuration ### 194 | ############################################################################### 195 | 196 | # State sync snapshots allow other nodes to rapidly join the network without replaying historical 197 | # blocks, instead downloading and applying a snapshot of the application state at a given height. 198 | [state-sync] 199 | 200 | # snapshot-interval specifies the block interval at which local state sync snapshots are 201 | # taken (0 to disable). 202 | snapshot-interval = 1500 203 | 204 | # snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). 205 | snapshot-keep-recent = 2 206 | 207 | ############################################################################### 208 | ### Osmosis Mempool Configuration ### 209 | ############################################################################### 210 | 211 | [osmosis-mempool] 212 | # This is the max allowed gas any tx. 213 | # This is only for local mempool purposes, and thus is only ran on check tx. 214 | max-gas-wanted-per-tx = "25000000" 215 | 216 | # This is the minimum gas fee any arbitrage tx should have, denominated in uosmo per gas 217 | # Default value of ".005" then means that a tx with 1 million gas costs (.005 uosmo/gas) * 1_000_000 gas = .005 osmo 218 | arbitrage-min-gas-fee = ".005" 219 | 220 | # This is the minimum gas fee any tx with high gas demand should have, denominated in uosmo per gas 221 | # Default value of ".0025" then means that a tx with 1 million gas costs (.0025 uosmo/gas) * 1_000_000 gas = .0025 osmo 222 | min-gas-price-for-high-gas-tx = ".0025" 223 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/client.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | ############################################################################### 5 | ### Client Configuration ### 6 | ############################################################################### 7 | 8 | # The network chain ID 9 | chain-id = "" 10 | # The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) 11 | keyring-backend = "os" 12 | # CLI output format (text|json) 13 | output = "text" 14 | # : to Tendermint RPC interface for this chain 15 | node = "tcp://localhost:26657" 16 | # Transaction broadcasting mode (sync|async|block) 17 | broadcast-mode = "sync" 18 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/config.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | # NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or 5 | # relative to the home directory (e.g. "data"). The home directory is 6 | # "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable 7 | # or --home cmd flag. 8 | 9 | ####################################################################### 10 | ### Main Base Config Options ### 11 | ####################################################################### 12 | 13 | # TCP or UNIX socket address of the ABCI application, 14 | # or the name of an ABCI application compiled in with the Tendermint binary 15 | proxy_app = "tcp://127.0.0.1:26658" 16 | 17 | # A custom human readable name for this node 18 | moniker = "osmo-moniker" 19 | 20 | # If this node is many blocks behind the tip of the chain, FastSync 21 | # allows them to catchup quickly by downloading blocks in parallel 22 | # and verifying their commits 23 | fast_sync = true 24 | 25 | # Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb 26 | # * goleveldb (github.com/syndtr/goleveldb - most popular implementation) 27 | # - pure go 28 | # - stable 29 | # * cleveldb (uses levigo wrapper) 30 | # - fast 31 | # - requires gcc 32 | # - use cleveldb build tag (go build -tags cleveldb) 33 | # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) 34 | # - EXPERIMENTAL 35 | # - may be faster is some use-cases (random reads - indexer) 36 | # - use boltdb build tag (go build -tags boltdb) 37 | # * rocksdb (uses github.com/tecbot/gorocksdb) 38 | # - EXPERIMENTAL 39 | # - requires gcc 40 | # - use rocksdb build tag (go build -tags rocksdb) 41 | # * badgerdb (uses github.com/dgraph-io/badger) 42 | # - EXPERIMENTAL 43 | # - use badgerdb build tag (go build -tags badgerdb) 44 | db_backend = "goleveldb" 45 | 46 | # Database directory 47 | db_dir = "data" 48 | 49 | # Output level for logging, including package level options 50 | log_level = "info" 51 | 52 | # Output format: 'plain' (colored text) or 'json' 53 | log_format = "plain" 54 | 55 | ##### additional base config options ##### 56 | 57 | # Path to the JSON file containing the initial validator set and other meta data 58 | genesis_file = "config/genesis.json" 59 | 60 | # Path to the JSON file containing the private key to use as a validator in the consensus protocol 61 | priv_validator_key_file = "config/priv_validator_key.json" 62 | 63 | # Path to the JSON file containing the last sign state of a validator 64 | priv_validator_state_file = "data/priv_validator_state.json" 65 | 66 | # TCP or UNIX socket address for Tendermint to listen on for 67 | # connections from an external PrivValidator process 68 | priv_validator_laddr = "" 69 | 70 | # Path to the JSON file containing the private key to use for node authentication in the p2p protocol 71 | node_key_file = "config/node_key.json" 72 | 73 | # Mechanism to connect to the ABCI application: socket | grpc 74 | abci = "socket" 75 | 76 | # If true, query the ABCI app on connecting to a new peer 77 | # so the app can decide if we should keep the connection or not 78 | filter_peers = false 79 | 80 | 81 | ####################################################################### 82 | ### Advanced Configuration Options ### 83 | ####################################################################### 84 | 85 | ####################################################### 86 | ### RPC Server Configuration Options ### 87 | ####################################################### 88 | [rpc] 89 | 90 | # TCP or UNIX socket address for the RPC server to listen on 91 | laddr = "tcp://127.0.0.1:26657" 92 | 93 | # A list of origins a cross-domain request can be executed from 94 | # Default value '[]' disables cors support 95 | # Use '["*"]' to allow any origin 96 | cors_allowed_origins = ["*"] 97 | 98 | # A list of methods the client is allowed to use with cross-domain requests 99 | cors_allowed_methods = ["HEAD", "GET", "POST", ] 100 | 101 | # A list of non simple headers the client is allowed to use with cross-domain requests 102 | cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] 103 | 104 | # TCP or UNIX socket address for the gRPC server to listen on 105 | # NOTE: This server only supports /broadcast_tx_commit 106 | grpc_laddr = "" 107 | 108 | # Maximum number of simultaneous connections. 109 | # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections 110 | # If you want to accept a larger number than the default, make sure 111 | # you increase your OS limits. 112 | # 0 - unlimited. 113 | # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} 114 | # 1024 - 40 - 10 - 50 = 924 = ~900 115 | grpc_max_open_connections = 900 116 | 117 | # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool 118 | unsafe = false 119 | 120 | # Maximum number of simultaneous connections (including WebSocket). 121 | # Does not include gRPC connections. See grpc_max_open_connections 122 | # If you want to accept a larger number than the default, make sure 123 | # you increase your OS limits. 124 | # 0 - unlimited. 125 | # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} 126 | # 1024 - 40 - 10 - 50 = 924 = ~900 127 | max_open_connections = 900 128 | 129 | # Maximum number of unique clientIDs that can /subscribe 130 | # If you're using /broadcast_tx_commit, set to the estimated maximum number 131 | # of broadcast_tx_commit calls per block. 132 | max_subscription_clients = 100 133 | 134 | # Maximum number of unique queries a given client can /subscribe to 135 | # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to 136 | # the estimated # maximum number of broadcast_tx_commit calls per block. 137 | max_subscriptions_per_client = 5 138 | 139 | # Experimental parameter to specify the maximum number of events a node will 140 | # buffer, per subscription, before returning an error and closing the 141 | # subscription. Must be set to at least 100, but higher values will accommodate 142 | # higher event throughput rates (and will use more memory). 143 | experimental_subscription_buffer_size = 200 144 | 145 | # Experimental parameter to specify the maximum number of RPC responses that 146 | # can be buffered per WebSocket client. If clients cannot read from the 147 | # WebSocket endpoint fast enough, they will be disconnected, so increasing this 148 | # parameter may reduce the chances of them being disconnected (but will cause 149 | # the node to use more memory). 150 | # 151 | # Must be at least the same as "experimental_subscription_buffer_size", 152 | # otherwise connections could be dropped unnecessarily. This value should 153 | # ideally be somewhat higher than "experimental_subscription_buffer_size" to 154 | # accommodate non-subscription-related RPC responses. 155 | experimental_websocket_write_buffer_size = 200 156 | 157 | # If a WebSocket client cannot read fast enough, at present we may 158 | # silently drop events instead of generating an error or disconnecting the 159 | # client. 160 | # 161 | # Enabling this experimental parameter will cause the WebSocket connection to 162 | # be closed instead if it cannot read fast enough, allowing for greater 163 | # predictability in subscription behaviour. 164 | experimental_close_on_slow_client = false 165 | 166 | # How long to wait for a tx to be committed during /broadcast_tx_commit. 167 | # WARNING: Using a value larger than 10s will result in increasing the 168 | # global HTTP write timeout, which applies to all connections and endpoints. 169 | # See https://github.com/tendermint/tendermint/issues/3435 170 | timeout_broadcast_tx_commit = "10s" 171 | 172 | # Maximum size of request body, in bytes 173 | max_body_bytes = 1000000 174 | 175 | # Maximum size of request header, in bytes 176 | max_header_bytes = 1048576 177 | 178 | # The path to a file containing certificate that is used to create the HTTPS server. 179 | # Might be either absolute path or path related to Tendermint's config directory. 180 | # If the certificate is signed by a certificate authority, 181 | # the certFile should be the concatenation of the server's certificate, any intermediates, 182 | # and the CA's certificate. 183 | # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. 184 | # Otherwise, HTTP server is run. 185 | tls_cert_file = "" 186 | 187 | # The path to a file containing matching private key that is used to create the HTTPS server. 188 | # Might be either absolute path or path related to Tendermint's config directory. 189 | # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server. 190 | # Otherwise, HTTP server is run. 191 | tls_key_file = "" 192 | 193 | # pprof listen address (https://golang.org/pkg/net/http/pprof) 194 | pprof_laddr = "localhost:6060" 195 | 196 | ####################################################### 197 | ### P2P Configuration Options ### 198 | ####################################################### 199 | [p2p] 200 | 201 | # Address to listen for incoming connections 202 | laddr = "tcp://0.0.0.0:26656" 203 | 204 | # Address to advertise to peers for them to dial 205 | # If empty, will use the same port as the laddr, 206 | # and will introspect on the listener or use UPnP 207 | # to figure out the address. ip and port are required 208 | # example: 159.89.10.97:26656 209 | external_address = "" 210 | 211 | # Comma separated list of seed nodes to connect to 212 | seeds = "21d7539792ee2e0d650b199bf742c56ae0cf499e@162.55.132.230:2000,44ff091135ef2c69421eacfa136860472ac26e60@65.21.141.212:2000,ec4d3571bf709ab78df61716e47b5ac03d077a1a@65.108.43.26:2000,4cb8e1e089bdf44741b32638591944dc15b7cce3@65.108.73.18:2000,f515a8599b40f0e84dfad935ba414674ab11a668@osmosis.blockpane.com:26656,6bcdbcfd5d2c6ba58460f10dbcfde58278212833@osmosis.artifact-staking.io:26656,24841abfc8fbd401d8c86747eec375649a2e8a7e@osmosis.pbcups.org:26656,77bb5fb9b6964d6e861e91c1d55cf82b67d838b5@bd-osmosis-seed-mainnet-us-01.bdnodes.net:26656,3243426ab56b67f794fa60a79cc7f11bc7aa752d@bd-osmosis-seed-mainnet-eu-02.bdnodes.net:26656,6fc23ee451a5969853825d861532676b84d7bf0c@osmosis.mainnet.seed.blockngine.io:26716,7c66126b64cd66bafd9ccfc721f068df451d31a3@osmosis-seed.sunshinevalidation.io:9393" 213 | 214 | # Comma separated list of nodes to keep persistent connections to 215 | persistent_peers = "" 216 | 217 | # UPNP port forwarding 218 | upnp = false 219 | 220 | # Path to address book 221 | addr_book_file = "config/addrbook.json" 222 | 223 | # Set true for strict address routability rules 224 | # Set false for private or local networks 225 | addr_book_strict = true 226 | 227 | # Maximum number of inbound peers 228 | max_num_inbound_peers = 320 229 | 230 | # Maximum number of outbound peers to connect to, excluding persistent peers 231 | max_num_outbound_peers = 40 232 | 233 | # List of node IDs, to which a connection will be (re)established ignoring any existing limits 234 | unconditional_peer_ids = "" 235 | 236 | # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) 237 | persistent_peers_max_dial_period = "0s" 238 | 239 | # Time to wait before flushing messages out on the connection 240 | flush_throttle_timeout = "100ms" 241 | 242 | # Maximum size of a message packet payload, in bytes 243 | max_packet_msg_payload_size = 1024 244 | 245 | # Rate at which packets can be sent, in bytes/second 246 | send_rate = 5120000 247 | 248 | # Rate at which packets can be received, in bytes/second 249 | recv_rate = 5120000 250 | 251 | # Set true to enable the peer-exchange reactor 252 | pex = true 253 | 254 | # Seed mode, in which node constantly crawls the network and looks for 255 | # peers. If another node asks it for addresses, it responds and disconnects. 256 | # 257 | # Does not work if the peer-exchange reactor is disabled. 258 | seed_mode = false 259 | 260 | # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 261 | private_peer_ids = "" 262 | 263 | # Toggle to disable guard against peers connecting from the same ip. 264 | allow_duplicate_ip = false 265 | 266 | # Peer connection configuration. 267 | handshake_timeout = "20s" 268 | dial_timeout = "3s" 269 | 270 | ####################################################### 271 | ### Mempool Configuration Option ### 272 | ####################################################### 273 | [mempool] 274 | 275 | recheck = true 276 | broadcast = true 277 | wal_dir = "" 278 | 279 | # Maximum number of transactions in the mempool 280 | size = 10000 281 | 282 | # Limit the total size of all txs in the mempool. 283 | # This only accounts for raw transactions (e.g. given 1MB transactions and 284 | # max_txs_bytes=5MB, mempool will only accept 5 transactions). 285 | max_txs_bytes = 1073741824 286 | 287 | # Size of the cache (used to filter transactions we saw earlier) in transactions 288 | cache_size = 10000 289 | 290 | # Do not remove invalid transactions from the cache (default: false) 291 | # Set to true if it's not possible for any invalid transaction to become valid 292 | # again in the future. 293 | keep-invalid-txs-in-cache = false 294 | 295 | # Maximum size of a single transaction. 296 | # NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. 297 | max_tx_bytes = 1048576 298 | 299 | # Maximum size of a batch of transactions to send to a peer 300 | # Including space needed by encoding (one varint per transaction). 301 | # XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 302 | max_batch_bytes = 0 303 | 304 | ####################################################### 305 | ### State Sync Configuration Options ### 306 | ####################################################### 307 | [statesync] 308 | # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine 309 | # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in 310 | # the network to take and serve state machine snapshots. State sync is not attempted if the node 311 | # has any local state (LastBlockHeight > 0). The node will have a truncated block history, 312 | # starting from the height of the snapshot. 313 | enable = false 314 | 315 | # RPC servers (comma-separated) for light client verification of the synced state machine and 316 | # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding 317 | # header hash obtained from a trusted source, and a period during which validators can be trusted. 318 | # 319 | # For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 320 | # weeks) during which they can be financially punished (slashed) for misbehavior. 321 | rpc_servers = "" 322 | trust_height = 0 323 | trust_hash = "" 324 | trust_period = "112h0m0s" 325 | 326 | # Time to spend discovering snapshots before initiating a restore. 327 | discovery_time = "15s" 328 | 329 | # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). 330 | # Will create a new, randomly named directory within, and remove it when done. 331 | temp_dir = "" 332 | 333 | # The timeout duration before re-requesting a chunk, possibly from a different 334 | # peer (default: 1 minute). 335 | chunk_request_timeout = "10s" 336 | 337 | # The number of concurrent chunk fetchers to run (default: 1). 338 | chunk_fetchers = "4" 339 | 340 | ####################################################### 341 | ### Fast Sync Configuration Connections ### 342 | ####################################################### 343 | [fastsync] 344 | 345 | # Fast Sync version to use: 346 | # 1) "v0" (default) - the legacy fast sync implementation 347 | # 2) "v1" - refactor of v0 version for better testability 348 | # 2) "v2" - complete redesign of v0, optimized for testability & readability 349 | version = "v0" 350 | 351 | ####################################################### 352 | ### Consensus Configuration Options ### 353 | ####################################################### 354 | [consensus] 355 | 356 | wal_file = "data/cs.wal/wal" 357 | 358 | # How long we wait for a proposal block before prevoting nil 359 | timeout_propose = "100ms" 360 | # How much timeout_propose increases with each round 361 | timeout_propose_delta = "100ms" 362 | # How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) 363 | timeout_prevote = "100ms" 364 | # How much the timeout_prevote increases with each round 365 | timeout_prevote_delta = "100ms" 366 | # How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) 367 | timeout_precommit = "100ms" 368 | # How much the timeout_precommit increases with each round 369 | timeout_precommit_delta = "100ms" 370 | # How long we wait after committing a block, before starting on the new 371 | # height (this gives us a chance to receive some more precommits, even 372 | # though we already have +2/3). 373 | timeout_commit = "200ms" 374 | 375 | # How many blocks to look back to check existence of the node's consensus votes before joining consensus 376 | # When non-zero, the node will panic upon restart 377 | # if the same consensus key was used to sign {double_sign_check_height} last blocks. 378 | # So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. 379 | double_sign_check_height = 0 380 | 381 | # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) 382 | skip_timeout_commit = false 383 | 384 | # EmptyBlocks mode and possible interval between empty blocks 385 | create_empty_blocks = true 386 | create_empty_blocks_interval = "0s" 387 | 388 | # Reactor sleep duration parameters 389 | peer_gossip_sleep_duration = "100ms" 390 | peer_query_maj23_sleep_duration = "2s" 391 | 392 | ####################################################### 393 | ### Transaction Indexer Configuration Options ### 394 | ####################################################### 395 | [tx_index] 396 | 397 | # What indexer to use for transactions 398 | # 399 | # The application will set which txs to index. In some cases a node operator will be able 400 | # to decide which txs to index based on configuration set in the application. 401 | # 402 | # Options: 403 | # 1) "null" 404 | # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). 405 | # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. 406 | indexer = "kv" 407 | 408 | ####################################################### 409 | ### Instrumentation Configuration Options ### 410 | ####################################################### 411 | [instrumentation] 412 | 413 | # When true, Prometheus metrics are served under /metrics on 414 | # PrometheusListenAddr. 415 | # Check out the documentation for the list of available metrics. 416 | prometheus = false 417 | 418 | # Address to listen for Prometheus collector(s) connections 419 | prometheus_listen_addr = ":26660" 420 | 421 | # Maximum number of simultaneous connections. 422 | # If you want to accept a larger number than the default, make sure 423 | # you increase your OS limits. 424 | # 0 - unlimited. 425 | max_open_connections = 3 426 | 427 | # Instrumentation namespace 428 | namespace = "tendermint" 429 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "app_hash": "", 3 | "app_state": { 4 | "auth": { 5 | "accounts": [ 6 | { 7 | "@type": "/cosmos.auth.v1beta1.BaseAccount", 8 | "account_number": "0", 9 | "address": "osmo1dlz93eutqz6skqf6p7s3kt27rlwvgq5up9xma3", 10 | "pub_key": null, 11 | "sequence": "0" 12 | }, 13 | { 14 | "@type": "/cosmos.auth.v1beta1.BaseAccount", 15 | "account_number": "0", 16 | "address": "osmo1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83hdcc5d", 17 | "pub_key": null, 18 | "sequence": "0" 19 | } 20 | ], 21 | "params": { 22 | "max_memo_characters": "256", 23 | "sig_verify_cost_ed25519": "590", 24 | "sig_verify_cost_secp256k1": "1000", 25 | "tx_sig_limit": "7", 26 | "tx_size_cost_per_byte": "10" 27 | } 28 | }, 29 | "authz": { 30 | "authorization": [] 31 | }, 32 | "bank": { 33 | "balances": [ 34 | { 35 | "address": "osmo1dlz93eutqz6skqf6p7s3kt27rlwvgq5up9xma3", 36 | "coins": [ 37 | { 38 | "amount": "1000000000", 39 | "denom": "uosmo" 40 | } 41 | ] 42 | }, 43 | { 44 | "address": "osmo1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83hdcc5d", 45 | "coins": [ 46 | { 47 | "amount": "1000000000", 48 | "denom": "uosmo" 49 | } 50 | ] 51 | } 52 | ], 53 | "denom_metadata": [], 54 | "params": { 55 | "default_send_enabled": true, 56 | "send_enabled": [] 57 | }, 58 | "supply": [] 59 | }, 60 | "bech32ibc": { 61 | "hrpIBCRecords": [], 62 | "nativeHRP": "osmo" 63 | }, 64 | "capability": { 65 | "index": "1", 66 | "owners": [] 67 | }, 68 | "crisis": { 69 | "constant_fee": { 70 | "amount": "1000", 71 | "denom": "uosmo" 72 | } 73 | }, 74 | "distribution": { 75 | "delegator_starting_infos": [], 76 | "delegator_withdraw_infos": [], 77 | "fee_pool": { 78 | "community_pool": [] 79 | }, 80 | "outstanding_rewards": [], 81 | "params": { 82 | "base_proposer_reward": "0.010000000000000000", 83 | "bonus_proposer_reward": "0.040000000000000000", 84 | "community_tax": "0.020000000000000000", 85 | "withdraw_addr_enabled": true 86 | }, 87 | "previous_proposer": "", 88 | "validator_accumulated_commissions": [], 89 | "validator_current_rewards": [], 90 | "validator_historical_rewards": [], 91 | "validator_slash_events": [] 92 | }, 93 | "epochs": { 94 | "epochs": [ 95 | { 96 | "current_epoch": "0", 97 | "current_epoch_start_height": "0", 98 | "current_epoch_start_time": "0001-01-01T00:00:00Z", 99 | "duration": "604800s", 100 | "epoch_counting_started": false, 101 | "identifier": "week", 102 | "start_time": "0001-01-01T00:00:00Z" 103 | }, 104 | { 105 | "current_epoch": "0", 106 | "current_epoch_start_height": "0", 107 | "current_epoch_start_time": "0001-01-01T00:00:00Z", 108 | "duration": "86400s", 109 | "epoch_counting_started": false, 110 | "identifier": "day", 111 | "start_time": "0001-01-01T00:00:00Z" 112 | } 113 | ] 114 | }, 115 | "evidence": { 116 | "evidence": [] 117 | }, 118 | "gamm": { 119 | "next_pool_number": "1", 120 | "params": { 121 | "pool_creation_fee": [ 122 | { 123 | "amount": "1000000000", 124 | "denom": "uosmo" 125 | } 126 | ] 127 | }, 128 | "pools": [] 129 | }, 130 | "genutil": { 131 | "gen_txs": [ 132 | { 133 | "auth_info": { 134 | "fee": { 135 | "amount": [], 136 | "gas_limit": "350000", 137 | "granter": "", 138 | "payer": "" 139 | }, 140 | "signer_infos": [ 141 | { 142 | "mode_info": { 143 | "single": { 144 | "mode": "SIGN_MODE_DIRECT" 145 | } 146 | }, 147 | "public_key": { 148 | "@type": "/cosmos.crypto.secp256k1.PubKey", 149 | "key": "A+WeeHXm8WuDNWQ21OorfzGpIvGOqLYFlEYS+niPO7Gx" 150 | }, 151 | "sequence": "0" 152 | } 153 | ] 154 | }, 155 | "body": { 156 | "extension_options": [], 157 | "memo": "8c3f5817e96cc2a75d729f89a8ddfe23883f6c34@172.17.0.2:26656", 158 | "messages": [ 159 | { 160 | "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", 161 | "commission": { 162 | "max_change_rate": "0.010000000000000000", 163 | "max_rate": "0.200000000000000000", 164 | "rate": "0.100000000000000000" 165 | }, 166 | "delegator_address": "osmo1dlz93eutqz6skqf6p7s3kt27rlwvgq5up9xma3", 167 | "description": { 168 | "details": "", 169 | "identity": "", 170 | "moniker": "osmo-moniker", 171 | "security_contact": "", 172 | "website": "" 173 | }, 174 | "min_self_delegation": "1", 175 | "pubkey": { 176 | "@type": "/cosmos.crypto.ed25519.PubKey", 177 | "key": "SqQYMs5aVi4XUZP2Pet4YnhVQFWsWGpZZzewg1fLUjg=" 178 | }, 179 | "validator_address": "osmovaloper1dlz93eutqz6skqf6p7s3kt27rlwvgq5umjwc2k", 180 | "value": { 181 | "amount": "3000000", 182 | "denom": "uosmo" 183 | } 184 | } 185 | ], 186 | "non_critical_extension_options": [], 187 | "timeout_height": "0" 188 | }, 189 | "signatures": [ 190 | "jniNpsTjH5FtktRzMt91mhHZPfwYxRG3Hy4ITNQX0I49oX8nQ1NNbR2vmyebZwWLORrkoy9mvXBpMLtNZqyebQ==" 191 | ] 192 | } 193 | ] 194 | }, 195 | "gov": { 196 | "deposit_params": { 197 | "max_deposit_period": "172800s", 198 | "min_deposit": [ 199 | { 200 | "amount": "10000000", 201 | "denom": "uosmo" 202 | } 203 | ] 204 | }, 205 | "deposits": [], 206 | "proposals": [], 207 | "starting_proposal_id": "1", 208 | "tally_params": { 209 | "quorum": "0.334000000000000000", 210 | "threshold": "0.500000000000000000", 211 | "veto_threshold": "0.334000000000000000" 212 | }, 213 | "votes": [], 214 | "voting_params": { 215 | "voting_period": "172800s" 216 | } 217 | }, 218 | "ibc": { 219 | "channel_genesis": { 220 | "ack_sequences": [], 221 | "acknowledgements": [], 222 | "channels": [], 223 | "commitments": [], 224 | "next_channel_sequence": "0", 225 | "receipts": [], 226 | "recv_sequences": [], 227 | "send_sequences": [] 228 | }, 229 | "client_genesis": { 230 | "clients": [], 231 | "clients_consensus": [], 232 | "clients_metadata": [], 233 | "create_localhost": false, 234 | "next_client_sequence": "0", 235 | "params": { 236 | "allowed_clients": [ 237 | "06-solomachine", 238 | "07-tendermint" 239 | ] 240 | } 241 | }, 242 | "connection_genesis": { 243 | "client_connection_paths": [], 244 | "connections": [], 245 | "next_connection_sequence": "0", 246 | "params": { 247 | "max_expected_time_per_block": "30000000000" 248 | } 249 | } 250 | }, 251 | "incentives": { 252 | "gauges": [], 253 | "last_gauge_id": "0", 254 | "lockable_durations": [ 255 | "1s", 256 | "3600s", 257 | "10800s", 258 | "25200s" 259 | ], 260 | "params": { 261 | "distr_epoch_identifier": "week" 262 | } 263 | }, 264 | "lockup": { 265 | "last_lock_id": "0", 266 | "locks": [], 267 | "synthetic_locks": [] 268 | }, 269 | "mint": { 270 | "halven_started_epoch": "0", 271 | "minter": { 272 | "epoch_provisions": "0.000000000000000000" 273 | }, 274 | "params": { 275 | "distribution_proportions": { 276 | "community_pool": "0.100000000000000000", 277 | "developer_rewards": "0.200000000000000000", 278 | "pool_incentives": "0.300000000000000000", 279 | "staking": "0.400000000000000000" 280 | }, 281 | "epoch_identifier": "week", 282 | "genesis_epoch_provisions": "5000000.000000000000000000", 283 | "mint_denom": "uosmo", 284 | "minting_rewards_distribution_start_epoch": "0", 285 | "reduction_factor": "0.500000000000000000", 286 | "reduction_period_in_epochs": "156", 287 | "weighted_developer_rewards_receivers": [] 288 | } 289 | }, 290 | "params": null, 291 | "poolincentives": { 292 | "distr_info": { 293 | "records": [], 294 | "total_weight": "0" 295 | }, 296 | "lockable_durations": [ 297 | "3600s", 298 | "10800s", 299 | "25200s" 300 | ], 301 | "params": { 302 | "minted_denom": "uosmo" 303 | } 304 | }, 305 | "slashing": { 306 | "missed_blocks": [], 307 | "params": { 308 | "downtime_jail_duration": "600s", 309 | "min_signed_per_window": "0.500000000000000000", 310 | "signed_blocks_window": "100", 311 | "slash_fraction_double_sign": "0.050000000000000000", 312 | "slash_fraction_downtime": "0.010000000000000000" 313 | }, 314 | "signing_infos": [] 315 | }, 316 | "staking": { 317 | "delegations": [], 318 | "exported": false, 319 | "last_total_power": "0", 320 | "last_validator_powers": [], 321 | "params": { 322 | "bond_denom": "uosmo", 323 | "historical_entries": 10000, 324 | "max_entries": 7, 325 | "max_validators": 100, 326 | "min_commission_rate": "0.000000000000000000", 327 | "unbonding_time": "1814400s" 328 | }, 329 | "redelegations": [], 330 | "unbonding_delegations": [], 331 | "validators": [] 332 | }, 333 | "superfluid": { 334 | "intemediary_account_connections": [], 335 | "intermediary_accounts": [], 336 | "osmo_equivalent_multipliers": [], 337 | "params": { 338 | "minimum_risk_factor": "0.500000000000000000" 339 | }, 340 | "superfluid_assets": [] 341 | }, 342 | "tokenfactory": { 343 | "factory_denoms": [], 344 | "params": { 345 | "denom_creation_fee": [ 346 | { 347 | "amount": "10000000", 348 | "denom": "uosmo" 349 | } 350 | ] 351 | } 352 | }, 353 | "transfer": { 354 | "denom_traces": [], 355 | "params": { 356 | "receive_enabled": true, 357 | "send_enabled": true 358 | }, 359 | "port_id": "transfer" 360 | }, 361 | "txfees": { 362 | "basedenom": "uosmo", 363 | "feetokens": [] 364 | }, 365 | "upgrade": {}, 366 | "vesting": {}, 367 | "wasm": { 368 | "codes": [], 369 | "contracts": [], 370 | "gen_msgs": [], 371 | "params": { 372 | "code_upload_access": { 373 | "address": "", 374 | "permission": "Everybody" 375 | }, 376 | "instantiate_default_permission": "Everybody" 377 | }, 378 | "sequences": [] 379 | } 380 | }, 381 | "chain_id": "osmo-testing", 382 | "consensus_params": { 383 | "block": { 384 | "max_bytes": "22020096", 385 | "max_gas": "-1", 386 | "time_iota_ms": "10" 387 | }, 388 | "evidence": { 389 | "max_age_duration": "172800000000000", 390 | "max_age_num_blocks": "100000", 391 | "max_bytes": "1048576" 392 | }, 393 | "validator": { 394 | "pub_key_types": [ 395 | "ed25519" 396 | ] 397 | }, 398 | "version": {} 399 | }, 400 | "genesis_time": "2022-07-20T19:45:11.178239638Z", 401 | "initial_height": "1" 402 | } 403 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/gentx/gentx-8c3f5817e96cc2a75d729f89a8ddfe23883f6c34.json: -------------------------------------------------------------------------------- 1 | {"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"osmo-moniker","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"osmo1dlz93eutqz6skqf6p7s3kt27rlwvgq5up9xma3","validator_address":"osmovaloper1dlz93eutqz6skqf6p7s3kt27rlwvgq5umjwc2k","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"SqQYMs5aVi4XUZP2Pet4YnhVQFWsWGpZZzewg1fLUjg="},"value":{"denom":"uosmo","amount":"3000000"}}],"memo":"8c3f5817e96cc2a75d729f89a8ddfe23883f6c34@172.17.0.2:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+WeeHXm8WuDNWQ21OorfzGpIvGOqLYFlEYS+niPO7Gx"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"350000","payer":"","granter":""}},"signatures":["jniNpsTjH5FtktRzMt91mhHZPfwYxRG3Hy4ITNQX0I49oX8nQ1NNbR2vmyebZwWLORrkoy9mvXBpMLtNZqyebQ=="]} 2 | -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"lI+YR/HllQTo92S583RbyRGyCJQvib+v+OqK8Dxss0oeE7Ga7gljmq2xmWgfK2E48SV3Eae9aG3xgjl9+D5f/A=="}} -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/config/priv_validator_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "0303542D813398A9F452F249A60016FC1DC4A79F", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "SqQYMs5aVi4XUZP2Pet4YnhVQFWsWGpZZzewg1fLUjg=" 6 | }, 7 | "priv_key": { 8 | "type": "tendermint/PrivKeyEd25519", 9 | "value": "wlDNMiFw0gTVGgBdb5jZs8ShXi8gHTKKx1J/9q8YECNKpBgyzlpWLhdRk/Y963hieFVAVaxYallnN7CDV8tSOA==" 10 | } 11 | } -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/data/priv_validator_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "height": "0", 3 | "round": 0, 4 | "step": 0 5 | } -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/keyhash: -------------------------------------------------------------------------------- 1 | $2a$10$bNpXDhTBeAqVzaTC4MIsXeltpKG1V2OpNSINs6ql5WIrYRGXv9HWm -------------------------------------------------------------------------------- /ci-scripts/osmosis/template/.osmosisd/validator.info: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMi0wNy0yMCAxOTo0NToxMi41MjMwMjk4NDcgKzAwMDAgVVRDIG09KzAuNjE2MjgzMzc2IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiLWJrVDlya1ZmRFQ0T0owLSJ9.WpY0n05cm3Git29URAKchjmjZpE6U5VirwEFAjGjkU98M8Yvj5-bGQ.AZkszDfiWhrd0Pwo.pmKQTCy5V68XO7X9mRBMZqZkexzjaBiAMJrgjJoOqABbeinY-RXsvcVKizXNSeKmWhV3OjNPqm1yoWMcXAo3uhjlxH6VEZhRM_khsufQm5__XtJpoDM_frZFprpapxWZX9B3RHBxqjZMeSzi0UvvawFqvRPxQFZg6En1mmnCpyto2_1dnpKOQ-QO74DbALF3bTJk088-dxttzMw_uaAbADatOqCcC3LAoteSoOeuaCqT_ckfUVHaKggr4H2W6e0Er6wTI9oHMD5odGCvYRZgjWuOhQOfbaAE7lTIWSpd7ZZn7BGrtiGu-3Ur4LaH6l4FPkqVxJ2AdKBk__zx2T8RnO49AdvM0lGcMJmhEMxXH5d7g6uq.YSUMG1-dEGKZAwiK-y34iQ -------------------------------------------------------------------------------- /ci-scripts/wasmd/README.md: -------------------------------------------------------------------------------- 1 | # Local Osmosisd development network 2 | 3 | Configuration is in the `env` file, that is the most likely place you want to adjust 4 | 5 | ## Initializing new data 6 | 7 | ```bash 8 | scripts/wasmd/generate_template.sh 9 | ``` 10 | 11 | Note that the addresses receiving tokens in genesis are set here, you can customize by editting this file 12 | 13 | ## Starting the blockchain 14 | 15 | Run the following: 16 | 17 | ```bash 18 | scripts/wasmd/start.sh 19 | ``` 20 | 21 | You get filtered output on the console. If it crashes and you want the full logs, look at `debug.log`. 22 | 23 | ## Stopping the blockchain 24 | 25 | While running the blockchain in one terminal, open a second one and run this: 26 | 27 | ```bash 28 | scripts/wasmd/stop.sh 29 | ``` 30 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/env: -------------------------------------------------------------------------------- 1 | REPOSITORY="confio/wasm-ci" 2 | # This should be pinned to the newest version we support 3 | VERSION="0.27.0" 4 | CONTAINER_NAME="wasmd" 5 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/generate_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 6 | # shellcheck source=./env 7 | # shellcheck disable=SC1091 8 | source "$SCRIPT_DIR"/env 9 | 10 | mkdir -p "$SCRIPT_DIR"/template 11 | 12 | export CHAIN_ID=wasmd-1 13 | 14 | # The usage of the accounts below is documented in README.md of this directory 15 | docker run --rm \ 16 | -e PASSWORD=my-secret-password \ 17 | -e CHAIN_ID \ 18 | --mount type=bind,source="$SCRIPT_DIR/template",target=/root \ 19 | "$REPOSITORY:$VERSION" \ 20 | /opt/setup.sh \ 21 | wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk 22 | 23 | sudo chmod -R g+rwx template/.wasmd/ 24 | sudo chmod -R a+rx template/.wasmd/ 25 | 26 | # The ./template folder is created by the docker daemon's user (root on Linux, current user 27 | # when using Docker Desktop on macOS), let's make it ours if needed 28 | if [ ! -x "$SCRIPT_DIR/template/.wasmd/config/gentx" ]; then 29 | sudo chown -R "$(id -u):$(id -g)" "$SCRIPT_DIR/template" 30 | fi 31 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/scripts/setup_wasmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #set -o errexit -o nounset -o pipefail 3 | 4 | PASSWORD=${PASSWORD:-1234567890} 5 | STAKE=${STAKE_TOKEN:-ustake} 6 | FEE=${FEE_TOKEN:-ucosm} 7 | CHAIN_ID=${CHAIN_ID:-testing} 8 | MONIKER=${MONIKER:-node001} 9 | 10 | wasmd init --chain-id "$CHAIN_ID" "$MONIKER" 11 | # staking/governance token is hardcoded in config, change this 12 | sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.wasmd/config/genesis.json 13 | # this is essential for sub-1s block times (or header times go crazy) 14 | sed -i 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/.wasmd/config/genesis.json 15 | 16 | if ! wasmd keys show validator; then 17 | (echo "$PASSWORD"; echo "$PASSWORD") | wasmd keys add validator 18 | fi 19 | # hardcode the validator account for this instance 20 | echo "$PASSWORD" | wasmd add-genesis-account validator "1000000000$STAKE,1000000000$FEE" 21 | 22 | # (optionally) add a few more genesis accounts 23 | for addr in "$@"; do 24 | echo $addr 25 | wasmd add-genesis-account "$addr" "1000000000$STAKE,1000000000$FEE" 26 | done 27 | 28 | # submit a genesis validator tx 29 | ## Workraround for https://github.com/cosmos/cosmos-sdk/issues/8251 30 | (echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | wasmd gentx validator "250000000$STAKE" --chain-id="$CHAIN_ID" --amount="250000000$STAKE" 31 | ## should be: 32 | # (echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | wasmd gentx validator "250000000$STAKE" --chain-id="$CHAIN_ID" 33 | wasmd collect-gentxs 34 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Please keep this in sync with the Ports overview in HACKING.md 6 | TENDERMINT_PORT_GUEST="26657" 7 | TENDERMINT_PORT_HOST="26659" 8 | 9 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 10 | # shellcheck source=./env 11 | # shellcheck disable=SC1091 12 | source "$SCRIPT_DIR"/env 13 | 14 | # TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/wasmd.XXXXXXXXX") 15 | # chmod 777 "$TMP_DIR" 16 | # echo "Using temporary dir $TMP_DIR" 17 | # WASMD_LOGFILE="$TMP_DIR/wasmd.log" 18 | 19 | # Use a fresh volume for every start 20 | docker volume rm -f wasmd_data 21 | # only pull if we don't have it 22 | (docker images | grep "$REPOSITORY" | grep -q "$VERSION") || docker pull "$REPOSITORY:$VERSION" 23 | 24 | # This starts up wasmd 25 | echo "starting wasmd with rpc on port $TENDERMINT_PORT_HOST" 26 | docker run --rm \ 27 | --name "$CONTAINER_NAME" \ 28 | -p "$TENDERMINT_PORT_HOST":"$TENDERMINT_PORT_GUEST" \ 29 | --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ 30 | --mount type=volume,source=wasmd_data,target=/root \ 31 | "$REPOSITORY:$VERSION" \ 32 | /opt/run.sh \ 33 | 2>&1 | tee debug.log | grep 'executed block' 34 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 6 | # shellcheck source=./env 7 | # shellcheck disable=SC1091 8 | source "$SCRIPT_DIR"/env 9 | 10 | echo "Killing Wasmd container..." 11 | docker container kill "$CONTAINER_NAME" 12 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/app.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | ############################################################################### 5 | ### Base Configuration ### 6 | ############################################################################### 7 | 8 | # The minimum gas prices a validator is willing to accept for processing a 9 | # transaction. A transaction's fees must meet the minimum of any denomination 10 | # specified in this config (e.g. 0.25token1;0.0001token2). 11 | minimum-gas-prices = "0.025ucosm" 12 | 13 | # default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals 14 | # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) 15 | # everything: all saved states will be deleted, storing only the current and previous state; pruning at 10 block intervals 16 | # custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' 17 | pruning = "default" 18 | 19 | # These are applied if and only if the pruning strategy is custom. 20 | pruning-keep-recent = "0" 21 | pruning-keep-every = "0" 22 | pruning-interval = "0" 23 | 24 | # HaltHeight contains a non-zero block height at which a node will gracefully 25 | # halt and shutdown that can be used to assist upgrades and testing. 26 | # 27 | # Note: Commitment of state will be attempted on the corresponding block. 28 | halt-height = 0 29 | 30 | # HaltTime contains a non-zero minimum block time (in Unix seconds) at which 31 | # a node will gracefully halt and shutdown that can be used to assist upgrades 32 | # and testing. 33 | # 34 | # Note: Commitment of state will be attempted on the corresponding block. 35 | halt-time = 0 36 | 37 | # MinRetainBlocks defines the minimum block height offset from the current 38 | # block being committed, such that all blocks past this offset are pruned 39 | # from Tendermint. It is used as part of the process of determining the 40 | # ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates 41 | # that no blocks should be pruned. 42 | # 43 | # This configuration value is only responsible for pruning Tendermint blocks. 44 | # It has no bearing on application state pruning which is determined by the 45 | # "pruning-*" configurations. 46 | # 47 | # Note: Tendermint block pruning is dependant on this parameter in conunction 48 | # with the unbonding (safety threshold) period, state pruning and state sync 49 | # snapshot parameters to determine the correct minimum value of 50 | # ResponseCommit.RetainHeight. 51 | min-retain-blocks = 0 52 | 53 | # InterBlockCache enables inter-block caching. 54 | inter-block-cache = true 55 | 56 | # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, 57 | # which informs Tendermint what to index. If empty, all events will be indexed. 58 | # 59 | # Example: 60 | # ["message.sender", "message.recipient"] 61 | index-events = [] 62 | 63 | # IavlCacheSize set the size of the iavl tree cache. 64 | # Default cache size is 50mb. 65 | iavl-cache-size = 781250 66 | 67 | ############################################################################### 68 | ### Telemetry Configuration ### 69 | ############################################################################### 70 | 71 | [telemetry] 72 | 73 | # Prefixed with keys to separate services. 74 | service-name = "" 75 | 76 | # Enabled enables the application telemetry functionality. When enabled, 77 | # an in-memory sink is also enabled by default. Operators may also enabled 78 | # other sinks such as Prometheus. 79 | enabled = false 80 | 81 | # Enable prefixing gauge values with hostname. 82 | enable-hostname = false 83 | 84 | # Enable adding hostname to labels. 85 | enable-hostname-label = false 86 | 87 | # Enable adding service to labels. 88 | enable-service-label = false 89 | 90 | # PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. 91 | prometheus-retention-time = 0 92 | 93 | # GlobalLabels defines a global set of name/value label tuples applied to all 94 | # metrics emitted using the wrapper functions defined in telemetry package. 95 | # 96 | # Example: 97 | # [["chain_id", "cosmoshub-1"]] 98 | global-labels = [ 99 | ] 100 | 101 | ############################################################################### 102 | ### API Configuration ### 103 | ############################################################################### 104 | 105 | [api] 106 | 107 | # Enable defines if the API server should be enabled. 108 | enable = true 109 | 110 | # Swagger defines if swagger documentation should automatically be registered. 111 | swagger = false 112 | 113 | # Address defines the API server to listen on. 114 | address = "tcp://0.0.0.0:1317" 115 | 116 | # MaxOpenConnections defines the number of maximum open connections. 117 | max-open-connections = 1000 118 | 119 | # RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). 120 | rpc-read-timeout = 10 121 | 122 | # RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). 123 | rpc-write-timeout = 0 124 | 125 | # RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). 126 | rpc-max-body-bytes = 1000000 127 | 128 | # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). 129 | enabled-unsafe-cors = true 130 | 131 | ############################################################################### 132 | ### Rosetta Configuration ### 133 | ############################################################################### 134 | 135 | [rosetta] 136 | 137 | # Enable defines if the Rosetta API server should be enabled. 138 | enable = true 139 | 140 | # Address defines the Rosetta API server to listen on. 141 | address = ":8080" 142 | 143 | # Network defines the name of the blockchain that will be returned by Rosetta. 144 | blockchain = "app" 145 | 146 | # Network defines the name of the network that will be returned by Rosetta. 147 | network = "network" 148 | 149 | # Retries defines the number of retries when connecting to the node before failing. 150 | retries = 3 151 | 152 | # Offline defines if Rosetta server should run in offline mode. 153 | offline = false 154 | 155 | ############################################################################### 156 | ### gRPC Configuration ### 157 | ############################################################################### 158 | 159 | [grpc] 160 | 161 | # Enable defines if the gRPC server should be enabled. 162 | enable = true 163 | 164 | # Address defines the gRPC server address to bind to. 165 | address = "0.0.0.0:9090" 166 | 167 | ############################################################################### 168 | ### gRPC Web Configuration ### 169 | ############################################################################### 170 | 171 | [grpc-web] 172 | 173 | # GRPCWebEnable defines if the gRPC-web should be enabled. 174 | # NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. 175 | enable = true 176 | 177 | # Address defines the gRPC-web server address to bind to. 178 | address = "0.0.0.0:9091" 179 | 180 | # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). 181 | enable-unsafe-cors = false 182 | 183 | ############################################################################### 184 | ### State Sync Configuration ### 185 | ############################################################################### 186 | 187 | # State sync snapshots allow other nodes to rapidly join the network without replaying historical 188 | # blocks, instead downloading and applying a snapshot of the application state at a given height. 189 | [state-sync] 190 | 191 | # snapshot-interval specifies the block interval at which local state sync snapshots are 192 | # taken (0 to disable). Must be a multiple of pruning-keep-every. 193 | snapshot-interval = 0 194 | 195 | # snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). 196 | snapshot-keep-recent = 2 197 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/client.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | ############################################################################### 5 | ### Client Configuration ### 6 | ############################################################################### 7 | 8 | # The network chain ID 9 | chain-id = "" 10 | # The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) 11 | keyring-backend = "os" 12 | # CLI output format (text|json) 13 | output = "text" 14 | # : to Tendermint RPC interface for this chain 15 | node = "tcp://localhost:26657" 16 | # Transaction broadcasting mode (sync|async|block) 17 | broadcast-mode = "sync" 18 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/config.toml: -------------------------------------------------------------------------------- 1 | # This is a TOML config file. 2 | # For more information, see https://github.com/toml-lang/toml 3 | 4 | # NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or 5 | # relative to the home directory (e.g. "data"). The home directory is 6 | # "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable 7 | # or --home cmd flag. 8 | 9 | ####################################################################### 10 | ### Main Base Config Options ### 11 | ####################################################################### 12 | 13 | # TCP or UNIX socket address of the ABCI application, 14 | # or the name of an ABCI application compiled in with the Tendermint binary 15 | proxy_app = "tcp://127.0.0.1:26658" 16 | 17 | # A custom human readable name for this node 18 | moniker = "wasm-moniker" 19 | 20 | # If this node is many blocks behind the tip of the chain, FastSync 21 | # allows them to catchup quickly by downloading blocks in parallel 22 | # and verifying their commits 23 | fast_sync = true 24 | 25 | # Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb 26 | # * goleveldb (github.com/syndtr/goleveldb - most popular implementation) 27 | # - pure go 28 | # - stable 29 | # * cleveldb (uses levigo wrapper) 30 | # - fast 31 | # - requires gcc 32 | # - use cleveldb build tag (go build -tags cleveldb) 33 | # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) 34 | # - EXPERIMENTAL 35 | # - may be faster is some use-cases (random reads - indexer) 36 | # - use boltdb build tag (go build -tags boltdb) 37 | # * rocksdb (uses github.com/tecbot/gorocksdb) 38 | # - EXPERIMENTAL 39 | # - requires gcc 40 | # - use rocksdb build tag (go build -tags rocksdb) 41 | # * badgerdb (uses github.com/dgraph-io/badger) 42 | # - EXPERIMENTAL 43 | # - use badgerdb build tag (go build -tags badgerdb) 44 | db_backend = "goleveldb" 45 | 46 | # Database directory 47 | db_dir = "data" 48 | 49 | # Output level for logging, including package level options 50 | log_level = "info" 51 | 52 | # Output format: 'plain' (colored text) or 'json' 53 | log_format = "plain" 54 | 55 | ##### additional base config options ##### 56 | 57 | # Path to the JSON file containing the initial validator set and other meta data 58 | genesis_file = "config/genesis.json" 59 | 60 | # Path to the JSON file containing the private key to use as a validator in the consensus protocol 61 | priv_validator_key_file = "config/priv_validator_key.json" 62 | 63 | # Path to the JSON file containing the last sign state of a validator 64 | priv_validator_state_file = "data/priv_validator_state.json" 65 | 66 | # TCP or UNIX socket address for Tendermint to listen on for 67 | # connections from an external PrivValidator process 68 | priv_validator_laddr = "" 69 | 70 | # Path to the JSON file containing the private key to use for node authentication in the p2p protocol 71 | node_key_file = "config/node_key.json" 72 | 73 | # Mechanism to connect to the ABCI application: socket | grpc 74 | abci = "socket" 75 | 76 | # If true, query the ABCI app on connecting to a new peer 77 | # so the app can decide if we should keep the connection or not 78 | filter_peers = false 79 | 80 | 81 | ####################################################################### 82 | ### Advanced Configuration Options ### 83 | ####################################################################### 84 | 85 | ####################################################### 86 | ### RPC Server Configuration Options ### 87 | ####################################################### 88 | [rpc] 89 | 90 | # TCP or UNIX socket address for the RPC server to listen on 91 | laddr = "tcp://127.0.0.1:26657" 92 | 93 | # A list of origins a cross-domain request can be executed from 94 | # Default value '[]' disables cors support 95 | # Use '["*"]' to allow any origin 96 | cors_allowed_origins = ["*"] 97 | 98 | # A list of methods the client is allowed to use with cross-domain requests 99 | cors_allowed_methods = ["HEAD", "GET", "POST", ] 100 | 101 | # A list of non simple headers the client is allowed to use with cross-domain requests 102 | cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] 103 | 104 | # TCP or UNIX socket address for the gRPC server to listen on 105 | # NOTE: This server only supports /broadcast_tx_commit 106 | grpc_laddr = "" 107 | 108 | # Maximum number of simultaneous connections. 109 | # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections 110 | # If you want to accept a larger number than the default, make sure 111 | # you increase your OS limits. 112 | # 0 - unlimited. 113 | # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} 114 | # 1024 - 40 - 10 - 50 = 924 = ~900 115 | grpc_max_open_connections = 900 116 | 117 | # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool 118 | unsafe = false 119 | 120 | # Maximum number of simultaneous connections (including WebSocket). 121 | # Does not include gRPC connections. See grpc_max_open_connections 122 | # If you want to accept a larger number than the default, make sure 123 | # you increase your OS limits. 124 | # 0 - unlimited. 125 | # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} 126 | # 1024 - 40 - 10 - 50 = 924 = ~900 127 | max_open_connections = 900 128 | 129 | # Maximum number of unique clientIDs that can /subscribe 130 | # If you're using /broadcast_tx_commit, set to the estimated maximum number 131 | # of broadcast_tx_commit calls per block. 132 | max_subscription_clients = 100 133 | 134 | # Maximum number of unique queries a given client can /subscribe to 135 | # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to 136 | # the estimated # maximum number of broadcast_tx_commit calls per block. 137 | max_subscriptions_per_client = 5 138 | 139 | # Experimental parameter to specify the maximum number of events a node will 140 | # buffer, per subscription, before returning an error and closing the 141 | # subscription. Must be set to at least 100, but higher values will accommodate 142 | # higher event throughput rates (and will use more memory). 143 | experimental_subscription_buffer_size = 200 144 | 145 | # Experimental parameter to specify the maximum number of RPC responses that 146 | # can be buffered per WebSocket client. If clients cannot read from the 147 | # WebSocket endpoint fast enough, they will be disconnected, so increasing this 148 | # parameter may reduce the chances of them being disconnected (but will cause 149 | # the node to use more memory). 150 | # 151 | # Must be at least the same as "experimental_subscription_buffer_size", 152 | # otherwise connections could be dropped unnecessarily. This value should 153 | # ideally be somewhat higher than "experimental_subscription_buffer_size" to 154 | # accommodate non-subscription-related RPC responses. 155 | experimental_websocket_write_buffer_size = 200 156 | 157 | # If a WebSocket client cannot read fast enough, at present we may 158 | # silently drop events instead of generating an error or disconnecting the 159 | # client. 160 | # 161 | # Enabling this experimental parameter will cause the WebSocket connection to 162 | # be closed instead if it cannot read fast enough, allowing for greater 163 | # predictability in subscription behaviour. 164 | experimental_close_on_slow_client = false 165 | 166 | # How long to wait for a tx to be committed during /broadcast_tx_commit. 167 | # WARNING: Using a value larger than 10s will result in increasing the 168 | # global HTTP write timeout, which applies to all connections and endpoints. 169 | # See https://github.com/tendermint/tendermint/issues/3435 170 | timeout_broadcast_tx_commit = "10s" 171 | 172 | # Maximum size of request body, in bytes 173 | max_body_bytes = 1000000 174 | 175 | # Maximum size of request header, in bytes 176 | max_header_bytes = 1048576 177 | 178 | # The path to a file containing certificate that is used to create the HTTPS server. 179 | # Might be either absolute path or path related to Tendermint's config directory. 180 | # If the certificate is signed by a certificate authority, 181 | # the certFile should be the concatenation of the server's certificate, any intermediates, 182 | # and the CA's certificate. 183 | # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. 184 | # Otherwise, HTTP server is run. 185 | tls_cert_file = "" 186 | 187 | # The path to a file containing matching private key that is used to create the HTTPS server. 188 | # Might be either absolute path or path related to Tendermint's config directory. 189 | # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server. 190 | # Otherwise, HTTP server is run. 191 | tls_key_file = "" 192 | 193 | # pprof listen address (https://golang.org/pkg/net/http/pprof) 194 | pprof_laddr = "localhost:6060" 195 | 196 | ####################################################### 197 | ### P2P Configuration Options ### 198 | ####################################################### 199 | [p2p] 200 | 201 | # Address to listen for incoming connections 202 | laddr = "tcp://0.0.0.0:26656" 203 | 204 | # Address to advertise to peers for them to dial 205 | # If empty, will use the same port as the laddr, 206 | # and will introspect on the listener or use UPnP 207 | # to figure out the address. ip and port are required 208 | # example: 159.89.10.97:26656 209 | external_address = "" 210 | 211 | # Comma separated list of seed nodes to connect to 212 | seeds = "" 213 | 214 | # Comma separated list of nodes to keep persistent connections to 215 | persistent_peers = "" 216 | 217 | # UPNP port forwarding 218 | upnp = false 219 | 220 | # Path to address book 221 | addr_book_file = "config/addrbook.json" 222 | 223 | # Set true for strict address routability rules 224 | # Set false for private or local networks 225 | addr_book_strict = true 226 | 227 | # Maximum number of inbound peers 228 | max_num_inbound_peers = 40 229 | 230 | # Maximum number of outbound peers to connect to, excluding persistent peers 231 | max_num_outbound_peers = 10 232 | 233 | # List of node IDs, to which a connection will be (re)established ignoring any existing limits 234 | unconditional_peer_ids = "" 235 | 236 | # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) 237 | persistent_peers_max_dial_period = "0s" 238 | 239 | # Time to wait before flushing messages out on the connection 240 | flush_throttle_timeout = "100ms" 241 | 242 | # Maximum size of a message packet payload, in bytes 243 | max_packet_msg_payload_size = 1024 244 | 245 | # Rate at which packets can be sent, in bytes/second 246 | send_rate = 5120000 247 | 248 | # Rate at which packets can be received, in bytes/second 249 | recv_rate = 5120000 250 | 251 | # Set true to enable the peer-exchange reactor 252 | pex = true 253 | 254 | # Seed mode, in which node constantly crawls the network and looks for 255 | # peers. If another node asks it for addresses, it responds and disconnects. 256 | # 257 | # Does not work if the peer-exchange reactor is disabled. 258 | seed_mode = false 259 | 260 | # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 261 | private_peer_ids = "" 262 | 263 | # Toggle to disable guard against peers connecting from the same ip. 264 | allow_duplicate_ip = false 265 | 266 | # Peer connection configuration. 267 | handshake_timeout = "20s" 268 | dial_timeout = "3s" 269 | 270 | ####################################################### 271 | ### Mempool Configuration Option ### 272 | ####################################################### 273 | [mempool] 274 | 275 | recheck = true 276 | broadcast = true 277 | wal_dir = "" 278 | 279 | # Maximum number of transactions in the mempool 280 | size = 5000 281 | 282 | # Limit the total size of all txs in the mempool. 283 | # This only accounts for raw transactions (e.g. given 1MB transactions and 284 | # max_txs_bytes=5MB, mempool will only accept 5 transactions). 285 | max_txs_bytes = 1073741824 286 | 287 | # Size of the cache (used to filter transactions we saw earlier) in transactions 288 | cache_size = 10000 289 | 290 | # Do not remove invalid transactions from the cache (default: false) 291 | # Set to true if it's not possible for any invalid transaction to become valid 292 | # again in the future. 293 | keep-invalid-txs-in-cache = false 294 | 295 | # Maximum size of a single transaction. 296 | # NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. 297 | max_tx_bytes = 1048576 298 | 299 | # Maximum size of a batch of transactions to send to a peer 300 | # Including space needed by encoding (one varint per transaction). 301 | # XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 302 | max_batch_bytes = 0 303 | 304 | ####################################################### 305 | ### State Sync Configuration Options ### 306 | ####################################################### 307 | [statesync] 308 | # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine 309 | # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in 310 | # the network to take and serve state machine snapshots. State sync is not attempted if the node 311 | # has any local state (LastBlockHeight > 0). The node will have a truncated block history, 312 | # starting from the height of the snapshot. 313 | enable = false 314 | 315 | # RPC servers (comma-separated) for light client verification of the synced state machine and 316 | # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding 317 | # header hash obtained from a trusted source, and a period during which validators can be trusted. 318 | # 319 | # For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 320 | # weeks) during which they can be financially punished (slashed) for misbehavior. 321 | rpc_servers = "" 322 | trust_height = 0 323 | trust_hash = "" 324 | trust_period = "168h0m0s" 325 | 326 | # Time to spend discovering snapshots before initiating a restore. 327 | discovery_time = "15s" 328 | 329 | # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). 330 | # Will create a new, randomly named directory within, and remove it when done. 331 | temp_dir = "" 332 | 333 | # The timeout duration before re-requesting a chunk, possibly from a different 334 | # peer (default: 1 minute). 335 | chunk_request_timeout = "10s" 336 | 337 | # The number of concurrent chunk fetchers to run (default: 1). 338 | chunk_fetchers = "4" 339 | 340 | ####################################################### 341 | ### Fast Sync Configuration Connections ### 342 | ####################################################### 343 | [fastsync] 344 | 345 | # Fast Sync version to use: 346 | # 1) "v0" (default) - the legacy fast sync implementation 347 | # 2) "v1" - refactor of v0 version for better testability 348 | # 2) "v2" - complete redesign of v0, optimized for testability & readability 349 | version = "v0" 350 | 351 | ####################################################### 352 | ### Consensus Configuration Options ### 353 | ####################################################### 354 | [consensus] 355 | 356 | wal_file = "data/cs.wal/wal" 357 | 358 | # How long we wait for a proposal block before prevoting nil 359 | timeout_propose = "100ms" 360 | # How much timeout_propose increases with each round 361 | timeout_propose_delta = "100ms" 362 | # How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) 363 | timeout_prevote = "100ms" 364 | # How much the timeout_prevote increases with each round 365 | timeout_prevote_delta = "100ms" 366 | # How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) 367 | timeout_precommit = "100ms" 368 | # How much the timeout_precommit increases with each round 369 | timeout_precommit_delta = "100ms" 370 | # How long we wait after committing a block, before starting on the new 371 | # height (this gives us a chance to receive some more precommits, even 372 | # though we already have +2/3). 373 | timeout_commit = "200ms" 374 | 375 | # How many blocks to look back to check existence of the node's consensus votes before joining consensus 376 | # When non-zero, the node will panic upon restart 377 | # if the same consensus key was used to sign {double_sign_check_height} last blocks. 378 | # So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. 379 | double_sign_check_height = 0 380 | 381 | # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) 382 | skip_timeout_commit = false 383 | 384 | # EmptyBlocks mode and possible interval between empty blocks 385 | create_empty_blocks = true 386 | create_empty_blocks_interval = "0s" 387 | 388 | # Reactor sleep duration parameters 389 | peer_gossip_sleep_duration = "100ms" 390 | peer_query_maj23_sleep_duration = "2s" 391 | 392 | ####################################################### 393 | ### Transaction Indexer Configuration Options ### 394 | ####################################################### 395 | [tx_index] 396 | 397 | # What indexer to use for transactions 398 | # 399 | # The application will set which txs to index. In some cases a node operator will be able 400 | # to decide which txs to index based on configuration set in the application. 401 | # 402 | # Options: 403 | # 1) "null" 404 | # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). 405 | # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. 406 | indexer = "kv" 407 | 408 | ####################################################### 409 | ### Instrumentation Configuration Options ### 410 | ####################################################### 411 | [instrumentation] 412 | 413 | # When true, Prometheus metrics are served under /metrics on 414 | # PrometheusListenAddr. 415 | # Check out the documentation for the list of available metrics. 416 | prometheus = false 417 | 418 | # Address to listen for Prometheus collector(s) connections 419 | prometheus_listen_addr = ":26660" 420 | 421 | # Maximum number of simultaneous connections. 422 | # If you want to accept a larger number than the default, make sure 423 | # you increase your OS limits. 424 | # 0 - unlimited. 425 | max_open_connections = 3 426 | 427 | # Instrumentation namespace 428 | namespace = "tendermint" 429 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "app_hash": "", 3 | "app_state": { 4 | "auth": { 5 | "accounts": [ 6 | { 7 | "@type": "/cosmos.auth.v1beta1.BaseAccount", 8 | "account_number": "0", 9 | "address": "wasm17e5l4ggxlyjf7k5scnas2zflwmnj9gjg54kce7", 10 | "pub_key": null, 11 | "sequence": "0" 12 | }, 13 | { 14 | "@type": "/cosmos.auth.v1beta1.BaseAccount", 15 | "account_number": "0", 16 | "address": "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk", 17 | "pub_key": null, 18 | "sequence": "0" 19 | } 20 | ], 21 | "params": { 22 | "max_memo_characters": "256", 23 | "sig_verify_cost_ed25519": "590", 24 | "sig_verify_cost_secp256k1": "1000", 25 | "tx_sig_limit": "7", 26 | "tx_size_cost_per_byte": "10" 27 | } 28 | }, 29 | "authz": { 30 | "authorization": [] 31 | }, 32 | "bank": { 33 | "balances": [ 34 | { 35 | "address": "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk", 36 | "coins": [ 37 | { 38 | "amount": "1000000000", 39 | "denom": "ucosm" 40 | }, 41 | { 42 | "amount": "1000000000", 43 | "denom": "ustake" 44 | } 45 | ] 46 | }, 47 | { 48 | "address": "wasm17e5l4ggxlyjf7k5scnas2zflwmnj9gjg54kce7", 49 | "coins": [ 50 | { 51 | "amount": "1000000000", 52 | "denom": "ucosm" 53 | }, 54 | { 55 | "amount": "1000000000", 56 | "denom": "ustake" 57 | } 58 | ] 59 | } 60 | ], 61 | "denom_metadata": [], 62 | "params": { 63 | "default_send_enabled": true, 64 | "send_enabled": [] 65 | }, 66 | "supply": [ 67 | { 68 | "amount": "2000000000", 69 | "denom": "ucosm" 70 | }, 71 | { 72 | "amount": "2000000000", 73 | "denom": "ustake" 74 | } 75 | ] 76 | }, 77 | "capability": { 78 | "index": "1", 79 | "owners": [] 80 | }, 81 | "crisis": { 82 | "constant_fee": { 83 | "amount": "1000", 84 | "denom": "ustake" 85 | } 86 | }, 87 | "distribution": { 88 | "delegator_starting_infos": [], 89 | "delegator_withdraw_infos": [], 90 | "fee_pool": { 91 | "community_pool": [] 92 | }, 93 | "outstanding_rewards": [], 94 | "params": { 95 | "base_proposer_reward": "0.010000000000000000", 96 | "bonus_proposer_reward": "0.040000000000000000", 97 | "community_tax": "0.020000000000000000", 98 | "withdraw_addr_enabled": true 99 | }, 100 | "previous_proposer": "", 101 | "validator_accumulated_commissions": [], 102 | "validator_current_rewards": [], 103 | "validator_historical_rewards": [], 104 | "validator_slash_events": [] 105 | }, 106 | "evidence": { 107 | "evidence": [] 108 | }, 109 | "feegrant": { 110 | "allowances": [] 111 | }, 112 | "genutil": { 113 | "gen_txs": [ 114 | { 115 | "auth_info": { 116 | "fee": { 117 | "amount": [], 118 | "gas_limit": "200000", 119 | "granter": "", 120 | "payer": "" 121 | }, 122 | "signer_infos": [ 123 | { 124 | "mode_info": { 125 | "single": { 126 | "mode": "SIGN_MODE_DIRECT" 127 | } 128 | }, 129 | "public_key": { 130 | "@type": "/cosmos.crypto.secp256k1.PubKey", 131 | "key": "A+Mv0AWmUlfsrAvrUCYB2wOxnlBXzjFkAHXmUMalA50y" 132 | }, 133 | "sequence": "0" 134 | } 135 | ] 136 | }, 137 | "body": { 138 | "extension_options": [], 139 | "memo": "e00476a52bbadced4266814cee02b61c4cbdb860@172.17.0.2:26656", 140 | "messages": [ 141 | { 142 | "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", 143 | "commission": { 144 | "max_change_rate": "0.010000000000000000", 145 | "max_rate": "0.200000000000000000", 146 | "rate": "0.100000000000000000" 147 | }, 148 | "delegator_address": "wasm17e5l4ggxlyjf7k5scnas2zflwmnj9gjg54kce7", 149 | "description": { 150 | "details": "", 151 | "identity": "", 152 | "moniker": "wasm-moniker", 153 | "security_contact": "", 154 | "website": "" 155 | }, 156 | "min_self_delegation": "1", 157 | "pubkey": { 158 | "@type": "/cosmos.crypto.ed25519.PubKey", 159 | "key": "pbhQLheUqr0nbaNZ7z1wzAsXjLRilfq4xbcaMN2XRUY=" 160 | }, 161 | "validator_address": "wasmvaloper17e5l4ggxlyjf7k5scnas2zflwmnj9gjgpfryhy", 162 | "value": { 163 | "amount": "3000000", 164 | "denom": "ustake" 165 | } 166 | } 167 | ], 168 | "non_critical_extension_options": [], 169 | "timeout_height": "0" 170 | }, 171 | "signatures": [ 172 | "oHhjuBqgpc8xV6SZu5v8E0Bf653PPRPvqYjsI+6l1ht1aeGF8f+ym+UynVvQj9mHc0EXlts23dN9Ht7/jm2WEA==" 173 | ] 174 | } 175 | ] 176 | }, 177 | "gov": { 178 | "deposit_params": { 179 | "max_deposit_period": "172800s", 180 | "min_deposit": [ 181 | { 182 | "amount": "10000000", 183 | "denom": "ustake" 184 | } 185 | ] 186 | }, 187 | "deposits": [], 188 | "proposals": [], 189 | "starting_proposal_id": "1", 190 | "tally_params": { 191 | "quorum": "0.334000000000000000", 192 | "threshold": "0.500000000000000000", 193 | "veto_threshold": "0.334000000000000000" 194 | }, 195 | "votes": [], 196 | "voting_params": { 197 | "voting_period": "172800s" 198 | } 199 | }, 200 | "ibc": { 201 | "channel_genesis": { 202 | "ack_sequences": [], 203 | "acknowledgements": [], 204 | "channels": [], 205 | "commitments": [], 206 | "next_channel_sequence": "0", 207 | "receipts": [], 208 | "recv_sequences": [], 209 | "send_sequences": [] 210 | }, 211 | "client_genesis": { 212 | "clients": [], 213 | "clients_consensus": [], 214 | "clients_metadata": [], 215 | "create_localhost": false, 216 | "next_client_sequence": "0", 217 | "params": { 218 | "allowed_clients": [ 219 | "06-solomachine", 220 | "07-tendermint" 221 | ] 222 | } 223 | }, 224 | "connection_genesis": { 225 | "client_connection_paths": [], 226 | "connections": [], 227 | "next_connection_sequence": "0", 228 | "params": { 229 | "max_expected_time_per_block": "30000000000" 230 | } 231 | } 232 | }, 233 | "interchainaccounts": { 234 | "controller_genesis_state": { 235 | "active_channels": [], 236 | "interchain_accounts": [], 237 | "params": { 238 | "controller_enabled": true 239 | }, 240 | "ports": [] 241 | }, 242 | "host_genesis_state": { 243 | "active_channels": [], 244 | "interchain_accounts": [], 245 | "params": { 246 | "allow_messages": [], 247 | "host_enabled": true 248 | }, 249 | "port": "icahost" 250 | } 251 | }, 252 | "intertx": null, 253 | "mint": { 254 | "minter": { 255 | "annual_provisions": "0.000000000000000000", 256 | "inflation": "0.130000000000000000" 257 | }, 258 | "params": { 259 | "blocks_per_year": "6311520", 260 | "goal_bonded": "0.670000000000000000", 261 | "inflation_max": "0.200000000000000000", 262 | "inflation_min": "0.070000000000000000", 263 | "inflation_rate_change": "0.130000000000000000", 264 | "mint_denom": "ustake" 265 | } 266 | }, 267 | "params": null, 268 | "slashing": { 269 | "missed_blocks": [], 270 | "params": { 271 | "downtime_jail_duration": "600s", 272 | "min_signed_per_window": "0.500000000000000000", 273 | "signed_blocks_window": "100", 274 | "slash_fraction_double_sign": "0.050000000000000000", 275 | "slash_fraction_downtime": "0.010000000000000000" 276 | }, 277 | "signing_infos": [] 278 | }, 279 | "staking": { 280 | "delegations": [], 281 | "exported": false, 282 | "last_total_power": "0", 283 | "last_validator_powers": [], 284 | "params": { 285 | "bond_denom": "ustake", 286 | "historical_entries": 10000, 287 | "max_entries": 7, 288 | "max_validators": 100, 289 | "unbonding_time": "1814400s" 290 | }, 291 | "redelegations": [], 292 | "unbonding_delegations": [], 293 | "validators": [] 294 | }, 295 | "transfer": { 296 | "denom_traces": [], 297 | "params": { 298 | "receive_enabled": true, 299 | "send_enabled": true 300 | }, 301 | "port_id": "transfer" 302 | }, 303 | "upgrade": {}, 304 | "vesting": {}, 305 | "wasm": { 306 | "codes": [], 307 | "contracts": [], 308 | "gen_msgs": [], 309 | "params": { 310 | "code_upload_access": { 311 | "address": "", 312 | "permission": "Everybody" 313 | }, 314 | "instantiate_default_permission": "Everybody" 315 | }, 316 | "sequences": [] 317 | } 318 | }, 319 | "chain_id": "wasmd-1", 320 | "consensus_params": { 321 | "block": { 322 | "max_bytes": "22020096", 323 | "max_gas": "-1", 324 | "time_iota_ms": "10" 325 | }, 326 | "evidence": { 327 | "max_age_duration": "172800000000000", 328 | "max_age_num_blocks": "100000", 329 | "max_bytes": "1048576" 330 | }, 331 | "validator": { 332 | "pub_key_types": [ 333 | "ed25519" 334 | ] 335 | }, 336 | "version": {} 337 | }, 338 | "genesis_time": "2022-07-20T20:02:34.612004135Z", 339 | "initial_height": "1" 340 | } 341 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/gentx/gentx-e00476a52bbadced4266814cee02b61c4cbdb860.json: -------------------------------------------------------------------------------- 1 | {"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"wasm-moniker","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"wasm17e5l4ggxlyjf7k5scnas2zflwmnj9gjg54kce7","validator_address":"wasmvaloper17e5l4ggxlyjf7k5scnas2zflwmnj9gjgpfryhy","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"pbhQLheUqr0nbaNZ7z1wzAsXjLRilfq4xbcaMN2XRUY="},"value":{"denom":"ustake","amount":"3000000"}}],"memo":"e00476a52bbadced4266814cee02b61c4cbdb860@172.17.0.2:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+Mv0AWmUlfsrAvrUCYB2wOxnlBXzjFkAHXmUMalA50y"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["oHhjuBqgpc8xV6SZu5v8E0Bf653PPRPvqYjsI+6l1ht1aeGF8f+ym+UynVvQj9mHc0EXlts23dN9Ht7/jm2WEA=="]} 2 | -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"n9jWRTekT/X5IxciXaXt7tNkVqvnrz74shUX9CctXsJp7wZeMgedPT4DvASVkJz1EkF0v/yU40ePH7AwL4IlQg=="}} -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/config/priv_validator_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "DB364DA3F19040792740269C079AB040D0ACC9B2", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "pbhQLheUqr0nbaNZ7z1wzAsXjLRilfq4xbcaMN2XRUY=" 6 | }, 7 | "priv_key": { 8 | "type": "tendermint/PrivKeyEd25519", 9 | "value": "8+09drNpixEZe/Dbfm+0x46hD/8jZS5c3NLLt6UmmJGluFAuF5SqvSdto1nvPXDMCxeMtGKV+rjFtxow3ZdFRg==" 10 | } 11 | } -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/data/priv_validator_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "height": "0", 3 | "round": 0, 4 | "step": 0 5 | } -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/f669faa106f9249f5a90c4fb05093f76e722a248.address: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMi0wNy0yMCAyMDowMjozNS45NTM2Nzg1OTQgKzAwMDAgVVRDIG09KzAuNjM3NzgyNzEwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiZ25rZXlFR19hUnN3YTZJUiJ9.AoopwzMV7GLdqWwAkZK3MM3PEIwYCTdmeUtx15k5GqLVjoKHUFb0uw.hbxwFa3kKKGwXpAi.en1eHLJPI3FBMlNd5wI894HgHQV_EqRjFnS3ou9BuGESqbZUrvCNyCfJBP3tRGhnkSrUCvFuDiUolNd69o83QtThNK8BFRRbQVyHGaJPI5ZuhuaF_kt3FYmp7UrfVlumUve6Lx4_WY9aBN46MvRF3y5E49Qjer6Y8kqx61F23ag7NJ3ZHYhfRjbV6FyLcH-pSAjmIjLIqxIoLQOvZTWfg8z5aRhGIbRG9D_OCUjRX6-0jensqZVo9AJP.RWSTQClG4C9PalvJuBGJcA -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/keyhash: -------------------------------------------------------------------------------- 1 | $2a$10$nL84R.qjyT23fDjFWaNZPOp8DBiOoQRsZmDwXy65PfKoh7uWNz6OW -------------------------------------------------------------------------------- /ci-scripts/wasmd/template/.wasmd/validator.info: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMi0wNy0yMCAyMDowMjozNS45MTY2MTYxMzUgKzAwMDAgVVRDIG09KzAuNjAwNzIwMzM1IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoieU50NHRidGt6TUFZUVhOUyJ9.An0WIFG-o5_GHSfxTVs_PBVXKUHAlWjRdtLdKLbvDFqZ8GAPKebQSA.D0iZKIsCrLxx2zei.V9Zu-tGT9ULjYDu9pwwnjT5bJ7UidmTC4JbEKgac_GryRCfhy9Lmvumqyb38EbGGkAich27ZUHASLzWEC7clh3Z9_e70WQNsTqegoKdG_IG9YOa0-rC2eW_JGfnI-WSpE80tF7foA2sXBtug7YAfQL4JSyfIASbuc4odtTb_Vs0GhfPNS4cQSu0Z2GfT6WEgfPYnE7xU6nPAe39wiZDDgXPhB_TZZrLqMqycHYrYiIo4IwLwHDGlERjXnyh1KFOz0w0yRpl666HyUMAgkM7BR6D6_FXipr1g5d7ngfj4FWoAKjoxtq6vA2IjcWqGV1vSMC7ZbkXwr8M4Fqs0L3SYBYRqfWSMQEkMi3p0geKn74wOsMvg.a5z4pZrwHtY5USo8fj8UeA -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cw-ibc-queries" 3 | version = "0.1.0" 4 | authors = ["Ethan Frey ", "Jake Hartnell "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [features] 26 | # for quicker tests, cargo test --lib 27 | # for more explicit tests, cargo test --features=backtraces 28 | backtraces = ["cosmwasm-std/backtraces"] 29 | 30 | [dependencies] 31 | cw-ibc-query = { path = "../../packages/cw-ibc-query"} 32 | cosmwasm-std = { version = "1.0.0", features = ["iterator", "ibc3"] } 33 | cw-storage-plus = { version = "0.13.4" } 34 | cw-utils = { version = "0.13.4" } 35 | cw1-whitelist = { version = "0.13.4", features = ["library"]} 36 | schemars = "0.8.1" 37 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 38 | thiserror = { version = "1.0.23" } 39 | 40 | [dev-dependencies] 41 | cosmwasm-schema = { version = "1.0.0" } 42 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/README.md: -------------------------------------------------------------------------------- 1 | # CosmWasm IBC Queries 2 | 3 | Allows for querying the state of other CosmWasm chains using IBC. Support can be added for other IBC Query implementations once specifications for those implementations have been finalized. 4 | 5 | ## Workflow 6 | 7 | Requires a `cw-ibc-queries` contract on both chains. 8 | 9 | ## Protocol 10 | 11 | The packets sent look like: 12 | 13 | ```rust 14 | pub enum PacketMsg { 15 | IbcQuery { msgs: Vec, callback: Option }, 16 | } 17 | ``` 18 | 19 | Success looks like: 20 | 21 | ``` json 22 | TODO 23 | ``` 24 | 25 | The error ack packet always looks like this: 26 | 27 | ```json 28 | { 29 | "error": "invalid packet: " 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::env::current_dir; 2 | use std::fs::create_dir_all; 3 | 4 | use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; 5 | 6 | use cw_ibc_queries::msg::{ExecuteMsg, InstantiateMsg}; 7 | 8 | fn main() { 9 | let mut out_dir = current_dir().unwrap(); 10 | out_dir.push("schema"); 11 | create_dir_all(&out_dir).unwrap(); 12 | remove_schemas(&out_dir).unwrap(); 13 | 14 | export_schema(&schema_for!(ExecuteMsg), &out_dir); 15 | export_schema(&schema_for!(InstantiateMsg), &out_dir); 16 | } 17 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/contract.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{ 2 | entry_point, to_binary, DepsMut, Empty, Env, IbcMsg, MessageInfo, QueryRequest, Response, 3 | StdResult, 4 | }; 5 | 6 | use cw_ibc_query::PacketMsg; 7 | 8 | use crate::error::ContractError; 9 | use crate::msg::{ExecuteMsg, InstantiateMsg}; 10 | use crate::state::PACKET_LIFETIME; 11 | 12 | #[entry_point] 13 | pub fn instantiate( 14 | deps: DepsMut, 15 | _env: Env, 16 | _info: MessageInfo, 17 | msg: InstantiateMsg, 18 | ) -> StdResult { 19 | PACKET_LIFETIME.save(deps.storage, &msg.packet_lifetime)?; 20 | Ok(Response::new()) 21 | } 22 | 23 | #[entry_point] 24 | pub fn execute( 25 | deps: DepsMut, 26 | env: Env, 27 | info: MessageInfo, 28 | msg: ExecuteMsg, 29 | ) -> Result { 30 | cw_utils::nonpayable(&info)?; 31 | match msg { 32 | ExecuteMsg::IbcQuery { 33 | channel_id, 34 | msgs, 35 | callback, 36 | } => execute_ibc_query(deps, env, info, channel_id, msgs, callback), 37 | } 38 | } 39 | 40 | pub fn execute_ibc_query( 41 | deps: DepsMut, 42 | env: Env, 43 | _info: MessageInfo, 44 | channel_id: String, 45 | msgs: Vec>, 46 | callback: String, 47 | ) -> Result { 48 | // validate callback address 49 | deps.api.addr_validate(&callback)?; 50 | 51 | // construct a packet to send 52 | let packet = PacketMsg::IbcQuery { msgs, callback }; 53 | let msg = IbcMsg::SendPacket { 54 | channel_id, 55 | data: to_binary(&packet)?, 56 | timeout: env 57 | .block 58 | .time 59 | .plus_seconds(PACKET_LIFETIME.load(deps.storage)?) 60 | .into(), 61 | }; 62 | 63 | let res = Response::new() 64 | .add_message(msg) 65 | .add_attribute("action", "handle_check_remote_balance"); 66 | Ok(res) 67 | } 68 | 69 | #[cfg(test)] 70 | mod tests { 71 | use cosmwasm_std::testing::{ 72 | mock_dependencies, mock_env, mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, 73 | mock_ibc_channel_open_try, mock_info, MockApi, MockQuerier, MockStorage, 74 | }; 75 | use cosmwasm_std::OwnedDeps; 76 | 77 | use cw_ibc_query::{APP_ORDER, BAD_APP_ORDER, IBC_APP_VERSION}; 78 | 79 | use crate::ibc::{ibc_channel_connect, ibc_channel_open}; 80 | 81 | use super::*; 82 | 83 | const CREATOR: &str = "creator"; 84 | 85 | fn setup() -> OwnedDeps { 86 | let mut deps = mock_dependencies(); 87 | let msg = InstantiateMsg { 88 | packet_lifetime: 60u64, 89 | }; 90 | let info = mock_info(CREATOR, &[]); 91 | let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); 92 | assert_eq!(0, res.messages.len()); 93 | deps 94 | } 95 | 96 | #[test] 97 | fn instantiate_works() { 98 | let mut deps = mock_dependencies(); 99 | 100 | let msg = InstantiateMsg { 101 | packet_lifetime: 60u64, 102 | }; 103 | let info = mock_info("creator", &[]); 104 | let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); 105 | assert_eq!(0, res.messages.len()) 106 | } 107 | 108 | #[test] 109 | fn enforce_version_in_handshake() { 110 | let mut deps = setup(); 111 | 112 | let wrong_order = mock_ibc_channel_open_try("channel-12", BAD_APP_ORDER, IBC_APP_VERSION); 113 | ibc_channel_open(deps.as_mut(), mock_env(), wrong_order).unwrap_err(); 114 | 115 | let wrong_version = mock_ibc_channel_open_try("channel-12", APP_ORDER, "reflect"); 116 | ibc_channel_open(deps.as_mut(), mock_env(), wrong_version).unwrap_err(); 117 | 118 | let valid_handshake = mock_ibc_channel_open_try("channel-12", APP_ORDER, IBC_APP_VERSION); 119 | ibc_channel_open(deps.as_mut(), mock_env(), valid_handshake).unwrap(); 120 | } 121 | 122 | #[test] 123 | fn proper_handshake_flow() { 124 | let mut deps = setup(); 125 | let channel_id = "channel-1234"; 126 | 127 | // first we try to open with a valid handshake 128 | let handshake_open = mock_ibc_channel_open_init(channel_id, APP_ORDER, IBC_APP_VERSION); 129 | ibc_channel_open(deps.as_mut(), mock_env(), handshake_open).unwrap(); 130 | 131 | // then we connect (with counter-party version set) 132 | let handshake_connect = 133 | mock_ibc_channel_connect_ack(channel_id, APP_ORDER, IBC_APP_VERSION); 134 | let res = ibc_channel_connect(deps.as_mut(), mock_env(), handshake_connect).unwrap(); 135 | assert_eq!(0, res.messages.len()); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/error.rs: -------------------------------------------------------------------------------- 1 | use thiserror::Error; 2 | 3 | use cosmwasm_std::StdError; 4 | use cw_utils::{ParseReplyError, PaymentError}; 5 | 6 | use cw_ibc_query::SimpleIcaError; 7 | 8 | #[derive(Error, Debug, PartialEq)] 9 | pub enum ContractError { 10 | #[error("{0}")] 11 | Std(#[from] StdError), 12 | 13 | #[error("{0}")] 14 | ParseReply(#[from] ParseReplyError), 15 | 16 | #[error("{0}")] 17 | Payment(#[from] PaymentError), 18 | 19 | #[error("{0}")] 20 | SimpleIca(#[from] SimpleIcaError), 21 | 22 | #[error("Cannot register over an existing channel")] 23 | ChannelAlreadyRegistered, 24 | 25 | #[error("Invalid reply id")] 26 | InvalidReplyId, 27 | } 28 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/ibc.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{ 2 | entry_point, from_slice, to_binary, Binary, Deps, DepsMut, Empty, Env, Event, 3 | Ibc3ChannelOpenResponse, IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, 4 | IbcChannelOpenMsg, IbcChannelOpenResponse, IbcPacketAckMsg, IbcPacketReceiveMsg, 5 | IbcPacketTimeoutMsg, IbcReceiveResponse, QueryRequest, StdResult, SystemResult, WasmMsg, 6 | }; 7 | use cw_ibc_query::{ 8 | check_order, check_version, IbcQueryResponse, PacketMsg, ReceiveIbcResponseMsg, 9 | ReceiverExecuteMsg, StdAck, IBC_APP_VERSION, 10 | }; 11 | 12 | use crate::error::ContractError; 13 | use crate::state::PENDING; 14 | 15 | #[entry_point] 16 | /// enforces ordering and versioing constraints 17 | pub fn ibc_channel_open( 18 | _deps: DepsMut, 19 | _env: Env, 20 | msg: IbcChannelOpenMsg, 21 | ) -> Result { 22 | let channel = msg.channel(); 23 | 24 | check_order(&channel.order)?; 25 | // In ibcv3 we don't check the version string passed in the message 26 | // and only check the counterparty version. 27 | if let Some(counter_version) = msg.counterparty_version() { 28 | check_version(counter_version)?; 29 | } 30 | 31 | // We return the version we need (which could be different than the counterparty version) 32 | Ok(Some(Ibc3ChannelOpenResponse { 33 | version: IBC_APP_VERSION.to_string(), 34 | })) 35 | } 36 | 37 | #[entry_point] 38 | /// once it's established, we create the reflect contract 39 | pub fn ibc_channel_connect( 40 | deps: DepsMut, 41 | _env: Env, 42 | msg: IbcChannelConnectMsg, 43 | ) -> StdResult { 44 | let channel = msg.channel(); 45 | let chan_id = &channel.endpoint.channel_id; 46 | 47 | // store the channel id for the reply handler 48 | PENDING.save(deps.storage, chan_id)?; 49 | 50 | Ok(IbcBasicResponse::new() 51 | .add_attribute("action", "ibc_connect") 52 | .add_attribute("channel_id", chan_id) 53 | .add_event(Event::new("ibc").add_attribute("channel", "connect"))) 54 | } 55 | 56 | #[entry_point] 57 | /// On closed channel, we take all tokens from reflect contract to this contract. 58 | /// We also delete the channel entry from accounts. 59 | pub fn ibc_channel_close( 60 | _deps: DepsMut, 61 | _env: Env, 62 | msg: IbcChannelCloseMsg, 63 | ) -> StdResult { 64 | let channel = msg.channel(); 65 | // get contract address and remove lookup 66 | let channel_id = channel.endpoint.channel_id.as_str(); 67 | 68 | Ok(IbcBasicResponse::new() 69 | .add_attribute("action", "ibc_close") 70 | .add_attribute("channel_id", channel_id)) 71 | } 72 | 73 | #[entry_point] 74 | pub fn ibc_packet_receive( 75 | deps: DepsMut, 76 | _env: Env, 77 | msg: IbcPacketReceiveMsg, 78 | ) -> Result { 79 | let msg: PacketMsg = from_slice(&msg.packet.data)?; 80 | match msg { 81 | PacketMsg::IbcQuery { msgs, .. } => receive_query(deps.as_ref(), msgs), 82 | } 83 | } 84 | 85 | // Processes IBC query 86 | pub fn receive_query( 87 | deps: Deps, 88 | msgs: Vec>, 89 | ) -> Result { 90 | let mut results: Vec = vec![]; 91 | 92 | for query in msgs { 93 | let res = match deps.querier.raw_query(&to_binary(&query)?) { 94 | SystemResult::Ok(res) => res, 95 | SystemResult::Err(err) => cosmwasm_std::ContractResult::Err(err.to_string()), 96 | }; 97 | results.push(to_binary(&res)?); 98 | } 99 | let response = IbcQueryResponse { results }; 100 | 101 | let acknowledgement = StdAck::success(&response); 102 | Ok(IbcReceiveResponse::new() 103 | .set_ack(acknowledgement) 104 | .add_attribute("action", "receive_ibc_query")) 105 | } 106 | 107 | #[entry_point] 108 | pub fn ibc_packet_ack( 109 | deps: DepsMut, 110 | env: Env, 111 | msg: IbcPacketAckMsg, 112 | ) -> Result { 113 | // we need to parse the ack based on our request 114 | let original_packet: PacketMsg = from_slice(&msg.original_packet.data)?; 115 | 116 | match original_packet { 117 | PacketMsg::IbcQuery { callback, .. } => acknowledge_query(deps, env, callback, msg), 118 | } 119 | } 120 | 121 | #[entry_point] 122 | pub fn ibc_packet_timeout( 123 | _deps: DepsMut, 124 | _env: Env, 125 | _msg: IbcPacketTimeoutMsg, 126 | ) -> StdResult { 127 | Ok(IbcBasicResponse::new().add_attribute("action", "ibc_packet_timeout")) 128 | } 129 | 130 | fn acknowledge_query( 131 | _deps: DepsMut, 132 | _env: Env, 133 | callback: String, 134 | msg: IbcPacketAckMsg, 135 | ) -> Result { 136 | // Send IBC packet ack message to another contract 137 | let msg = WasmMsg::Execute { 138 | contract_addr: callback.clone(), 139 | msg: to_binary(&ReceiverExecuteMsg::ReceiveIbcResponse( 140 | ReceiveIbcResponseMsg { msg }, 141 | ))?, 142 | funds: vec![], 143 | }; 144 | Ok(IbcBasicResponse::new() 145 | .add_attribute("action", "acknowledge_ibc_query") 146 | .add_attribute("callback_address", callback) 147 | .add_message(msg)) 148 | } 149 | 150 | #[cfg(test)] 151 | mod tests { 152 | use cosmwasm_std::{ 153 | testing::{mock_dependencies, mock_env, mock_ibc_packet_ack}, 154 | BankQuery, IbcAcknowledgement, 155 | }; 156 | 157 | use crate::msg::InstantiateMsg; 158 | 159 | use super::*; 160 | 161 | const CHANNEL: &str = "channel-42"; 162 | 163 | #[test] 164 | fn try_receive_query() { 165 | let deps = mock_dependencies(); 166 | 167 | let res = receive_query( 168 | deps.as_ref(), 169 | vec![QueryRequest::::Bank(BankQuery::AllBalances { 170 | address: String::from("test"), 171 | })], 172 | ); 173 | assert!(res.is_ok()); 174 | } 175 | 176 | #[test] 177 | fn try_acknowledge_query() { 178 | let mut deps = mock_dependencies(); 179 | let env = mock_env(); 180 | 181 | let ack = IbcAcknowledgement::new([]); 182 | let ibc_res = mock_ibc_packet_ack( 183 | CHANNEL, 184 | &InstantiateMsg { 185 | packet_lifetime: 60u64, 186 | }, 187 | ack, 188 | ) 189 | .unwrap(); 190 | let res = acknowledge_query(deps.as_mut(), env, String::from("test"), ibc_res); 191 | assert!(res.is_ok()); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | pub mod ibc; 4 | pub mod msg; 5 | pub mod state; 6 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Empty, QueryRequest}; 2 | use schemars::JsonSchema; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | /// Just needs to know the code_id of a reflect contract to spawn sub-accounts 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InstantiateMsg { 8 | pub packet_lifetime: u64, 9 | } 10 | 11 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 12 | #[serde(rename_all = "snake_case")] 13 | pub enum ExecuteMsg { 14 | IbcQuery { 15 | channel_id: String, 16 | // Queries to be executed 17 | msgs: Vec>, 18 | // Callback contract address that implements ReceiveIbcResponseMsg 19 | callback: String, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /contracts/cw-ibc-queries/src/state.rs: -------------------------------------------------------------------------------- 1 | use cw_storage_plus::Item; 2 | 3 | pub const PENDING: Item = Item::new("pending"); 4 | pub const PACKET_LIFETIME: Item = Item::new("packet_lifetime"); 5 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | wasm = "build --release --target wasm32-unknown-unknown" 3 | wasm-debug = "build --target wasm32-unknown-unknown" 4 | unit-test = "test --lib" 5 | schema = "run --example schema" 6 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cw-ibc-query-receiver" 3 | version = "0.1.0" 4 | authors = ["Ethan Frey ", "Jake Hartnell "] 5 | edition = "2021" 6 | publish = false 7 | license = "Apache-2.0" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [profile.release] 15 | opt-level = 3 16 | debug = false 17 | rpath = false 18 | lto = true 19 | debug-assertions = false 20 | codegen-units = 1 21 | panic = 'abort' 22 | incremental = false 23 | overflow-checks = true 24 | 25 | [features] 26 | # for quicker tests, cargo test --lib 27 | # for more explicit tests, cargo test --features=backtraces 28 | backtraces = ["cosmwasm-std/backtraces"] 29 | 30 | [dependencies] 31 | cw-ibc-query = { path = "../../packages/cw-ibc-query"} 32 | cosmwasm-std = { version = "1.0.0", features = ["iterator", "ibc3"] } 33 | cw-storage-plus = { version = "0.13.4" } 34 | cw-utils = { version = "0.13.4" } 35 | cw1-whitelist = { version = "0.13.4", features = ["library"]} 36 | schemars = "0.8.1" 37 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 38 | thiserror = { version = "1.0.23" } 39 | 40 | [dev-dependencies] 41 | cosmwasm-schema = { version = "1.0.0" } 42 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/README.md: -------------------------------------------------------------------------------- 1 | # CosmWasm IBC Query Receiver 2 | 3 | An example contract illustrating how to recieve and store the result of an IBC query using `ReceiveIbcResponseMsg`. 4 | 5 | ## Workflow 6 | 7 | Requires `cw-ibc-queries` contract to be deployed on the same chain from which it will recieve query results. 8 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::env::current_dir; 2 | use std::fs::create_dir_all; 3 | 4 | use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; 5 | 6 | use cw_ibc_query_receiver::{ 7 | msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, 8 | state::IbcQueryResultResponse, 9 | }; 10 | 11 | fn main() { 12 | let mut out_dir = current_dir().unwrap(); 13 | out_dir.push("schema"); 14 | create_dir_all(&out_dir).unwrap(); 15 | remove_schemas(&out_dir).unwrap(); 16 | 17 | export_schema(&schema_for!(ExecuteMsg), &out_dir); 18 | export_schema(&schema_for!(InstantiateMsg), &out_dir); 19 | export_schema(&schema_for!(QueryMsg), &out_dir); 20 | export_schema(&schema_for!(IbcQueryResultResponse), &out_dir); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/src/contract.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{ 2 | entry_point, to_binary, Deps, DepsMut, Env, IbcPacketAckMsg, MessageInfo, QueryResponse, 3 | Response, StdResult, 4 | }; 5 | use cw_ibc_query::ReceiveIbcResponseMsg; 6 | 7 | use crate::error::ContractError; 8 | use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; 9 | use crate::state::{IbcQueryResultResponse, LATEST_QUERIES}; 10 | 11 | #[entry_point] 12 | pub fn instantiate( 13 | _deps: DepsMut, 14 | _env: Env, 15 | _info: MessageInfo, 16 | _msg: InstantiateMsg, 17 | ) -> StdResult { 18 | // Do nothing for now 19 | Ok(Response::new()) 20 | } 21 | 22 | #[entry_point] 23 | pub fn execute( 24 | deps: DepsMut, 25 | env: Env, 26 | info: MessageInfo, 27 | msg: ExecuteMsg, 28 | ) -> Result { 29 | cw_utils::nonpayable(&info)?; 30 | match msg { 31 | ExecuteMsg::ReceiveIbcResponse(ReceiveIbcResponseMsg { msg }) => { 32 | execute_receive(deps, env, info, msg) 33 | } 34 | } 35 | } 36 | 37 | pub fn execute_receive( 38 | deps: DepsMut, 39 | env: Env, 40 | _info: MessageInfo, 41 | msg: IbcPacketAckMsg, 42 | ) -> Result { 43 | // which local channel was this packet send from 44 | let channel_id = msg.original_packet.src.channel_id.clone(); 45 | // store IBC response for later querying from the smart contract?? 46 | LATEST_QUERIES.save( 47 | deps.storage, 48 | &channel_id, 49 | &IbcQueryResultResponse { 50 | last_update_time: env.block.time, 51 | response: msg, 52 | }, 53 | )?; 54 | Ok(Response::default()) 55 | } 56 | 57 | #[entry_point] 58 | pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { 59 | match msg { 60 | QueryMsg::LatestQueryResult { channel_id } => { 61 | to_binary(&query_latest_ibc_query_result(deps, channel_id)?) 62 | } 63 | } 64 | } 65 | 66 | fn query_latest_ibc_query_result( 67 | deps: Deps, 68 | channel_id: String, 69 | ) -> StdResult { 70 | let results = LATEST_QUERIES.load(deps.storage, &channel_id)?; 71 | Ok(results) 72 | } 73 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/src/error.rs: -------------------------------------------------------------------------------- 1 | use thiserror::Error; 2 | 3 | use cosmwasm_std::StdError; 4 | use cw_utils::{ParseReplyError, PaymentError}; 5 | 6 | use cw_ibc_query::SimpleIcaError; 7 | 8 | #[derive(Error, Debug, PartialEq)] 9 | pub enum ContractError { 10 | #[error("{0}")] 11 | Std(#[from] StdError), 12 | 13 | #[error("{0}")] 14 | ParseReply(#[from] ParseReplyError), 15 | 16 | #[error("{0}")] 17 | Payment(#[from] PaymentError), 18 | 19 | #[error("{0}")] 20 | SimpleIca(#[from] SimpleIcaError), 21 | 22 | #[error("Cannot register over an existing channel")] 23 | ChannelAlreadyRegistered, 24 | 25 | #[error("Invalid reply id")] 26 | InvalidReplyId, 27 | } 28 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | pub mod msg; 4 | pub mod state; 5 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/src/msg.rs: -------------------------------------------------------------------------------- 1 | use cw_ibc_query::ReceiveIbcResponseMsg; 2 | use schemars::JsonSchema; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | /// Just needs to know the code_id of a reflect contract to spawn sub-accounts 6 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 7 | pub struct InstantiateMsg {} 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 10 | #[serde(rename_all = "snake_case")] 11 | pub enum ExecuteMsg { 12 | ReceiveIbcResponse(ReceiveIbcResponseMsg), 13 | } 14 | 15 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 16 | #[serde(rename_all = "snake_case")] 17 | pub enum QueryMsg { 18 | // Get latest query 19 | LatestQueryResult { channel_id: String }, 20 | } 21 | -------------------------------------------------------------------------------- /contracts/cw-ibc-query-receiver/src/state.rs: -------------------------------------------------------------------------------- 1 | use schemars::JsonSchema; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use cosmwasm_std::{IbcPacketAckMsg, Timestamp}; 5 | use cw_storage_plus::Map; 6 | 7 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 8 | pub struct IbcQueryResultResponse { 9 | /// last block balance was updated (0 is never) 10 | pub last_update_time: Timestamp, 11 | pub response: IbcPacketAckMsg, 12 | } 13 | pub const LATEST_QUERIES: Map<&str, IbcQueryResultResponse> = Map::new("queries"); 14 | -------------------------------------------------------------------------------- /devtools/build_integration_wasm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # This file is used for local testing. Once you update Rust files, run this to prepare them for the 6 | # integration tests. Then you can run the integration tests. 7 | 8 | # go to root dir regardless of where it was run 9 | SCRIPT_DIR="$(realpath "$(dirname "$0")")" 10 | cd ${SCRIPT_DIR}/.. 11 | 12 | # compile all contracts 13 | for C in ./contracts/*/ 14 | do 15 | echo "Compiling `basename $C`..." 16 | (cd $C && RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked) 17 | done 18 | 19 | # move them to the internal dir inside tests 20 | mkdir -p ./tests/internal 21 | cp ./target/wasm32-unknown-unknown/release/*.wasm ./tests/internal 22 | 23 | ls -l ./tests/internal 24 | -------------------------------------------------------------------------------- /devtools/format_md.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="write" 7 | while getopts c option; do 8 | case "${option}" in 9 | c) op="check" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | npx prettier@2.2.1 --$op "./**/*.md" 15 | -------------------------------------------------------------------------------- /devtools/format_sh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="w" 7 | while getopts c option; do 8 | case "${option}" in 9 | c) op="d" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | shfmt -$op devtools packages 15 | -------------------------------------------------------------------------------- /devtools/format_yml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | # Running with -c makes the script only validate instead of editing in place. 6 | op="write" 7 | while getopts c option; do 8 | case "${option}" in 9 | c) op="check" ;; 10 | *) ;; 11 | esac 12 | done 13 | 14 | npx prettier@2.2.1 --$op "./**/*.yml" 15 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/.cargo/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | unit-test = "test --lib" 3 | schema = "run --example schema" 4 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cw-ibc-query" 3 | authors = ["Ethan Frey ", "Jake Hartnell "] 4 | version = "0.1.0" 5 | edition = "2021" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | cosmwasm-std = { version = "1.0.0", features = ["ibc3"] } 11 | schemars = "0.8.1" 12 | serde = { version = "1.0.103", default-features = false, features = ["derive"] } 13 | thiserror = { version = "1.0.23" } 14 | 15 | [dev-dependencies] 16 | cosmwasm-schema = { version = "1.0.0" } 17 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::env::current_dir; 2 | use std::fs::create_dir_all; 3 | 4 | use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; 5 | 6 | use cw_ibc_query::{IbcQueryResponse, PacketMsg, StdAck}; 7 | 8 | fn main() { 9 | let mut out_dir = current_dir().unwrap(); 10 | out_dir.push("schema"); 11 | create_dir_all(&out_dir).unwrap(); 12 | remove_schemas(&out_dir).unwrap(); 13 | 14 | export_schema(&schema_for!(PacketMsg), &out_dir); 15 | export_schema(&schema_for!(StdAck), &out_dir); 16 | export_schema(&schema_for!(IbcQueryResponse), &out_dir); 17 | } 18 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/src/checks.rs: -------------------------------------------------------------------------------- 1 | pub use crate::{APP_ORDER, IBC_APP_VERSION}; 2 | use cosmwasm_std::IbcOrder; 3 | 4 | use thiserror::Error; 5 | 6 | #[derive(Error, Debug, PartialEq)] 7 | pub enum SimpleIcaError { 8 | #[error("Only supports unordered channels")] 9 | InvalidChannelOrder, 10 | 11 | #[error("Counterparty version must be '{0}'")] 12 | InvalidChannelVersion(&'static str), 13 | } 14 | 15 | pub fn check_order(order: &IbcOrder) -> Result<(), SimpleIcaError> { 16 | if order != &APP_ORDER { 17 | Err(SimpleIcaError::InvalidChannelOrder) 18 | } else { 19 | Ok(()) 20 | } 21 | } 22 | 23 | pub fn check_version(version: &str) -> Result<(), SimpleIcaError> { 24 | if version != IBC_APP_VERSION { 25 | Err(SimpleIcaError::InvalidChannelVersion(IBC_APP_VERSION)) 26 | } else { 27 | Ok(()) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/src/ibc_msg.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{ 2 | from_slice, to_binary, Binary, CosmosMsg, Empty, IbcPacketAckMsg, QueryRequest, StdResult, 3 | WasmMsg, 4 | }; 5 | use schemars::JsonSchema; 6 | use serde::de::DeserializeOwned; 7 | use serde::{Deserialize, Serialize}; 8 | 9 | /// This is the message we send over the IBC channel 10 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 11 | #[serde(rename_all = "snake_case")] 12 | pub enum PacketMsg { 13 | IbcQuery { 14 | msgs: Vec>, 15 | callback: String, 16 | }, 17 | } 18 | 19 | /// This is a generic ICS acknowledgement format. 20 | /// Proto defined here: https://github.com/cosmos/cosmos-sdk/blob/v0.42.0/proto/ibc/core/channel/v1/channel.proto#L141-L147 21 | /// If ibc_receive_packet returns Err(), then x/wasm runtime will rollback the state and return an error message in this format 22 | #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] 23 | #[serde(rename_all = "snake_case")] 24 | pub enum StdAck { 25 | Result(Binary), 26 | Error(String), 27 | } 28 | 29 | impl StdAck { 30 | // create a serialized success message 31 | pub fn success(data: impl Serialize) -> Binary { 32 | let res = to_binary(&data).unwrap(); 33 | StdAck::Result(res).ack() 34 | } 35 | 36 | // create a serialized error message 37 | pub fn fail(err: String) -> Binary { 38 | StdAck::Error(err).ack() 39 | } 40 | 41 | pub fn ack(&self) -> Binary { 42 | to_binary(self).unwrap() 43 | } 44 | 45 | pub fn unwrap(self) -> Binary { 46 | match self { 47 | StdAck::Result(data) => data, 48 | StdAck::Error(err) => panic!("{}", err), 49 | } 50 | } 51 | 52 | pub fn unwrap_into(self) -> T { 53 | from_slice(&self.unwrap()).unwrap() 54 | } 55 | 56 | pub fn unwrap_err(self) -> String { 57 | match self { 58 | StdAck::Result(_) => panic!("not an error"), 59 | StdAck::Error(err) => err, 60 | } 61 | } 62 | } 63 | 64 | /// ReceiveIbcResponseMsg should be de/serialized under `Receive()` variant in a ExecuteMsg 65 | #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] 66 | #[serde(rename_all = "snake_case")] 67 | pub struct ReceiveIbcResponseMsg { 68 | pub msg: IbcPacketAckMsg, 69 | } 70 | 71 | impl ReceiveIbcResponseMsg { 72 | /// serializes the message 73 | pub fn into_binary(self) -> StdResult { 74 | let msg = ReceiverExecuteMsg::ReceiveIbcResponse(self); 75 | to_binary(&msg) 76 | } 77 | 78 | /// creates a cosmos_msg sending this struct to the named contract 79 | pub fn into_cosmos_msg, C>(self, contract_addr: T) -> StdResult> 80 | where 81 | C: Clone + std::fmt::Debug + PartialEq + JsonSchema, 82 | { 83 | let msg = self.into_binary()?; 84 | let execute = WasmMsg::Execute { 85 | contract_addr: contract_addr.into(), 86 | msg, 87 | funds: vec![], 88 | }; 89 | Ok(execute.into()) 90 | } 91 | } 92 | 93 | /// This is just a helper to properly serialize the above message. 94 | /// The actual receiver should include this variant in the larger ExecuteMsg enum 95 | #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] 96 | #[serde(rename_all = "snake_case")] 97 | pub enum ReceiverExecuteMsg { 98 | ReceiveIbcResponse(ReceiveIbcResponseMsg), 99 | } 100 | 101 | /// Return the data field for each message 102 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 103 | pub struct IbcQueryResponse { 104 | pub results: Vec, 105 | } 106 | -------------------------------------------------------------------------------- /packages/cw-ibc-query/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod checks; 2 | mod ibc_msg; 3 | 4 | use cosmwasm_std::IbcOrder; 5 | 6 | pub use crate::checks::{check_order, check_version, SimpleIcaError}; 7 | pub use crate::ibc_msg::{ 8 | IbcQueryResponse, PacketMsg, ReceiveIbcResponseMsg, ReceiverExecuteMsg, StdAck, 9 | }; 10 | 11 | pub const IBC_APP_VERSION: &str = "simple-ica-v1"; 12 | pub const APP_ORDER: IbcOrder = IbcOrder::Unordered; 13 | // we use this for tests to ensure it is rejected 14 | pub const BAD_APP_ORDER: IbcOrder = IbcOrder::Ordered; 15 | -------------------------------------------------------------------------------- /tests/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { "project": "./tsconfig.json" }, 5 | "env": { "es6": true }, 6 | "ignorePatterns": ["node_modules", "build", "coverage"], 7 | "plugins": ["import", "eslint-comments"], 8 | "extends": [ 9 | "eslint:recommended", 10 | "plugin:eslint-comments/recommended", 11 | "plugin:@typescript-eslint/recommended", 12 | "plugin:import/typescript", 13 | "prettier" 14 | ], 15 | "globals": { "BigInt": true, "console": true, "WebAssembly": true }, 16 | "rules": { 17 | "@typescript-eslint/explicit-module-boundary-types": "off", 18 | "eslint-comments/disable-enable-pair": [ 19 | "error", 20 | { "allowWholeFile": true } 21 | ], 22 | "eslint-comments/no-unused-disable": "error", 23 | "import/order": [ 24 | "error", 25 | { "newlines-between": "always", "alphabetize": { "order": "asc" } } 26 | ], 27 | "sort-imports": [ 28 | "error", 29 | { "ignoreDeclarationSort": true, "ignoreCase": true } 30 | ], 31 | "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], 32 | "object-shorthand": ["error", "always"] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | build/ 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | *.lcov 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules/ 44 | jspm_packages/ 45 | 46 | # TypeScript v1 declaration files 47 | typings/ 48 | 49 | # TypeScript cache 50 | *.tsbuildinfo 51 | 52 | # Optional npm cache directory 53 | .npm 54 | 55 | # Optional eslint cache 56 | .eslintcache 57 | 58 | # Microbundle cache 59 | .rpt2_cache/ 60 | .rts2_cache_cjs/ 61 | .rts2_cache_es/ 62 | .rts2_cache_umd/ 63 | 64 | # Optional REPL history 65 | .node_repl_history 66 | 67 | # Output of 'npm pack' 68 | *.tgz 69 | 70 | # Yarn Integrity file 71 | .yarn-integrity 72 | 73 | # dotenv environment variables file 74 | .env 75 | .env.test 76 | 77 | # parcel-bundler cache (https://parceljs.org/) 78 | .cache 79 | 80 | # Next.js build output 81 | .next 82 | 83 | # Nuxt.js build / generate output 84 | .nuxt 85 | dist 86 | 87 | # Gatsby files 88 | .cache/ 89 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 90 | # https://nextjs.org/blog/next-9-1#public-directory-support 91 | # public 92 | 93 | # vuepress build output 94 | .vuepress/dist 95 | 96 | # Serverless directories 97 | .serverless/ 98 | 99 | # FuseBox cache 100 | .fusebox/ 101 | 102 | # DynamoDB Local files 103 | .dynamodb/ 104 | 105 | # TernJS port file 106 | .tern-port 107 | -------------------------------------------------------------------------------- /tests/.prettierignore: -------------------------------------------------------------------------------- 1 | # package.json is formatted by package managers, so we ignore it here 2 | package.json 3 | build 4 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # ibc-tests-ics20 2 | 3 | Simple repo showing how to use ts-relayer as a library to test cw20-ics20 contract 4 | 5 | ## Setup 6 | 7 | Ensure you have node 14+ (16+ recommended): 8 | 9 | ``` 10 | node --version 11 | ``` 12 | 13 | Then install via npm as typical: 14 | 15 | ``` 16 | npm install 17 | ``` 18 | 19 | ## Development 20 | 21 | Build the source: 22 | 23 | ``` 24 | npm run build 25 | ``` 26 | 27 | Clean it up with prettier and eslint: 28 | 29 | ``` 30 | npm run fix 31 | ``` 32 | 33 | ## Testing 34 | 35 | ### Build optimized contract WASM 36 | 37 | Compile the contracts for uploading. 38 | 39 | ```sh 40 | ./devtools/build_integration_wasm.sh 41 | ``` 42 | 43 | NOTE: you need to run this each time your contract changes. 44 | 45 | ### Run two chains in docker 46 | 47 | This actually runs the test codes on contracts. To do so, we need to start two blockchains in the background and then run the process. This requires that you have docker installed and running on your local machine. If you don't, please do that first before running the scripts. (Also, they only work on Linux and MacOS... sorry Windows folks, you are welcome to PR an equivalent). 48 | 49 | Terminal 1: 50 | 51 | ``` 52 | ./ci-scripts/wasmd/start.sh 53 | ``` 54 | 55 | Terminal 2: 56 | 57 | ``` 58 | ./ci-scripts/osmosis/start.sh 59 | ``` 60 | 61 | If those start properly, you should see a series of `executed block` messages. If they fail, check `debug.log` in that directory for full log messages. 62 | 63 | ### Run tests 64 | 65 | Terminal 3: 66 | 67 | ``` 68 | npm run test 69 | ``` 70 | 71 | You may run and re-run tests many times. When you are done with it and want to free up some system resources (stop running two blockchains in the background), you need to run these commands to stop them properly: 72 | 73 | ``` 74 | ./scripts/wasmd/stop.sh 75 | ./scripts/osmosisd/stop.sh 76 | ``` 77 | -------------------------------------------------------------------------------- /tests/external/cw1_whitelist.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakeHartnell/cw-ibc-queries/f0da60afe0dfc5cdcbae8a5c5dac79981bff321c/tests/external/cw1_whitelist.wasm -------------------------------------------------------------------------------- /tests/external/download_releases.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck > /dev/null && shellcheck "$0" 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: ./download_releases.sh RELEASE_TAG" 7 | exit 1 8 | fi 9 | 10 | # eg. v0.13.4 11 | tag="$1" 12 | 13 | for contract in cw1_whitelist; do 14 | url="https://github.com/CosmWasm/cosmwasm-plus/releases/download/${tag}/${contract}.wasm" 15 | echo "Downloading $url ..." 16 | wget -O "${contract}.wasm" "$url" 17 | done 18 | 19 | rm -f version.txt 20 | echo "$tag" >version.txt 21 | -------------------------------------------------------------------------------- /tests/external/version.txt: -------------------------------------------------------------------------------- 1 | v0.13.4 2 | -------------------------------------------------------------------------------- /tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ibc-tests-ics20", 3 | "version": "0.1.0", 4 | "description": "Simple repo showing how to use ts-relayer as a library to test cw20-ics20 contract", 5 | "browserslist": [ 6 | "maintained node versions" 7 | ], 8 | "repository": "git@github.com:confio/ibc-tests-ics20.git", 9 | "author": "Ethan Frey ", 10 | "license": "Apache-2.0", 11 | "private": false, 12 | "scripts": { 13 | "build": "tsc -p tsconfig.json", 14 | "fix": "run-s fix:*", 15 | "fix:prettier": "prettier \"**/*.{ts,md}\" --write", 16 | "fix:lint": "eslint src --ext .ts --fix", 17 | "test": "run-s build test:*", 18 | "test:lint": "eslint src --ext .ts", 19 | "test:prettier": "prettier \"**/*.{ts,md}\" --list-different", 20 | "test:unit": "nyc --silent ava --serial" 21 | }, 22 | "dependencies": { 23 | "@confio/relayer": "^0.5.1" 24 | }, 25 | "devDependencies": { 26 | "@ava/typescript": "^3.0.1", 27 | "@istanbuljs/nyc-config-typescript": "^1.0.2", 28 | "@types/node": "^18.0.6", 29 | "@types/sinon": "^10.0.13", 30 | "@typescript-eslint/eslint-plugin": "^5.30.7", 31 | "@typescript-eslint/parser": "^5.30.7", 32 | "ava": "^4.3.1", 33 | "eslint": "^8.20.0", 34 | "eslint-config-prettier": "^8.5.0", 35 | "eslint-plugin-eslint-comments": "^3.2.0", 36 | "eslint-plugin-import": "^2.26.0", 37 | "npm-run-all": "^4.1.5", 38 | "nyc": "^15.1.0", 39 | "prettier": "^2.7.1", 40 | "sinon": "^14.0.0", 41 | "typescript": "^4.7.4" 42 | }, 43 | "ava": { 44 | "failFast": true, 45 | "timeout": "120s", 46 | "typescript": { 47 | "rewritePaths": { 48 | "src/": "build/" 49 | }, 50 | "compile": false 51 | } 52 | }, 53 | "nyc": { 54 | "extends": "@istanbuljs/nyc-config-typescript", 55 | "exclude": [ 56 | "**/*.spec.js" 57 | ] 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tests/src/cosmwasm.spec.ts: -------------------------------------------------------------------------------- 1 | import { CosmWasmSigner, Link, testutils } from "@confio/relayer"; 2 | // import { toBase64, toUtf8 } from "@cosmjs/encoding"; 3 | import { fromBase64, fromUtf8 } from "@cosmjs/encoding"; 4 | import { assert } from "@cosmjs/utils"; 5 | import test from "ava"; 6 | import { Order } from "cosmjs-types/ibc/core/channel/v1/channel"; 7 | 8 | const { osmosis: oldOsmo, setup, wasmd } = testutils; 9 | const osmosis = { ...oldOsmo, minFee: "0.025uosmo" }; 10 | 11 | import { IbcVersion, setupContracts, setupOsmosisClient, setupWasmClient } from "./utils"; 12 | 13 | let wasmIds: Record = {}; 14 | let osmosisIds: Record = {}; 15 | 16 | test.before(async (t) => { 17 | console.debug("Upload contracts to wasmd..."); 18 | const wasmContracts = { 19 | querier: "./internal/cw_ibc_queries.wasm", 20 | receiver: "./internal/cw_ibc_query_receiver.wasm", 21 | }; 22 | const wasmSign = await setupWasmClient(); 23 | wasmIds = await setupContracts(wasmSign, wasmContracts); 24 | 25 | console.debug("Upload contracts to osmosis..."); 26 | const osmosisContracts = { 27 | querier: "./internal/cw_ibc_queries.wasm", 28 | }; 29 | const osmosisSign = await setupOsmosisClient(); 30 | osmosisIds = await setupContracts(osmosisSign, osmosisContracts); 31 | 32 | t.pass(); 33 | }); 34 | 35 | test.serial("set up channel with ibc-queries contract", async (t) => { 36 | // instantiate cw-ibc-queries on wasmd 37 | const wasmClient = await setupWasmClient(); 38 | const { contractAddress: wasmCont } = await wasmClient.sign.instantiate( 39 | wasmClient.senderAddress, 40 | wasmIds.querier, 41 | {}, 42 | "simple querier", 43 | "auto" 44 | ); 45 | t.truthy(wasmCont); 46 | const { ibcPortId: wasmQuerierPort } = await wasmClient.sign.getContract(wasmCont); 47 | t.log(`Querier Port: ${wasmQuerierPort}`); 48 | assert(wasmQuerierPort); 49 | 50 | // instantiate ica querier on osmosis 51 | const osmoClient = await setupOsmosisClient(); 52 | const { contractAddress: osmoQuerier } = await osmoClient.sign.instantiate( 53 | osmoClient.senderAddress, 54 | osmosisIds.querier, 55 | {}, 56 | "simple querier", 57 | "auto" 58 | ); 59 | t.truthy(osmoQuerier); 60 | const { ibcPortId: osmoQuerierPort } = await osmoClient.sign.getContract(osmoQuerier); 61 | t.log(`Querier Port: ${osmoQuerierPort}`); 62 | assert(osmoQuerierPort); 63 | 64 | const [src, dest] = await setup(wasmd, osmosis); 65 | const link = await Link.createWithNewConnections(src, dest); 66 | await link.createChannel("A", wasmQuerierPort, osmoQuerierPort, Order.ORDER_UNORDERED, IbcVersion); 67 | }); 68 | 69 | interface SetupInfo { 70 | wasmClient: CosmWasmSigner; 71 | osmoClient: CosmWasmSigner; 72 | wasmQuerier: string; 73 | osmoQuerier: string; 74 | wasmQueryReceiver: string; 75 | link: Link; 76 | ics20: { 77 | wasm: string; 78 | osmo: string; 79 | }; 80 | channelIds: { 81 | wasm: string; 82 | osmo: string; 83 | }; 84 | } 85 | 86 | async function demoSetup(): Promise { 87 | // instantiate ica querier on wasmd 88 | const wasmClient = await setupWasmClient(); 89 | const { contractAddress: wasmQuerier } = await wasmClient.sign.instantiate( 90 | wasmClient.senderAddress, 91 | wasmIds.querier, 92 | {}, 93 | "IBC Queries contract", 94 | "auto" 95 | ); 96 | const { ibcPortId: wasmQuerierPort } = await wasmClient.sign.getContract(wasmQuerier); 97 | assert(wasmQuerierPort); 98 | 99 | // instantiate ibc query receiver on wasmd 100 | const { contractAddress: wasmQueryReceiver } = await wasmClient.sign.instantiate( 101 | wasmClient.senderAddress, 102 | wasmIds.receiver, 103 | {}, 104 | "IBC Query receiver contract", 105 | "auto" 106 | ); 107 | assert(wasmQueryReceiver); 108 | 109 | // instantiate ica querier on osmosis 110 | const osmoClient = await setupOsmosisClient(); 111 | const { contractAddress: osmoQuerier } = await osmoClient.sign.instantiate( 112 | osmoClient.senderAddress, 113 | osmosisIds.querier, 114 | {}, 115 | "IBC Queries contract", 116 | "auto" 117 | ); 118 | const { ibcPortId: osmoQuerierPort } = await osmoClient.sign.getContract(osmoQuerier); 119 | assert(osmoQuerierPort); 120 | 121 | // create a connection and channel for simple-ica 122 | const [src, dest] = await setup(wasmd, osmosis); 123 | const link = await Link.createWithNewConnections(src, dest); 124 | const channelInfo = await link.createChannel( 125 | "A", 126 | wasmQuerierPort, 127 | osmoQuerierPort, 128 | Order.ORDER_UNORDERED, 129 | IbcVersion 130 | ); 131 | const channelIds = { 132 | wasm: channelInfo.src.channelId, 133 | osmo: channelInfo.src.channelId, 134 | }; 135 | 136 | // also create a ics20 channel on this connection 137 | const ics20Info = await link.createChannel("A", wasmd.ics20Port, osmosis.ics20Port, Order.ORDER_UNORDERED, "ics20-1"); 138 | const ics20 = { 139 | wasm: ics20Info.src.channelId, 140 | osmo: ics20Info.dest.channelId, 141 | }; 142 | console.log(ics20Info); 143 | 144 | return { 145 | wasmClient, 146 | osmoClient, 147 | wasmQuerier, 148 | osmoQuerier, 149 | wasmQueryReceiver, 150 | link, 151 | ics20, 152 | channelIds, 153 | }; 154 | } 155 | 156 | test.serial("query remote chain", async (t) => { 157 | const { osmoClient, wasmClient, wasmQuerier, link, channelIds, wasmQueryReceiver } = await demoSetup(); 158 | 159 | // Use IBC queries to query info from the remote contract 160 | const ibcQuery = await wasmClient.sign.execute( 161 | wasmClient.senderAddress, 162 | wasmQuerier, 163 | { 164 | ibc_query: { 165 | channel_id: channelIds.wasm, 166 | msgs: [ 167 | { 168 | bank: { 169 | all_balances: { 170 | address: osmoClient.senderAddress, 171 | }, 172 | }, 173 | }, 174 | ], 175 | callback: wasmQueryReceiver, 176 | }, 177 | }, 178 | "auto" 179 | ); 180 | console.log(ibcQuery); 181 | 182 | // relay this over 183 | const info = await link.relayAll(); 184 | console.log(info); 185 | console.log(fromUtf8(info.acksFromB[0].acknowledgement)); 186 | 187 | const result = await wasmClient.sign.queryContractSmart(wasmQueryReceiver, { 188 | latest_query_result: { 189 | channel_id: channelIds.wasm, 190 | }, 191 | }); 192 | 193 | console.log(result); 194 | console.log(fromUtf8(fromBase64(result.response.acknowledgement.data))); 195 | t.truthy(result); 196 | }); 197 | -------------------------------------------------------------------------------- /tests/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { readFileSync } from "fs"; 2 | 3 | import { AckWithMetadata, CosmWasmSigner, RelayInfo, testutils } from "@confio/relayer"; 4 | import { fromBase64, fromUtf8 } from "@cosmjs/encoding"; 5 | import { assert } from "@cosmjs/utils"; 6 | 7 | const { fundAccount, generateMnemonic, osmosis: oldOsmo, signingCosmWasmClient, wasmd } = testutils; 8 | 9 | const osmosis = { ...oldOsmo, minFee: "0.025uosmo" }; 10 | 11 | export const IbcVersion = "simple-ica-v1"; 12 | 13 | export async function setupContracts( 14 | cosmwasm: CosmWasmSigner, 15 | contracts: Record 16 | ): Promise> { 17 | const results: Record = {}; 18 | 19 | for (const name in contracts) { 20 | const path = contracts[name]; 21 | console.info(`Storing ${name} from ${path}...`); 22 | const wasm = await readFileSync(path); 23 | const receipt = await cosmwasm.sign.upload(cosmwasm.senderAddress, wasm, "auto", `Upload ${name}`); 24 | console.debug(`Upload ${name} with CodeID: ${receipt.codeId}`); 25 | results[name] = receipt.codeId; 26 | } 27 | 28 | return results; 29 | } 30 | 31 | // This creates a client for the CosmWasm chain, that can interact with contracts 32 | export async function setupWasmClient(): Promise { 33 | // create apps and fund an account 34 | const mnemonic = generateMnemonic(); 35 | const cosmwasm = await signingCosmWasmClient(wasmd, mnemonic); 36 | await fundAccount(wasmd, cosmwasm.senderAddress, "4000000"); 37 | return cosmwasm; 38 | } 39 | 40 | // This creates a client for the CosmWasm chain, that can interact with contracts 41 | export async function setupOsmosisClient(): Promise { 42 | // create apps and fund an account 43 | const mnemonic = generateMnemonic(); 44 | const cosmwasm = await signingCosmWasmClient(osmosis, mnemonic); 45 | await fundAccount(osmosis, cosmwasm.senderAddress, "4000000"); 46 | return cosmwasm; 47 | } 48 | 49 | // throws error if not all are success 50 | export function assertAckSuccess(acks: AckWithMetadata[]) { 51 | for (const ack of acks) { 52 | const parsed = JSON.parse(fromUtf8(ack.acknowledgement)); 53 | if (parsed.error) { 54 | throw new Error(`Unexpected error in ack: ${parsed.error}`); 55 | } 56 | console.log(parsed); 57 | if (!parsed.result) { 58 | throw new Error(`Ack result unexpectedly empty`); 59 | } 60 | } 61 | } 62 | 63 | // throws error if not all are errors 64 | export function assertAckErrors(acks: AckWithMetadata[]) { 65 | for (const ack of acks) { 66 | const parsed = JSON.parse(fromUtf8(ack.acknowledgement)); 67 | if (parsed.result) { 68 | throw new Error(`Ack result unexpectedly set`); 69 | } 70 | if (!parsed.error) { 71 | throw new Error(`Ack error unexpectedly empty`); 72 | } 73 | } 74 | } 75 | 76 | export function assertPacketsFromA(relay: RelayInfo, count: number, success: boolean) { 77 | if (relay.packetsFromA !== count) { 78 | throw new Error(`Expected ${count} packets, got ${relay.packetsFromA}`); 79 | } 80 | if (relay.acksFromB.length !== count) { 81 | throw new Error(`Expected ${count} acks, got ${relay.acksFromB.length}`); 82 | } 83 | if (success) { 84 | assertAckSuccess(relay.acksFromB); 85 | } else { 86 | assertAckErrors(relay.acksFromB); 87 | } 88 | } 89 | 90 | export function assertPacketsFromB(relay: RelayInfo, count: number, success: boolean) { 91 | if (relay.packetsFromB !== count) { 92 | throw new Error(`Expected ${count} packets, got ${relay.packetsFromB}`); 93 | } 94 | if (relay.acksFromA.length !== count) { 95 | throw new Error(`Expected ${count} acks, got ${relay.acksFromA.length}`); 96 | } 97 | if (success) { 98 | assertAckSuccess(relay.acksFromA); 99 | } else { 100 | assertAckErrors(relay.acksFromA); 101 | } 102 | } 103 | 104 | export function parseAcknowledgementSuccess(ack: AckWithMetadata): unknown { 105 | const response = JSON.parse(fromUtf8(ack.acknowledgement)); 106 | assert(response.result); 107 | return JSON.parse(fromUtf8(fromBase64(response.result))); 108 | } 109 | -------------------------------------------------------------------------------- /tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": ["es2020"], 6 | "moduleResolution": "node", 7 | "incremental": true, 8 | "tsBuildInfoFile": "build/.tsbuildinfo", 9 | "inlineSourceMap": true, 10 | "declaration": true, 11 | "outDir": "build", 12 | "rootDir": "src", 13 | "strict": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noUnusedLocals": true, 17 | "noUnusedParameters": true, 18 | "esModuleInterop": true, 19 | "resolveJsonModule": true, 20 | "pretty": true, 21 | }, 22 | "include": ["src/**/*.ts"] 23 | } 24 | --------------------------------------------------------------------------------