IBC Relaying with Go Relayer

Learn how to run the Go relayer to create a transfer channel between any Cosmos chain and Secret Network.

Overview

The Go relayer is a relayer implementation written in Golang. It can create clients, connections, and channels, as well as relay packets and update and upgrade clients.

In order to use Secret Network's IBC Developer Toolkit, you need an IBC transfer channel established between Secret Network and your Cosmos chain.

In this section, you will learn:

  • How to get started with the Go relayer.

  • Basic Go relayer commands.

  • How to create a transfer channel between Secret Network testnet and Neutron testnet.

Let's get started! πŸš€

Installing Go Relayer

Clone the Go relayer repository:

git clone https://github.com/cosmos/relayer.git

Install Go:

brew install go

Set Go path:

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Build the Go relayer:

If you run into any errors during installation, you can install without make like so:

To check that the installation was successful, run:

Which returns:

Configuring Go Relayer

The configuration data is added to the config file, stored at $HOME/.relayer/config/config.yaml by default.

If this is the first time you run the relayer, first initialize the config with the following command:

And check the config with:

Now you are all set to add the chains and paths you want to relay on, add your keys and start relaying. You will set up two testnet chains: Neutron's pion-1 and Secret Network's pulsar-3.

Add chain configs

The rly chains add command fetches chain metadata from the chain registry and adds it to your config file:

rly chains add will check the liveliness of the available RPC endpoints for that chain in the chain registry. The command may fail if none of these RPC endpoints are available. In this case, you will want to manually add the chain config.

Create wallet keys

Create new keys for the relayer to use when signing and relaying transactions:

Query your key balances:

You can fund your Secret Network testnet wallet here and your Neutron testnet wallet here πŸŽ‰

Then, edit the relayer's key values in the config file to match the key-names chosen above.

The configuration data is added to the config file, stored at $HOME/.relayer/config/config.yaml:

You can unveil hidden folders on mac (ie ./relayer) with keyboard shortcut : Command + Shift + .

Configure path metadata in the config file

You configured the chain metadata, now you need path metadata.

Update your config file like so to use a configuration path that has been tested in production:

Create a relayer path:

Check Configuration Status

Before starting to relay and after making some changes to the config, you can check the status of the chains in the config:

Which returns this output when healthy:

And you can check the status of the paths in the config:

In case one of the checks receives a ✘ instead of βœ”, you will need to check if you completed all the previous steps correctly.

Starting the Relayer

Finally, start the relayer on the desired path. The relayer will periodically update the clients and listen for IBC messages to relay:

Congrats! You are now relaying between Secret Network testnet and Neutron testnet! πŸŽ‰

Further reading:

Last updated

Was this helpful?