Relayer

This is a tutorial creating an IBC relayer between Nolus Testnet (nolus-rila) and Osmosis Testnet (osmo-test-4)

Hardware Requirements

  • 16+ vCPUs or Intel or AMD 16 core CPU

  • at least 64GB RAM

  • 4TB+ nVME drives

Prerequisites

Before beginning, ensure you have a Nolus full node running in the background. You could relay on the same machine or connect to the Osmosis and Nolus full nodes via a network. You will need build-essential and git installed to follow these instructions.

Osmosis Setup

Download the latest Osmosis binary. Check out https://docs.osmosis.zone/networks/join-testnet for a detailed setup guideline. The currently used version for the osmo-test-4 testnet binary is v14.0.0-rc1.

Running on same machine are not recomended if your machine are not so good πŸ˜„

Instructions

First thing you need to install osmosis! they have a one line installer script or you can install it manually. Go to https://docs.osmosis.zone/networks/join-testnet run osmosis testnet full nodes, add wallet and request some osmo testnet from faucet https://faucet.osmosis.zone/#/ or https://www.allthatnode.com/faucet/osmosis.dsrv

Make sure your nolus full node are fully synced and osmosis full node are fully synced. Then go to the next step.

Hermes

1. Install Rust Dependencies

Since we are relying on a Rust-based implementation, we would need to install some Rust dependencies first:

curl --proto '=https' --tlsv1.2 -sSf <https://sh.rustup.rs> | sh
source "$HOME/.cargo/env"
sudo apt-get install pkg-config libssl-dev
sudo apt install librust-openssl-dev build-essential git

2. Configure Hermes

Create the directory where you'll place the binary, clone the hermes source repository and build it using the latest release:

cargo install ibc-relayer-cli --bin hermes --locked
mkdir -p $HOME/hermes
git clone https://github.com/informalsystems/ibc-rs.git hermes
cd hermes
git checkout v1.2.0

Make a hermes β€œkeys” directory, copy config.toml from the cloned repo to the .hermes directory:

mkdir -p $HOME/.hermes
mkdir -p $HOME/.hermes/keys
cp config.toml $HOME/.hermes

Check if hermes is installed properly by running:

hermes version

Edit the hermes config.toml file by including configurations for the two chains that you want to relay between, namely Nolus Rila testnet and Osmosis testnet:

nano $HOME/.hermes/config.toml

You would need to specify the hermes configurations for your two running nodes. Do not forget to remove the generated by default β€œchains” section with the example at the end of the file:

[[chains]]
id = 'nolus-rila'
rpc_addr = 'http://127.0.0.1:26657'
grpc_addr = 'http://127.0.0.1:9090'
websocket_addr = 'ws://127.0.0.1:26657/websocket'
rpc_timeout = '10s'
account_prefix = 'nolus'
key_name = 'hermes-nolus'
store_prefix = 'ibc'
default_gas = 1000000
max_gas = 4000000
gas_price = { price = 0.0025, denom = 'unls' }
gas_multiplier = 1.1
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }
memo_prefix = 'Relayed by YourNodeName'

[[chains]]
id = 'osmo-test-4'
rpc_addr = 'http://127.0.0.1:26557'
grpc_addr = 'http://127.0.0.1:9091'
websocket_addr = 'ws://127.0.0.1:26557/websocket'
rpc_timeout = '10s'
account_prefix = 'osmo'
key_name = 'hermes-osmosis'
store_prefix = 'ibc'
default_gas = 5000000
max_gas = 15000000
gas_price = { price = 0.0026, denom = 'uosmo' }
gas_multiplier = 1.1
max_msg_num = 20
max_tx_size = 209715
clock_drift = '20s'
max_block_time = '10s'
trusting_period = '10days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }
memo_prefix = 'Relayed by YourNodeName'

Add your relayer wallet to hermes' keyring (located in $HOME/.hermes/keys). The wallet should have a positive balance on both the Nolus and the Osmosis networks since the relayer would need to pay gas fees to submit IBC transactions.

// create a keys
sudo nano .hermes/keys/keys.txt

then enter your wallet phrase word (from a special address for relayer address only)

// example:

plane support power cloud your xxxxx xxxx xxxx xxxx .....

// only the phrase word and a space in between, no need to add other character!

The best practice is to use the same mnemonic over all networks. Do not use your relaying addresses for anything else because it will lead to account sequence errors.

hermes keys add --chain nolus-rila --mnemonic-file <hermes-seed-file>
hermes keys add --chain osmo-test-4 --mnemonic-file <hermes-seed-file>

3. Validate Configuration

Validate your ~/.hermes/config.toml file by running:

hermes config validate

Perform a health check:

hermes health-check

You should see a similar output as the one below:

...
INFO ThreadId(01) [nolus-rila] chain is healthy
INFO ThreadId(01) [osmo-test-4] chain is healthy

4. Run Hermes

If your nodes are fully synced, feel free to start the hermes daemon:

hermes start

Let's test a transaction move balance from nolus chain to osmosis chain via your relayer, use this script:

hermes tx ft-transfer \
--src-chain nolus-rila \
--dst-chain osmo-test-4 \
--src-port transfer \
--src-channel channel-0 \
--key-name YourKeyName \
--receiver YourOsmosisAddress \
--amount 100000 \
--denom unls \
--timeout-seconds 60 \
--timeout-height-offset 180 

then try to move balance from osmosis to nolus

hermes tx ft-transfer \
--src-chain osmo-test-4 \
--dst-chain nolus-rila \
--src-port transfer \
--src-channel channel-1837 \
--key-name YourKeyName \
--receiver YourNolusAddress \
--amount 100000 \
--denom uosmo \
--timeout-seconds 60 \
--timeout-height-offset 180

Change Your_Key with your key and Address_Osomosis_Receiver to your osmosis testnet address.

If it's success, you could see somekind of message like this:

Last updated