Setup demonstrates how to setup Hermes relayer and configure it to relay assets between LumenX and Osmosis chains.
Pre-requisites
All steps were executed and tested on:
Create user account
Required packages
Copy sudo apt install make clang pkg-config libssl-dev build-essential git jq llvm libudev-dev -y
Rust installation
Copy curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME /.cargo/env
NOTE: Install Rust as relayer user created earlier
Relayer build & installation
Copy git clone https://github.com/informalsystems/ibc-rs.git && \
cd ibc-rs && \
git checkout v1.3.0 && \
cargo build --release --bin hermes
Copy mkdir -p ${HOME} /.local/bin ; \
cp ${HOME} /ibc-rs/target/release/hermes ${HOME} /.local/bin
Hermes configuration
Create folder for Hermes configuration
Copy mkdir -p ${HOME} /.hermes
Then populate ${HOME}/.hermes/config.toml with following content:
Copy [[chains]]
id = 'osmosis-1'
rpc_addr = 'https://rpc.service.for.osmosis:443'
grpc_addr = 'https://grpc.service.for.osmosis:443'
websocket_addr = 'ws://rpc.service.for.osmosis:443/websocket'
rpc_timeout = '10s'
account_prefix = 'osmo'
key_name = 'osmo'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 3000000
max_gas = 10000000
gas_price = { price = 0.25 , denom = 'uosmo' }
gas_adjustment = 0.1
max_msg_num = 30
max_tx_size = 180000
clock_drift = '15s'
max_block_time = '10s'
trusting_period = '14days'
memo_prefix = ''
trust_threshold = { numerator = '1' , denominator = '3' }
[chains.packet_filter]
policy = 'allow'
list = [
[ 'transfer' , 'channel-286' ] , # LumenX
]
[[chains]]
id = 'LumenX'
rpc_addr = 'http://rpc.service.for.lumenx:26727'
grpc_addr = 'http://rpc.service.for.lumenx:9160'
websocket_addr = 'ws://rpc.service.for.lumenx:26727/websocket'
rpc_timeout = '10s'
account_prefix = 'lumen'
key_name = 'lumen'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 3000000
max_gas = 10000000
gas_price = { price = 0.25 , denom = 'ulumen' }
gas_adjustment = 0.1
max_msg_num = 30
max_tx_size = 180000
clock_drift = '15s'
max_block_time = '10s'
trusting_period = '14days'
memo_prefix = ''
trust_threshold = { numerator = '1' , denominator = '3' }
[chains.packet_filter]
policy = 'allow'
list = [
[ 'transfer' , 'channel-3' ] , # osmosis-1
]
NOTE: Please note that apropriate addresses and ports for RPC, gRPC and WebSocket services must be adjusted accordingly to point to nodes providing those services.
Add relayer keys
Copy hermes-keys add --chain LumenX --mnemonic-file lumenx.txt
hermes-keys add --chain osmosis-1 --mnemonic-file osmosis.txt
NOTE: files lumenx.txt and osmosis.txt contain mnemonic for wallet which will be used for relayer fees. Wallets for relayer must have some amount of coins prior to starting relayer. Otherwise relayer will not be able to relay any transactions
Create and start Hermes service
Service file /etc/systemd/system/hermes.service should have at least following content:
Copy [Unit]
Description = Hermes IBC Relayer
[Service]
User = relayer
Group = relayer
ExecStart = /home/relayer/.local/bin/hermes start
LimitNOFILE = 180000
Restart = always
RestartSec = 3
[Install]
WantedBy = multi-user.target
Copy sudo systemctl daemon-reload && \
sudo systemctl enable hermes && \
sudo systemctl restart hermes