This gist contains notes from testing IBC between a Celestia testnet (mocha-4) and Cosmos Hub testnet (theta-testnet-001). It was motivated by GH issue: celestiaorg/celestia-app#195
- Celestia (
mocha-4
): https://github.com/cosmos/chain-registry/blob/master/testnets/celestiatestnet3/chain.json - Cosmos Hub (
theta-testnet-001
): https://github.com/cosmos/chain-registry/blob/master/testnets/cosmoshubtestnet/chain.json - Osmosis (
osmo-test-5
): https://github.com/cosmos/chain-registry/blob/master/testnets/osmosistestnet/chain.json
- Install Hermes
- Configure Hermes with config.toml
- Create wallets on all the testnets that you're interested in testing. Get them funded via faucets.
- celestia-key
- celestia1dsmnzz8qvn343lxq2ew6739sd02gsspyesa4ju
- Faucet: Celestia Discord
- https://testnet.mintscan.io/celestia-testnet/txs/9E356D351562CA712F60F34AFCDE80313753DEE1EC89BD4951A12E26631BE369?height=68907
- cosmos-key
- cosmos1epqzuh6myrwrp4zr8zjamcye4nvkkg9xd8ywak
- Faucet: Cosmos Discort
- https://explorer.theta-testnet.polypore.xyz/transactions/1626AD490480074CC96C6127C4BD8EEB3A6AE15F542D841D55929B05EBDE84B1
- key-osmosis
- osmo1qm2rnvvem9pw2vhmk6rc6jayj679fcwqg9v4ue
- Faucet: https://faucet.testnet.osmosis.zone/
- https://testnet.mintscan.io/osmosis-testnet/account/osmo1qm2rnvvem9pw2vhmk6rc6jayj679fcwqg9v4ue
The following steps will only work for Celestia if you're running a slightly modified Hermes. See https://github.com/rootulp/hermes/tree/rp/tendermint
-
Learn if clients already exist for the chains you are testing. To learn if a client already exists use:
hermes query clients --host-chain mocha-4 --reference-chain theta-testnet-001
-
If clients already exist, you can skip this step. Create a client
$ hermes create client --host-chain mocha-4 --reference-chain theta-testnet-001 2023-09-15T15:15:54.602346Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-15T15:15:54.602777Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf02 2023-09-15T15:15:55.655123Z WARN ThreadId(01) Unsupported tendermint version, will use v0.37 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 SUCCESS CreateClient( CreateClient( Attributes { client_id: ClientId( "07-tendermint-0", ), client_type: Tendermint, consensus_height: Height { revision: 0, height: 1, }, }, ), )
-
Create another client
$ ./target/release/hermes create client --host-chain theta-testnet-001 --reference-chain mocha-4 2023-09-16T19:40:35.845092Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-16T19:40:35.847473Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf0298-dirty 2023-09-16T19:40:36.489807Z WARN ThreadId(01) Unsupported tendermint version, will use v0.34 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 2023-09-16T19:40:44.024678Z TRACE ThreadId(25) send_messages_and_wait_commit{chain=theta-testnet-001 tracking_id=create client}: retrieved 1 tx results after 2149 ms SUCCESS CreateClient( CreateClient( Attributes { client_id: ClientId( "07-tendermint-2382", ), client_type: Tendermint, consensus_height: Height { revision: 4, height: 78057, }, }, ), )
-
Create connections. If you encounter an
out of gas
error, increase the gas-multiplier in config.toml for both chains.2023-09-16T19:50:34.632823Z INFO ThreadId(01) connection handshake already finished for Connection { delay_period: 0ns, a_side: ConnectionSide { chain: BaseChainHandle { chain_id: theta-testnet-001 }, client_id: 07-tendermint-2382, connection_id: connection-2727 }, b_side: ConnectionSide { chain: BaseChainHandle { chain_id: mocha-4 }, client_id: 07-tendermint-0, connection_id: connection-0 } } SUCCESS Connection { delay_period: 0ns, a_side: ConnectionSide { chain: BaseChainHandle { chain_id: ChainId { id: "theta-testnet-001", version: 0, }, runtime_sender: Sender { .. }, }, client_id: ClientId( "07-tendermint-2382", ), connection_id: Some( ConnectionId( "connection-2727", ), ), }, b_side: ConnectionSide { chain: BaseChainHandle { chain_id: ChainId { id: "mocha-4", version: 4, }, runtime_sender: Sender { .. }, }, client_id: ClientId( "07-tendermint-0", ), connection_id: Some( ConnectionId( "connection-0", ), ), }, }
-
Create channel
$ ./target/release/hermes create channel --a-chain theta-testnet-001 --a-connection connection-2727 --a-port transfer --b-port transfer 2023-09-16T19:53:09.813815Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-16T19:53:09.815380Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf0298-dirty 2023-09-16T19:53:11.056847Z WARN ThreadId(01) Unsupported tendermint version, will use v0.34 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 2023-09-16T19:53:15.227950Z INFO ThreadId(01) 🎊 theta-testnet-001 => OpenInitChannel(OpenInit { port_id: transfer, channel_id: channel-3152, connection_id: None, counterparty_port_id: transfer, counterparty_channel_id: None }) at height 0-17936815 2023-09-16T19:53:26.469824Z INFO ThreadId(01) 🎊 mocha-4 => OpenTryChannel(OpenTry { port_id: transfer, channel_id: channel-0, connection_id: connection-0, counterparty_port_id: transfer, counterparty_channel_id: channel-3152 }) at height 4-78122 2023-09-16T19:53:53.057004Z INFO ThreadId(01) 🎊 theta-testnet-001 => OpenAckChannel(OpenAck { port_id: transfer, channel_id: channel-3152, connection_id: connection-2727, counterparty_port_id: transfer, counterparty_channel_id: channel-0 }) at height 0-17936822 2023-09-16T19:54:13.450361Z INFO ThreadId(01) 🎊 mocha-4 => OpenConfirmChannel(OpenConfirm { port_id: transfer, channel_id: channel-0, connection_id: connection-0, counterparty_port_id: transfer, counterparty_channel_id: channel-3152 }) at height 4-78126 2023-09-16T19:54:16.606587Z INFO ThreadId(01) channel handshake already finished for Channel { ordering: ORDER_UNORDERED, a_side: ChannelSide { chain: BaseChainHandle { chain_id: theta-testnet-001 }, client_id: 07-tendermint-2382, connection_id: connection-2727, port_id: transfer, channel_id: channel-3152, version: None }, b_side: ChannelSide { chain: BaseChainHandle { chain_id: mocha-4 }, client_id: 07-tendermint-0, connection_id: connection-0, port_id: transfer, channel_id: channel-0, version: None }, connection_delay: 0ns } SUCCESS Channel { ordering: Unordered, a_side: ChannelSide { chain: BaseChainHandle { chain_id: ChainId { id: "theta-testnet-001", version: 0, }, runtime_sender: Sender { .. }, }, client_id: ClientId( "07-tendermint-2382", ), connection_id: ConnectionId( "connection-2727", ), port_id: PortId( "transfer", ), channel_id: Some( ChannelId( "channel-3152", ), ), version: None, }, b_side: ChannelSide { chain: BaseChainHandle { chain_id: ChainId { id: "mocha-4", version: 4, }, runtime_sender: Sender { .. }, }, client_id: ClientId( "07-tendermint-0", ), connection_id: ConnectionId( "connection-0", ), port_id: PortId( "transfer", ), channel_id: Some( ChannelId( "channel-0", ), ), version: None, }, connection_delay: 0ns, }
-
Verify the network looks good
$ ./target/release/hermes query channels --show-counterparty --chain mocha-4 2023-09-16T19:55:13.236895Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-16T19:55:13.239037Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf0298-dirty 2023-09-16T19:55:13.854914Z WARN ThreadId(01) Unsupported tendermint version, will use v0.34 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 SUCCESS mocha-4: transfer/channel-0 --- theta-testnet-001: transfer/channel-3152
-
Test a cross-chain tranfser
$ ./target/release/hermes tx ft-transfer --timeout-seconds 1000 --dst-chain mocha-4 --src-chain theta-testnet-001 --src-port transfer --src-channel channel-3152 --amount 1 --denom uatom 2023-09-16T19:57:02.194054Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-16T19:57:02.194273Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf0298-dirty 2023-09-16T19:57:03.207201Z WARN ThreadId(01) Unsupported tendermint version, will use v0.34 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 SUCCESS [ IbcEventWithHeight { event: SendPacket( SendPacket { packet: Packet { sequence: Sequence( 1, ), source_port: PortId( "transfer", ), source_channel: ChannelId( "channel-3152", ), destination_port: PortId( "transfer", ), destination_channel: ChannelId( "channel-0", ), data: [123, 34, 97, 109, 111, 117, 110, 116, 34, 58, 34, 49, 34, 44, 34, 100, 101, 110, 111, 109, 34, 58, 34, 117, 97, 116, 111, 109, 34, 44, 34, 114, 101, 99, 101, 105, 118, 101, 114, 34, 58, 34, 99, 101, 108, 101, 115, 116, 105, 97, 49, 100, 115, 109, 110, 122, 122, 56, 113, 118, 110, 51, 52, 51, 108, 120, 113, 50, 101, 119, 54, 55, 51, 57, 115, 100, 48, 50, 103, 115, 115, 112, 121, 101, 115, 97, 52, 106, 117, 34, 44, 34, 115, 101, 110, 100, 101, 114, 34, 58, 34, 99, 111, 115, 109, 111, 115, 49, 101, 112, 113, 122, 117, 104, 54, 109, 121, 114, 119, 114, 112, 52, 122, 114, 56, 122, 106, 97, 109, 99, 121, 101, 52, 110, 118, 107, 107, 103, 57, 120, 100, 56, 121, 119, 97, 107, 34, 125], timeout_height: Never, timeout_timestamp: Timestamp { time: Some( Time( 2023-09-16 20:13:24.499864829, ), ), }, }, }, ), height: Height { revision: 0, height: 17936858, }, }, ]
-
Test a transfer in the other direction
$ ./target/release/hermes tx ft-transfer --timeout-seconds 1000 --src-chain mocha-4 --dst-chain theta-testnet-001 --src-port transfer --src-channel channel-0 --amount 1 --denom utia 2023-09-16T22:05:13.101915Z INFO ThreadId(01) using default configuration from '/Users/rootulp/.hermes/config.toml' 2023-09-16T22:05:13.105082Z INFO ThreadId(01) running Hermes v1.6.0+1c1cf0298-dirty 2023-09-16T22:05:14.272608Z WARN ThreadId(01) Unsupported tendermint version, will use v0.34 compatibility mode but relaying might not work as desired: unsupported Tendermint version reported by the node: 1.0.0-rc14 SUCCESS [ IbcEventWithHeight { event: SendPacket( SendPacket { packet: Packet { sequence: Sequence( 1, ), source_port: PortId( "transfer", ), source_channel: ChannelId( "channel-0", ), destination_port: PortId( "transfer", ), destination_channel: ChannelId( "channel-3152", ), data: [123, 34, 97, 109, 111, 117, 110, 116, 34, 58, 34, 49, 34, 44, 34, 100, 101, 110, 111, 109, 34, 58, 34, 117, 116, 105, 97, 34, 44, 34, 114, 101, 99, 101, 105, 118, 101, 114, 34, 58, 34, 99, 111, 115, 109, 111, 115, 49, 101, 112, 113, 122, 117, 104, 54, 109, 121, 114, 119, 114, 112, 52, 122, 114, 56, 122, 106, 97, 109, 99, 121, 101, 52, 110, 118, 107, 107, 103, 57, 120, 100, 56, 121, 119, 97, 107, 34, 44, 34, 115, 101, 110, 100, 101, 114, 34, 58, 34, 99, 101, 108, 101, 115, 116, 105, 97, 49, 100, 115, 109, 110, 122, 122, 56, 113, 118, 110, 51, 52, 51, 108, 120, 113, 50, 101, 119, 54, 55, 51, 57, 115, 100, 48, 50, 103, 115, 115, 112, 121, 101, 115, 97, 52, 106, 117, 34, 125], timeout_height: Never, timeout_timestamp: Timestamp { time: Some( Time( 2023-09-16 22:21:48.394874025, ), ), }, }, }, ), height: Height { revision: 4, height: 78794, }, }, ]
- https://testnet.mintscan.io/celestia-testnet/txs/C3767DCAA4880DF7CD7A9EAE82CDF02E9A81D516B7548EBF2CDCAC9750C88886?height=78794
- IBC coins should show up here: https://testnet.mintscan.io/cosmoshub-testnet/account/cosmos1epqzuh6myrwrp4zr8zjamcye4nvkkg9xd8ywak sent an email to Mintscan to ask about it.