Relayer

This section contains instructions on how to setup the rust relayer "hermes" and relay IBC packets between bitsong-2b and other IBC-enabled networks.

Relayer Tutorial

Hardware specs:

  • 16+ vCPUs or Intel or AMD 16 core CPU

  • at least 64GB RAM

  • 4TB+ nVME drives

To assist operators in setting up relayers, Bitsong provides tutorials for the following IBC relayers:

Hermes (rust)

https://hermes.informal.systems/

Pre-requisites:

It is recommended to always build binaries on dedicated machine (dev-box), as dev dependencies (rust & go) shouldn't be on your production machine

sudo apt install librust-openssl-dev build-essential git

Setup full nodes & configure seeds, peers and endpoints

To successfully relay IBC packets you need to run private full nodes (custom pruning or archive node) on all networks you want to support. Since relaying-success highly depends on latency and disk-IO-rate it is currently recommended to service these full/archive nodes on the same machine as the relayer process.

Because the relaying process needs to be able to query the chain back in height for at least 2/3 of the unstaking period ("trusting period") it is recommended to use pruning settings that will keep the full chain-state for a longer period of time than the unstaking period:

edit app.toml - note: at an average block time of 6.5sec pruning-keep-recent=400000 will result in a retained chainstate of ~30d. This will suffice for most cosmos-sdk chains with an unstaking period < 30d

hermes needs to be able to query the RPC- and gRPC-endpoints of your nodes, you will need to maintain a well-organized port-setup.

edit app.toml & config.toml, choose a unique port-config for each chain, write down your port-config

app.toml

config.toml - choose unique pprof_laddr port

config.toml - set persistent-peers & seeds for each chain

bitsong-2b seeds:

bitsong-2b persistent-peers:

osmosis-1 seeds:

osmosis-1 persistent-peers:

cosmoshub-4 seeds:

cosmoshub-4 persistent-peers:

please reference https://github.com/cosmos/chain-registry for a maintained list of peers & seeds.

To simplify the config process you can use Environment-Variables in the systemd file: sudo vim /etc/systemd/system/bitsongd.service

Build & setup Hermes

Beware that for security reasons this step should be done 'on some remote pc'

Make the directory where you'll place the source, clone the hermes source repository and build it using the latest release. Optional: copy binary to /usr/bin (or preferred directory for systemd execution)

If you have built your binary on a remote machine, move the binary to your producion environment

Make hermes config & keys directory, copy config-template to config directory:

Check hermes version & config dir setup

Edit hermes config (use ports according to your port config, set filter=true to filter channels you don't relay) vim ~/.hermes/config.toml

Add your relaying-wallets to hermes' keyring (located in $HOME/.hermes/keys)

Best practice is to use the same mnemonic over all networks, do not use your relaying-addresses for anything else because it might lead to mismatched account sequence errors.

You can validate your hermes configuration file:

Create hermes service file:

Refresh service files, enable hermes on system-startup, enable all node-daemons on system-startup, start node-daemons, sync, start hermes.

Tipp: use chainlayer quicksync to bootstrap your nodes faster: https://quicksync.io/networks/osmosis.html

Watch node-daemon output to check if your nodes are syncing:

When your nodes are fully synced you can start the hermes daemon:

Hermes does a chain-health-check at startup. Watch the output to check if all connected nodes are up and synced

Hermes will try & clear any unreceived packets after startup has completed.

Snippets

Query Hermes for unreceived packets & acknowledgements (check if channels are "clear")

Query Hermes for packet commitments:

Clear channel (only works on hermes v0.12.0 and higher)

Clear unreceived packets manually. Experimental: you'll need to stop your hermes daemon for it not to get confused with account sequences.

Thanks to @ccclaimens from @crypto_crew****

Last updated