Relaying
Instructions for setting up the golang relayer, ibc-go (rly)
Assumptions
One of the main advantages of Relayer (known as rly that is the implementation of ibc-go libraries) VS Hermes is that rly needs only RPC nodes to work well, instead of RPC, gRPC and RPC Web. This makes it very interesting if you don't have your own node up and running for a specific chain but you want to help relay packets versus that chain and can't find reliable gRPCs. Despite this advantage, rly can work with your own local/remote nodes to improve further his relay performance. Remember that relaying works in a first-come-first-served way, so using remote RPCs or public overloaded RPCs with high latencies will make you relaying slower than other relayers, and relying on public RPC (nodes not monitored by you) gives always a higher level of uncertainty.
We assume that you already have access to Juno, Osmosis and Cosmos nodes. These can be either local nodes, or you can access them over the network. The given example has all relayed chains run remotely by public RPCs. Feel free to change the RPCs addresses in the configuration file.
In these instructions, rly is installed under /srv/rly
, adjust the paths according to your setup.
These instructions are based on installation on Ubuntu 20.04LTS, but should work the same on Debian 11 or Ubuntu 22.04LTS.
You will need to go, build-essential and git installed to follow these instructions.
Building rly
For preparation, we will create a dedicated user to run rly. The following command will also create a home directory for the new user.
We will next switch to the rly user and create a directory where we will compile the relayer software.
Now is the time to clone the source repository and build it. Note that we need to check out the latest release (the git checkout command below will do it for us).
Next, we will check that the newly built rly version is the correct one (the values below are for v2.1.2):
If you get an output like `'rly' not found` you should probably add `/srv/rly/go/bin` to your PATH
Configuring rly
First, we need to init rly so it will create the default configuration (location ~/.relayer/config/config.yaml
) maybe with a custom memo that will be written on relayed transactions
Then we will add the chains (Juno, Cosmos and Osmosis here) on the config file with a simple command:
Chains configuration will be pulled from chain-registry https://github.com/cosmos/chain-registry so if you find misconfigurations (like gas fees or other) feel free to contribute.
Also RPCs will be chosen from chain-registry, so feel free to change them to your local nodes' RPCs or to a preferred public RPC.
Setting up wallets
We have two options to connect a wallet. The first is to create a new one (replace <key name>
with your preferred name):
the second option is to import it from your 24 words (key name could be the same for all chains or different for every chains)
In that case, you can create a new wallet, backup your keys and use the same keys to import for all the other relayed chains (if you like it).
Now edit the configuration file (under ~/.relayer/config/config.yaml) changing the key
values according to the you had defined above. Example:
In the last step of wallet configuration you can fund your wallets and check balances:
Configuring paths
You now have chains and wallets, but need to configure the paths across the chains. This is super-easy thanks to chain-registry information's:
And then check that all the chains' information are good to go (in that example wallets are empty)
Testing the setup
Let's do a quick test to see if things work properly.
Once we see things load up correctly and there are no fatal errors or impossible to connect to RPCs (you will see a lot of warnings or even errors even if correctly configured, mainly because of temporary RPCs fetching data), we can break out of rly with ctrl-c.
Configuring systemd
Now we will setup rly to be run by systemd, and to start automatically on reboots. Beware of the After=
parameter, because if you are using local nodes instead of remote ones you should add the services name here, like After=network.target juno.service cosmos.service osmo.service
In this example we are using remote nodes, so we specify only After=network.target
.
Using public RPCs it's the simplest way to deploy a relayer (you need only relayer hardware, so a very small VPS for example) but this exposes you to RPCs connection issues. For that reason, the service definition below uses the `RuntimeMaxSec` parameter (and other 2), in order to restart the rly service every 4 hours (14400s). This reduces the issues with external public RPCs (the 4 hours value it's indicative, tune it after your own tests). If you have your own private RPCs feel free to comment on that section.
Create the following configuration to /etc/systemd/system/rly.service. If you are still in rly user, exit to your own user (rootdemo here):
Then we well start rly with the newly created service and enable it. Note that this step is done from your normal user account that has sudo privileges, so no longer as a rly user.
For troubleshooting you can find some information in rly Github https://github.com/cosmos/relayer/blob/main/docs/troubleshooting.md
Last updated