Hermes is a Cosmos internetwork relay built on Rust. In simple words, it is a communication protocol between blockchains. The relay is a central element in the IBC network architecture and provides the extraction and collection of information from networks (blockchains) that cannot directly send messages to each other. Read more about Hermes here - https://hermes.informal.systems/index.html
Hermes is not the only implementation of cosmos relays, for example, there are also ibc-go and ts-relayer, but it is Hermes that has gained popularity and is the choice of most norunners This guide will set up a relayer between Teritori Osmosis and Evmos networks
Any relayer can be installed both on 1 server along with the necessary nodes, and on a separate server, while it is not even necessary to raise your own nodes, but it is enough to know the open RPCs of the worker nodes. But since the success of relaying is highly dependent on latency and I/O rate, it is currently recommended to serve hosts on the same machine as the relaying process.
Since the relay process must be able to request the network back in height for at least 2/3 of the unbonding period (trusting period = 2/3 of the unbonding period), it is recommended to use pruning settings that will keep the full state of the chain for a longer period of time, than unbonding period
That is, 14 days from 21 or 10 days from 14 or 1.3 days from 2 days
The required pruning can be calculated using the formula 14 days * 24 * 60 * 60 / average block time
For 14 days pruning-keep-recent = 200000
For 10 days pruning-keep-recent = 150000
For 1.3 days pruning-keep-recent = 18720
For 1.5 hours pruning-keep-recent = 1000
P/s - our pruning will be 1000/0/10 (THIS IS NOT RECOMMENDED) and we will try to trick the system a bit by changing the config as follows:
misbehaviour = false
Polkachu for example uses 40000/2000 for the relayers
In this example, we will use 1 server, on which we will install both the nodes themselves and Hermes First of all, we need:
install the two necessary nodes and fully synchronize them. In this example, install Teritori Osmosis and Evmos
minimum-gas-prices on Osmosis set to 0; on Teritori set to 0.0001
RPCs must be open and accessible by Hermes (how to do this can be found here)
indexing should be set to indexer = "kv" (if not changed, then skip this item)
check the availability of tokens on wallets. It's best to use the same mnemonic on all networks, don't use your relay addresses for anything else, because that could lead to mismatched account sequencing errors
First, let's set the variables. RPC_ADDR is taken from config.toml - GRPC_ADDR is taken from app.toml. The value 127.0.0.1 is replaced by the IP address of the server if Hermes is installed separately from the nodes. The data below is just an example!
Chain_1 (Osmosis)
CHAIN_ID_1="osmosis-1"RPC_ADDR_1="127.0.0.1:46657"GRPC_ADDR_1="127.0.0.1:9290"ACCOUNT_PREFIX_1="osmo"TRUSTING_PERIOD_1="1hours"DENOM_1="uosmo"MNEMONIC_1="way festival bargain mass swear flat fish help dinosaur delay lemon dry another fiber belt year smoke glimpse extra fancy acquire method help universe"
MEMO="lesnik_utsa#4480 (UTSA Relayer)"
Chain_2 (Teritori)
CHAIN_ID_2="teritori-1"RPC_ADDR_2="127.0.0.1:56657"GRPC_ADDR_2="127.0.0.1:9390"ACCOUNT_PREFIX_2="tori"TRUSTING_PERIOD_2="1hours"DENOM_2="utori"MNEMONIC_2="way festival bargain mass swear flat fish help dinosaur delay lemon dry another fiber belt year smoke glimpse extra fancy acquire method help universe"
Chain_3 (Evmos)
CHAIN_ID_3="evmos_9001-2"RPC_ADDR_3="127.0.0.1:60557"GRPC_ADDR_3="127.0.0.1:9490"ACCOUNT_PREFIX_3="evmos"TRUSTING_PERIOD_3="1hours"DENOM_3="aevmos"MNEMONIC_3="way festival bargain mass swear flat fish help dinosaur delay lemon dry another fiber belt year smoke glimpse extra fancy acquire method help universe"
Create a config file This file will use the variables specified above
hermesconfigvalidate# Success: "configuration is valid"hermeshealth-check# INFO ThreadId(01) using default configuration from '/root/.hermes/config.toml'# INFO ThreadId(01) [STRIDE-TESTNET-2] performing health check...# INFO ThreadId(01) chain is healthy chain=STRIDE-TESTNET-2# INFO ThreadId(01) [GAIA] performing health check...# INFO ThreadId(01) chain is healthy chain=GAIA# SUCCESS performed health check for all chains in the config
Adding wallets to Hermes
IMPORTANT - FOR EVM networks add -hd-path "m/44'/60'/0'/0/0"
2022-07-31T14:38:30.273575Z INFO ThreadId(01) Scanned chains:
2022-07-31T14:38:30.273579Z INFO ThreadId(01) # Chain: STRIDE-TESTNET-2
- Client: 07-tendermint-0
* Connection: connection-0
| State: OPEN
| Counterparty state: OPEN
+ Channel: channel-0
| Port: transfer
| State: OPEN
| Counterparty: channel-0
# Chain: GAIA
- Client: 07-tendermint-0
* Connection: connection-0
| State: OPEN
| Counterparty state: OPEN
+ Channel: channel-0
| Port: transfer
| State: OPEN
| Counterparty: channel-0
2022-07-31T14:38:30.273595Z INFO ThreadId(01) connection is Open, state on destination chain is Open chain=STRIDE-TESTNET-2 connection=connection-0 counterparty_chain=GAIA
2022-07-31T14:38:30.273600Z INFO ThreadId(01) connection is already open, not spawning Connection worker chain=STRIDE-TESTNET-2 connection=connection-0
2022-07-31T14:38:30.273606Z INFO ThreadId(01) no connection workers were spawn chain=STRIDE-TESTNET-2 connection=connection-0
2022-07-31T14:38:30.273611Z INFO ThreadId(01) channel is OPEN, state on destination chain is OPEN chain=STRIDE-TESTNET-2 counterparty_chain=GAIA channel=channel-0
2022-07-31T14:38:30.276438Z INFO ThreadId(01) spawned client worker: client::GAIA->STRIDE-TESTNET-2:07-tendermint-0
2022-07-31T14:38:30.278403Z INFO ThreadId(01) spawned packet worker: packet::channel-0/transfer:STRIDE-TESTNET-2->GAIA
2022-07-31T14:38:30.278430Z INFO ThreadId(01) done spawning channel workers chain=STRIDE-TESTNET-2 channel=channel-0
2022-07-31T14:38:30.278484Z INFO ThreadId(01) spawning Wallet worker: wallet::STRIDE-TESTNET-2
2022-07-31T14:38:30.278501Z INFO ThreadId(01) connection is Open, state on destination chain is Open chain=GAIA connection=connection-0 counterparty_chain=STRIDE-TESTNET-2
2022-07-31T14:38:30.278506Z INFO ThreadId(01) connection is already open, not spawning Connection worker chain=GAIA connection=connection-0
2022-07-31T14:38:30.278510Z INFO ThreadId(01) no connection workers were spawn chain=GAIA connection=connection-0
2022-07-31T14:38:30.278513Z INFO ThreadId(01) channel is OPEN, state on destination chain is OPEN chain=GAIA counterparty_chain=STRIDE-TESTNET-2 channel=channel-0
2022-07-31T14:38:30.283017Z INFO ThreadId(01) spawned client worker: client::STRIDE-TESTNET-2->GAIA:07-tendermint-0
2022-07-31T14:38:30.286036Z INFO ThreadId(01) done spawning channel workers chain=GAIA channel=channel-0
2022-07-31T14:38:30.286132Z INFO ThreadId(01) spawning Wallet worker: wallet::GAIA
2022-07-31T14:38:30.290684Z INFO ThreadId(01) Hermes has started
Next, similar logs with transaction hashes should go, and the balance of wallets should begin to decrease. Transactions can also be checked in explorer. If there are such logs, then everything is set up and working.