[How-To] Run an IBC Relayer with Hermes in Docker
Published in
2 min readMar 16, 2022
No time to waste. Let’s get straight to it.
Pre-requisite
- Docker
- Chain-specific binaries for key management. As an example we will be using Osmosis (
osmosisd
), Umee (umeed
) and Cosmos (gaiad
) for the rest of this tutorial - Hermes docker image. I host an unofficial one here
- Some funds for relaying transactions (duh)
- Patience, peace and love
Initialization
$ sudo mkdir -p ~/.hermes$ cd ~/.hermes && touch config.toml$ osmosisd keys add rly-osmosis --keyring-backend file --output json > rly-osmosis.json$ umeed keys add rly-umee --keyring-backend file --output json > rly-umee.json$ gaiad keys add rly-gaia --keyring-backend file --output json > rly-gaia.json
Populate the Configuration File
$ nano ~/.hermes/config.toml
Here is a sample config for your reference. Feel free to tweak it as you see fit.
Start Hermes
$ docker run --name hermes -dt --restart unless-stopped --net="host" -v ~/.hermes/:/root/.hermes jim380/hermes-unofficial:<tag> /bin/sh -c "hermes start"
Import Keys in Hermes
$ docker exec -it hermes hermes keys add cosmoshub-4 --file /root/.hermes/rly-gaia.json$ docker exec -it hermes hermes keys add osmosis-1 --file /root/.hermes/rly-osmosis.json$ docker exec -it hermes hermes keys add umee-1 --file /root/.hermes/rly-umee.json
Maintenance
View Logs
$ docker logs hermes -f --since 1m
List Keys
$ docker exec -it hermes hermes keys list <chain-id>
Delete Keys
$ docker exec -it hermes hermes keys delete <chain-id> --name <key-name>
Health Check
docker exec -it hermes hermes health-check
Create New Channels
$ docker exec -it hermes hermes create channel <chain-1> <chain-2> --port-a transfer --port-b transfer
Query Clients
$ docker exec -it hermes hermes query clients <chain-id> # all clients on a given chain
Query Connections
$ docker exec -it hermes hermes query connections <chain-id> # all connections on a given chain
Query Channels
$ docker exec -it hermes hermes query channels <chain-id> # all channels on a given chain
Update Clients
$ docker exec -it hermes hermes update client <DST_CHAIN_ID> <DST_CLIENT_ID>
Make Transfers
$ docker exec -it shentu certik tx ibc-transfer transfer [src-port] [src-channel] [receiver] [amount] --from [wallet] --chain-id [chain-id]
Get Help
$ docker exec -it hermes hermes help