IBC Relaying Guide
Last updated
Last updated
CosVM uses (Inter-Blockchain Communication protocol) to enable cross-chain transfer of tokens. To support this capability it relies on relayers, processes that can be run by anyone which constantly scan for outbound packets on one chain and submits these packets alongside corresponding proofs on the destination chain. This section describes how one can setup a relayer and create new connections between chains. There are two standard implementations:
built in Rust
built in Go
The following guide explains how to establish IBC connections and relay packets between and networks by using the Hermes relayer.
Check the for the version of ibc-go that is currently used.
is an open-source Rust implementation of an IBC relayer released as part of the ibc-relayer-cli
crate. It includes a CLI for relaying packets between Cosmos SDK chains, as well as Prometheus metrics and a REST API.
Please follow the steps at to install Hermes. Before proceeding, verify that Hermes is installed correctly by running hermes version
.
TIP
Hermes currently doesn't support configuring the Tendermint CompatMode
in chain config (see ). Until that issue is resolved, please use Hermes + because it falls back to Tendermint CompatMode
v0.34 (see ) which is compatible with CosVM.
After you have successfully installed Hermes and created the necessary folders, you now have to edit config.toml
and add the appropriate configurations for the chains you want to relay between.
For this tutorial, we will be using the following chains:
Edit the Hermes configuration.
bash
toml
Now that we have successfully configured our relaying chains, we need to import the wallets that will be used for relaying. Please note that both wallets need to be funded with the native tokens of each chain.
You can get testnet tokens from faucets for bot testnets via Discord:
Add your seed phrase to a file and upload it to the server. Do not use wallets for anything else but relaying to avoid running into account sequence errors.
bash
After editing config.toml
and adding wallet keys, itβs time to test the configurations and ensure the system is healthy. Run the following:
bash
If everything was set up correctly, you should see output like:
bash
In this example, we are creating new clients and a new connection between mocha-4
and theta-testnet-001
networks.
To learn if a client already exists, you can use the following command:
bash
bash
Create a second client:
bash
To create a new connection over clients, use the following command:
bash
You should be seeing a similar output to this:
bash
Now that the connection has been established over the clients, we need to create a new channel, by leveraging an existing connection:
bash
You should be seeing a similar output to this:
bash
Congratulations!
You have successfully created a new IBC connection between two networks.
Now that we have created new connections and opened channels, we need to edit config.toml
again and add the newly created channels, or use the already existing ones.
For mocha-4
add:
bash
For theta-testnet-001
add:
bash
The CosVM state machine is built with the IBC transfer module, allowing for the native CosVM token to be transferred to any other IBC enabled chain. Transfer can be initialized through the cvmd
CLI. Information can be found via the help label as follows:
bash
The transfer module uses a token filter middleware which serves to prevent non-native CosVM tokens from being on CosVM. If a user is to try to send a token from another chain across, it will be simply rejected and the token returned back to the user.
COSVM: osvmlabc
Cosmos Hub:
Follow the steps at to add keys for each chain
If youβre attempting to create new connections, verify that the chains in question donβt already have connections and clients in place and use the existing ones if they do. In that case you can skip this step and go to section.
To create a new client, use the :
Start the relayer via