# ICA general notes Some notes about ICA ## Links * https://github.com/cosmos/interchain-accounts-demo#sending-interchain-account-transactions * https://ibc.cosmos.network/main/apps/interchain-accounts/active-channels.html * https://tutorials.cosmos.network/academy/4-ibc/ica.html * https://github.com/cosmos/ibc/blob/main/spec/app/ics-027-interchain-accounts/README.md * http://144.91.127.5:1318/ibc/core/channel/v1/channels?pagination.limit=200 ## Query ICA events in the channels ``` bcnad query ica host packet-events Error: accepts 2 arg(s), received 0 Usage: bcnad query interchain-accounts host packet-events [channel-id] [sequence] [flags] Examples: bcnad query interchain-accounts host packet-events channel-0 100 ``` # ICA Staking As you can see there are 4 addresses linked to ICA in the host * `deposit_address":"cosmos1...yv8" - "port_name": "icacontroller-fauxgaia-1.deposit",` * `"withdrawal_address":cosmos13..8" - "port_name": "icacontroller-fauxgaia-1.withdrawal",` * ` "performance_address":cosmos1p...r" - "port_name": "icacontroller-fauxgaia-1.performance",` * Delegator: one port by address: `"port_name": "icacontroller-fauxgaia-1.delegate.xx",` ``` "delegation_addresses": [ { "address": "cosmos10pa3yyqtkykkyncga9fefj02njtlt9xl4srqfsdup5mqlquygjgsh8wp05", "balance": [], "port_name": "icacontroller-fauxgaia-1.delegate.17", "withdrawal_address": "cosmos1p4fyv5hmhq07pxth2dkl3qayya0d0u8uq5rz3jp45u8uaawfc0wqx2wk8f", "balance_waitgroup": 35 }, { .....} ``` ## See the zones at Controller `quicksilverd query interchainstaking zones -o json|jq` It shows: ``` quicksilverd query interchainstaking zones -o json|jq |more { "zones": [ { "connection_id": "connection-0", "chain_id": "fauxgaia-1", "deposit_address": { "address": "cosmos15hmf7r6qehz7yt6yq97mn7e3janu8ejcyxa4qqy0s7gatree4mnshwqyv8", "balance": [ { "denom": "umuon", "amount": "22" } ], "port_name": "icacontroller-fauxgaia-1.deposit", "withdrawal_address": "cosmos15hmf7r6qehz7yt6yq97mn7e3janu8ejcyxa4qqy0s7gatree4mnshwqyv8", "balance_waitgroup": 0 }, "withdrawal_address": { "address": "cosmos1p4fyv5hmhq07pxth2dkl3qayya0d0u8uq5rz3jp45u8uaawfc0wqx2wk8f", "balance": [], "port_name": "icacontroller-fauxgaia-1.withdrawal", "withdrawal_address": "cosmos1p4fyv5hmhq07pxth2dkl3qayya0d0u8uq5rz3jp45u8uaawfc0wqx2wk8f", "balance_waitgroup": 0 }, "performance_address": { "address": "cosmos169xdt9kdad9726ukd5dp5l2mc02d4sf5sz5jxfk2vg2vskjh70yqen3jgh", "balance": [], "port_name": "icacontroller-fauxgaia-1.performance", "withdrawal_address": "cosmos169xdt9kdad9726ukd5dp5l2mc02d4sf5sz5jxfk2vg2vskjh70yqen3jgh", "balance_waitgroup": 0 }, "delegation_addresses": [ { "address": "cosmos10pa3yyqtkykkyncga9fefj02njtlt9xl4srqfsdup5mqlquygjgsh8wp05", "balance": [], "port_name": "icacontroller-fauxgaia-1.delegate.17", "withdrawal_address": "cosmos1p4fyv5hmhq07pxth2dkl3qayya0d0u8uq5rz3jp45u8uaawfc0wqx2wk8f", "balance_waitgroup": 35 }, { "address": "cosmos10ru9n4jsmxj3j64t3spurw7tf7n5c5tt6g40ygm3zkmgjcm69qns39zlyz", "balance": [], "port_name": "icacontroller-fauxgaia-1.delegate.20", "withdrawal_address": "cosmos1p4fyv5hmhq07pxth2dkl3qayya0d0u8uq5rz3jp45u8uaawfc0wqx2wk8f", "balance_waitgroup": 22 }, ``` ## Query intent ``` quicksilverd query interchainstaking intent fauxgaia-1 cosmos10pa3yyqtkykkyncga9fefj02njtlt9xl4srqfsdup5mqlquygjgsh8wp05 ```` ## Replies: ``` intent: delegator: cosmos10pa3yyqtkykkyncga9fefj02njtlt9xl4srqfsdup5mqlquygjgsh8wp05 intents: [] ``` ## HOST CHAIN: Query actions ``` bcnad query interchain-accounts host packet-events channel-0 100 ``` # Config the ICA-relayer ICA needs a special go relayer 1) First install/download/compile the special go-relayer: `interchain-queries` * this is the config file: `.ics/config.yaml` ``` default_chain: innuendo-3 chains: innuendo-3: key: default chain-id: innuendo-3 rpc-addr: http://144.91.127.5:36657 grpc-addr: http://144.91.127.5:9093 account-prefix: quick keyring-backend: test gas-adjustment: 1.8 gas-prices: 0.001uqck min-gas-amount: 0 key-directory: /home/raul/.icq/keys debug: false timeout: 20s output-format: json sign-mode: direct bitcanna-dev-5: key: default chain-id: bitcanna-dev-5 rpc-addr: http://localhost:26657 grpc-addr: http://localhost:9090 account-prefix: bcna keyring-backend: test gas-adjustment: 1.2 gas-prices: 0.001ubcna min-gas-amount: 0 key-directory: /home/raul/.icq/keys debug: false timeout: 20s output-format: json sign-mode: direct ``` 2) Add the accounts for each chain & fund them ``` interchain-queries keys add --chain bitcanna {"mnemonic":"unknown pistol hint tilt slide rent mirror concert olympic element imitate jealous ten foot police bacon salad evidence hen ticket tumble cement unlock gain", "address":"bcna1wjaspe3mk3z0v7n3y35wk7fazxvf403djnws7t"} raul@devnet-5:~$ interchain-queries keys add --chain innuendo {"mnemonic":"hello sail crane water inject company plastic illegal panic grocery advance disease wrong there want enrich visual absorb science fog update rib spread old", "address":"quick16kylyg6rnmtqc0q34j5f2pkjfmr8sdlh2mer4d"} ``` 3) Run it: `interchain-queries run` You can run as service too: ``` cd $HOME echo "[Unit] Description=ICA-relayer Node After=network-online.target [Service] User=${USER} ExecStart=$(which interchain-queries) run Restart=always RestartSec=3 LimitNOFILE=4096 [Install] WantedBy=multi-user.target " >interchain-queries.service ``` Enable it, Start it, check it `sudo journalctl -fu interchain-queries` ###### tags: `ica`