Try   HackMD

Relayer Quickstart

We will configure the relayer to work with the Axelar and Juno testnets in this example but all the steps would be the same for whichever networks you choose to relay on.

This example assumes you have the relayer binary built already.

Setup Config

  • Initialize the relayers config.
    rly config init

  • Add chain config files for both the src and dst.
    rly config add-chains [/path/to/chain/configs/]

# axelar-testnet.json
{
  "type": "cosmos",
  "value": {
    "key": "default",
    "chain-id": "axelar-testnet-lisbon-3",
    "rpc-addr": "http://testnet.axelar.strange.love:26657",
    "account-prefix": "axelar",
    "keyring-backend": "test",
    "gas-adjustment": 1.3,
    "gas-prices": "0.00005uaxl",
    "debug": true,
    "timeout": "20s",
    "output-format": "json",
    "sign-mode": "direct"
  }
}
# juno-testnet.json
{
  "type": "cosmos",
  "value": {
    "key": "default",
    "chain-id": "uni-2",
    "rpc-addr": "http://testnet.juno.strange.love:26657",
    "account-prefix": "juno",
    "keyring-backend": "test",
    "gas-adjustment": 1.3,
    "gas-prices": "0.0025ujuno",
    "debug": true,
    "timeout": "20s",
    "output-format": "json",
    "sign-mode": "direct"
  }
}

Setup Keys

  • Add a key, for each chain, if you don't have one.
    rly keys add [chain-id] [key-name]

  • Alternatively, if you have a mnemonic you can restore your key.
    rly keys restore [chain-id] [key-name] [mnemonic]

  • If you used a key-name other than default in the previous steps remember to change the key field for the respective chain in the config.yaml file for the relayer.

  • Relaying does require your configured wallets contain some of the native tokens for the chains you are relaying against. You can check your balance with:
    rly q bal [key-name]

Setup Paths

A Bit About Paths In The Relayer

  • IBC utilizes clients, connections and channels; a client can have many connections and a connection can have many channels.
  • The relayer exposes a section in the path configuration for filtering. Essentially, by default the relayer will attempt to relay on all channels over a given connection.
  • You can tell the relayer to only relay on certain channels by using the rule allowlist
"src-channel-filter": {
      "rule": "allowlist",
      "channel-list": [
        "channel-5"
      ]
}
  • You can also tell the relayer to relay on every channel besides for specified channels by using the rule denylist
"src-channel-filter": {
      "rule": "denylist",
      "channel-list": [
        "channel-5"
      ]
}
  • Alternatively, you can tell the relayer to relay on all channels for the connection by leaving the rule blank
"src-channel-filter": {
      "rule": "",
      "channel-list": []
}

Create New Path

  • If you would like to create a new path between the chains you need to 'link' the two chains which creates clients, connections and channels between the two.
    rly tx link axelarjuno

  • The optional use of the --override flag will tell the relayer to not reuse existing clients, connections, or channels. This is useful if you are trying to test the handshake process in IBC to ensure client, connection and channel creation is working as intended.

Use Existing Path

  • For Axelar<->Juno there already exists a path that is relayed on by various parties so you could utilize this also instead of creating a new path. rly tx link from the previous section should technically reuse this existing path if you don't include the --override flag, this method below just skips having to query for the client, connection and channel identifiers.

rly paths add axelar-testnet juno-testnet axelarjuno --file [path/to/file.json]

# axelarjuno.json
{
  "axelarjuno": {
    "src": {
      "chain-id": "axelar-testnet-lisbon-3",
      "client-id": "07-tendermint-12",
      "connection-id": "connection-5"
    },
    "dst": {
      "chain-id": "uni-2",
      "client-id": "07-tendermint-28",
      "connection-id": "connection-28"
    },
    "src-channel-filter": {
      "rule": "allowlist",
      "channel-list": [
        "channel-5"
      ]
    }
  }
}

Start Relayer

Now that everything is configured (e.g. chains, keys, paths) we can start the relayer.
rly start axelarjuno