# configure gaiad so that there is relevant chain info in two different directories:
gaiad config chain-id test-1
gaiad config node http://165.22.23.73:26657
gaiad config keyring-backend test
gaiad config chain-id test-2 --home ~/.gaiad2
gaiad config node http://164.90.226.126:26657 --home ~/.gaiad2
gaiad config keyring-backend test --home ~/.gaiad2
# Create account on `test-1` (aka a)
> gaiad keys add demo
# Show account on `test-1` (aka a)
> gaiad keys show demo | jq
{
"name": "demo",
"type": "local",
"address": "cosmos1xpgnzjhz650pljhk7f8szu5rjzfj6e2rw8jl3m",
"pubkey": "{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"AxEVQMM3ZbWgnTRYcY/i0RmQ99+RTfx7JmjFHr659wF1\"}"
}
# Show balance of the account that was populated by Billy with `demowallet`
> gaiad q bank balances $(gaiad keys show demo -a) | jq
{
"balances": [
{
"denom": "stake",
"amount": "1000"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# Create ICA account on `test-2` via `test-1`
> gaiad tx icamsgauth register --from demo --connection-id connection-0 --counterparty-connection-id connection-0 --gas 150000
# Show the account on `test-2` (AKA a')
> gaiad q icamsgauth interchainaccounts $(gaiad keys show demo -a) connection-0 connection-0 | jq
{
"interchain_account_address": "cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6"
}
# Show the balance of `a'` on `test-2` that was populated by Billy with `demowallet`
> gaiad q bank balances cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 --home ~/.gaiad2 | jq
{
"balances": [
{
"denom": "stake",
"amount": "1000"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# Create empty account on `test-2`
> gaiad keys add demo --home ~/.gaiad2 --keyring-backend test
> gaiad keys show demo --home ~/.gaiad2 | jq
{
"name": "demo",
"type": "local",
"address": "cosmos1734fsdjhy7unndu2dlks4zfgvzh0x629thq8kt",
"pubkey": "{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"A3gopqMAvispe6h/j26+W3vQ7OgbTlxroVHiYvKCcLeN\"}"
}
# Show the empty account on `test-2` is empty
> gaiad q bank balances $(gaiad keys show demo -a --home ~/.gaiad2) --home ~/.gaiad2 | jq
{
"balances": [],
"pagination": {
"next_key": null,
"total": "0"
}
}
# Create the raw send msg for `test-2` to be passed to the ica account on `test-1`
> gaiad tx bank send cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 cosmos1734fsdjhy7unndu2dlks4zfgvzh0x629thq8kt 500stake --from cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 --home ~/.gaiad2 --generate-only | jq '.body.messages[0]' > send-raw.json
# Show the message
> cat send-raw.json
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from_address": "cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6",
"to_address": "cosmos1734fsdjhy7unndu2dlks4zfgvzh0x629thq8kt",
"amount": [
{
"denom": "stake",
"amount": "500"
}
]
}
> gaiad tx icamsgauth submit-tx send-raw.json --connection-id connection-0 --counterparty-connection-id connection-0 --from demo -y | jq
{
"height": "0",
"txhash": "5640F02D1D3003AE8878C2EC8C4DAB220551909C613C9615D4F932F4E2485AC3",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
# Show that the token was moved between the account:
> gaiad q bank balances $(gaiad keys show demo -a --home ~/.gaiad2) --home ~/.gaiad2 | jq
{
"balances": [
{
"denom": "stake",
"amount": "500"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# TASK ONE IS COMPLETE
# Send the tokens back to the interchain account
> gaiad tx bank send $(gaiad keys show demo -a --home ~/.gaiad2) cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 500stake --from demo --home ~/.gaiad2 -y | jq
{
"height": "0",
"txhash": "3710C5A023490329A90468CAF60A7F2A30F36E86576658EB22F6179A937D776A",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
# Query the balance of the interchain account to show the stake went back
> gaiad q bank balances cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 --home ~/.gaiad2 | jq
{
"balances": [
{
"denom": "stake",
"amount": "1000"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# TASK TWO IS COMPLETE
# A new channel needs to be opened between the chains to start using ibc-transfer. This is done with the relayer as follows:
hermes --config ./gaia-config.toml create channel --port-a transfer --port-b transfer test-1 test-2 -v ics20-1
# NOTE: I was unable to use --connection-a connection-0 and re-use the initial connection. Is that expected behaviour? Instead a new connection was created with port_id `transfer` and `channel_id` `channel-5` (same on both sides)
# Account on `test-1` to send `stake` to PK controlled account on `test-2`
> gaiad tx ibc-transfer transfer transfer channel-5 $(gaiad keys show demo -a --home ~/.gaiad2) 100stake --from demo -y | jq
{
"height": "0",
"txhash": "BDECF458321A5163E5C7A2F2EBE1548A982A525B1C49159E2CAEF2DB789BBC9E",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
# Apparently this failed. Hermes had an error about account number mismatch. I restarted the relayer and the tokens were returned, my guess is because the timeout occured. After the restart I tried again and this time it worked.
> gaiad tx ibc-transfer transfer transfer channel-5 $(gaiad keys show demo -a --home ~/.gaiad2) 100stake --from demo -y | jq
{
"height": "0",
"txhash": "79B2A1B916793ECD7BD39147A32E72ED6B35040C40D3098852A1CBE5A167C9C9",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
> gaiad q bank balances $(gaiad keys show demo -a --home ~/.gaiad2) --home ~/.gaiad2 | jq
{
"balances": [
{
"denom": "ibc/E37052AA15C33306A29C10EC2EF99E6681FF485550D8BFCBA059F82A809B2623",
"amount": "100"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# TASK 3 IS COMPLETE
# Send the IBC token from the `A` account to `a'`
> gaiad tx bank send $(gaiad keys show demo -a --home ~/.gaiad2) cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 100ibc/E37052AA15C33306A29C10EC2EF99E6681FF485550D8BFCBA059F82A809B2623 --from demo --home ~/.gaiad2 -y | jq
{
"height": "0",
"txhash": "4D41351A2AEED8F2B37306D79AB34663D0B26BE2DD667F06251EBD115B302C72",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
# Query the balance of the interchain account
> gaiad q bank balances cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 --home ~/.gaiad2 | jq
{
"balances": [
{
"denom": "ibc/E37052AA15C33306A29C10EC2EF99E6681FF485550D8BFCBA059F82A809B2623",
"amount": "100"
},
{
"denom": "stake",
"amount": "1000"
}
],
"pagination": {
"next_key": null,
"total": "0"
}
}
# TASK 4 IS COMPLETE
# Create the outgoing IBC transaction that sends the IBC token back to the origin chain from the interchain account.
F99E6681FF485550D8BFCBA059F82A809B2623 --from cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6 --generate-only | jq '.body.messages[0]' > ibc-raw.json
> cat ibc-raw.json
{
"@type": "/ibc.applications.transfer.v1.MsgTransfer",
"source_port": "transfer",
"source_channel": "channel-5",
"token": {
"denom": "ibc/E37052AA15C33306A29C10EC2EF99E6681FF485550D8BFCBA059F82A809B2623",
"amount": "100"
},
"sender": "cosmos1zg52ngxx95tznc4mqn6spvue25q2msgpatzw2925d0ar9vgk6u3s6qszr6",
"receiver": "cosmos1xpgnzjhz650pljhk7f8szu5rjzfj6e2rw8jl3m",
"timeout_height": {
"revision_number": "2",
"revision_height": "13371"
},
"timeout_timestamp": "1640193459068597000"
}
# Create the ICA transaction including the evenual IBC trasfer message
> gaiad tx icamsgauth submit-tx ibc-raw.json --connection-id connection-0 --counterparty-connection-id connection
-0 --from demo -y | jq
{
"height": "0",
"txhash": "0230BD16B8F803C77EE2B773EE987443838DD247CB58601AAE1FE0DDE5EDB8D3",
"codespace": "",
"code": 0,
"data": "",
"raw_log": "[]",
"logs": [],
"info": "",
"gas_wanted": "0",
"gas_used": "0",
"tx": null,
"timestamp": "",
"events": []
}
# HOWEVER, this will fail becauas ibc-transfer messages WERE NOT WHITELISTED in our host chain ica-module genesis as a parameter. Only the delegate and send messages were whitelisted at this point. OOPS!!!
https://res.cloudinary.com/stargaze/image/upload/w_700/b5ij1wrgjzmzcivljffz.jpg
Jul 15, 2023Begin by writing out the proposal description in markdown. Confirm that it's under the charlimit (5k until Theta and 10k after). Then generate the proposal with --offline so that it is not signed but the json is created. Pipe it into a file like unsigned.json. You can leave the description empty or with dummy text here because the CLI will try to escape the chars but likely not the way you want. > gaiad tx gov submit-proposal software-upgrade v7-Theta \ --title v7-Theta \ --deposit 50000uatom \ --upgrade-height 10085397 \ --upgrade-info '{"binaries":{"linux/amd64":"https://github.com/cosmos/gaia/releases/download/v7.0.0/gaiad-v7.0.0-linux-amd64?checksum=sha256:dc0e5b6690a55f0f1c41ad96f068049e25d9e85d53c0587284b7f1a1f9a51545","linux/arm64":"https://github.com/cosmos/gaia/releases/download/v7.0.0/gaiad-v7.0.0-linux-arm64?checksum=sha256:994f67ec8134504ae032a1ae58caf769b5a9a1581a38705efd94ab654a7f6173","darwin/amd64":"https://github.com/cosmos/gaia/releases/download/v7.0.0/gaiad-v7.0.0-darwin-amd64?checksum=sha256:2b7425b27e1c04877f0e9230f1657bee1b3274b73bee8f550a290cc505444dbf","windows/amd64":"https://github.com/cosmos/gaia/releases/download/v7.0.0/gaiad-v7.0.0-windows-amd64.exe?checksum=sha256:1362b026e942cc16ab2b7f35a3ff39fb9075dcde70570635485d4b1866e1d036"}}' \ --description "#test\r\n\r##test" \
May 1, 2022for vega-upgrade gaiad tx gov submit-proposal software-upgrade Vega \ --title Vega \ --deposit 500000uatom \ --upgrade-height 8695000 \ --upgrade-info '{"binaries":{"linux/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0/gaiad-v6.0.0-linux-amd64?checksum=sha256:d9b4391065a338107ca240f29539d62572fe1e85a6c455576afc5e93dba7f402","linux/arm64":"https://github.com/cosmos/gaia/releases/download/v6.0.0/gaiad-v6.0.0-linux-arm64?checksum=sha256:e348259fb9ca5d516a8754ea1f15255ef32e7656e79d52a87616edb16f0a7343","darwin/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0/gaiad-v6.0.0-darwin-amd64?checksum=sha256:e0de182c098ab68d3ef4bab8a3d12aca100b9f1d18d873d66e82ec2c187a1735","windows/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0/gaiad-v6.0.0-windows-amd64.exe?checksum=sha256:713cb6c1a7ef555d5ed64f036f65b039b44b76f314855e2f7d2a5330568e6100"}}' \ --description "This on-chain upgrade governance proposal is to adopt gaia v6.0.0 which includes a number of updates, fixes and new modules. By voting YES to this proposal, you approve of adding these updates to the Cosmos Hub.\n\n### Background\n\nSince the last upgrade at height 6910000 there have been a number of updates, fixes and new modules added to the Cosmos SDK, IBC and Tendermint. The following updates are included in gaia v6.0.0:\n * Bump [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk) to [v0.44.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.3) which notably includes fixes for the vesting accounts and two new modules outlined below. For a full list of updates in Cosmos-SDK v0.44.3 please see the [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.44.x/CHANGELOG.md#v0443---2021-10-21)\n * Add the [authz](https://github.com/cosmos/cosmos-sdk/tree/v0.44.3/x/authz/spec) module to the Cosmos Hub. `x/authz` is an implementation of a Cosmos SDK module, per [ADR 30](https://github.com/cosmos/cosmos-sdk/blob/v0.44.3/docs/architecture/adr-030-authz-module.md), that allows granting arbitrary privileges from one account (the granter) to another account (the grantee). Authorizations must be granted for a particular Msg service method one by one using an implementation of the `Authorization` interface.\n * Add the [feegrant](https://github.com/cosmos/cosmos-sdk/tree/v0.44.3/x/feegrant/spec) module to the Cosmos Hub. This module allows accounts to grant fee allowances and to use fees from their accounts. Grantees can execute any transaction without the need to maintain sufficient fees.\n * **NOTICE** It's imortant to highlight [PR #10041](https://github.com/cosmos/cosmos-sdk/pull/10041) which impacts **WALLETS AND EXCHANGES**. This update has removed the deprecated the legacy REST endpoints for broadcast & encode. **This means `POST /tx` and `POST /txs/encode` no longer work**. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/master/migrations/rest.html) to migrate to the new REST endpoints.\n * Add [IBC](https://github.com/cosmos/ibc-go) as a standalone module from the Cosmos SDK using version [v2.0.0](https://github.com/cosmos/ibc-go/releases/tag/v2.0.0). See the [CHANGELOG.md](https://github.com/cosmos/ibc-go/blob/v2.0.0/CHANGELOG.md) for details.\n * Please note that the governance parameter for `MaxExpectedBlockDelay` is set to 30 seconds. This means if a connection is opened with a packet delay of 1 minute, it requires 2 blocks to be committed after the consensus state is submitted before the packet can be processed.\n * Add [packet-forward-middleware](https://github.com/strangelove-ventures/packet-forward-middleware) [v1.0.1](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v1.0.1) as per [Proposal #56](https://www.mintscan.io/cosmos/proposals/56) prepared and tested by [Strangelove Ventures](https://www.strangelove.ventures/). This feature allows multi-hop IBC transfer messages so that a user can send tokens from chain A to chain C via chain B.\n * Bump [Liquidity](https://github.com/gravity-devs/liquidity) module to [v1.4.2](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.2) to ensure compatibility with Cosmos-SDK.\n\n### Ready for Production\n\nThese changes have been extensively tested by various Cosmos Core Contributor teams including [Hypha Co-Op](https://hypha.coop/), [Informal Systems Co-Op](https://informal.systems/), [Interchain GmbH](https://interchain.berlin/), [Regen Network](https://regen.network/), [Strangelove Ventures](https://strangelove.ventures/), [Tendermint Inc](https://tendermint.com/) and more. The release candidate for this update was run as a local testnet and a public testnet with a successful upgrade; documentation can be found [here](https://github.com/cosmos/vega-test).\n\n### On-Chain Upgrade Process\n\nWhen the network reaches the halt height, the state machine program of the Cosmos Hub will be halted. The classic method for upgrading requires all validators and node operators to manually substitute the existing state machine binary with the new binary. There is also a newer method that relies on [Cosmovisor](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor) to swap the binaries automatically. Cosmovisor also includes the ability to download the binaries automatically before swapping them. Instructions specific to the upgrade can be found [here](https://github.com/cosmos/gaia/blob/main/docs/gaia-tutorials/upgrade-node.md). To test a simulated local upgrade please see the [local testnet documentation](https://github.com/cosmos/vega-test/blob/master/local-testnet/README.md). Because it is an onchain upgrade process, the blockchain will be continued with all the accumulated history with continuous block height.\n" \ --fees 300uatom \ --gas auto \ --from deploy \
Mar 16, 2022This is the script that needs to be run on both servers, except the chain id needs to be changed on the second server Introduction Alice is on chain test-1 and has 100 tokens bob is on chain test-2 does not have any token. alice knows an faucet user on chain test-2, so she can sometimes ask faucet user to send her some tokens. now, alice wants to send some native token of chain test-2 to bob.
Jan 25, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up