Skip to main content

Overview

This page covers the configuration and operation of the IBC v2 Relayer. For more information on the IBC v2 Relayer, see the IBC v2 Relayer overview or the IBC v2 Relayer repository.

About

The relayer delivers IBC packets between connected chains. The relayer is request-driven: it does not watch for new packets automatically. A client submits a source transaction hash; the relayer reads IBC events from that transaction, fetches attestation proofs from the Proof API, and submits the relay transaction to the destination chain. The relayer has three components:
  • gRPC API server — accepts relay requests and status queries; also serves GET /health on the same port
  • Postgres database — persists packet state; migrations must be applied before the relayer starts
  • Relay dispatcher — polls the database and submits RecvPacket / Ack / Timeout transactions

Configuration

The relayer is configured via a YAML file. Below is the config used in the Cosmos ↔ EVM Interoperability Tutorial, derived from ibc/relayer-config.yml.tmpl. It shows the relayer configuration between a Cosmos and Besu chain:
  • counterparty_chains: It is important to note this field. It maps each IBC client ID on a chain to the chain ID it tracks. The relayer only relays packets for clients listed here, and any unlisted client ID is ignored.
For advanced configuration options including batch sizing, concurrency, gas alert thresholds, and EVM gas multipliers, see the Configuration Reference in the relayer README.

Local signing keys

Set signing.keys_path to a JSON file keyed by chain ID. The format follows config/local/ibcv2keys.json.example in the ibc-relayer repository:
  • EVM: hex-encoded ECDSA private key — use any standard wallet or key generation tool
  • Cosmos: hex-encoded secp256k1 private key — create with your chain binary, then export:
The exported hex is what goes in keys.json. The address on each chain must be funded with enough balance to pay transaction fees. For production key management, see Remote Signing in the relayer README.

Getting started

To start the relayer, clone the ibc-relayer repository and follow the instructions below for local development. Refer to the relayer README for full setup details.

Prerequisites

  • Running Proof API
  • Postgres with migrations applied (see Database migrations)
  • RPC endpoints for both chains
  • A funded signing key on each chain

Starting the relayer

For local development, the full startup sequence from the ibc-relayer repo is:
  1. Start Postgres
  1. Build the binary and apply database migrations
  1. Create a local config file (see the Configuration section).
  2. Create a local keys file (see the Local Signing section).
  3. Start the relayer
The relayer will start:
  • gRPC API server on the address configured in relayer_api.address
  • Prometheus metrics server on the configured address
  • Relay dispatcher polling for new transfers
To check the health of the relayer:

CLI flags and subcommands

Database migrations

Migrations are compiled into the relayer binary and applied by the relayer itself. There are two modes: One-shot (recommended for production — apply migrations and exit, then start the relayer separately):
Combined startup (convenient for local development — apply migrations then continue into normal startup):
Each migration runs in its own transaction. If a migration fails, the relayer aborts startup rather than serve against an unverified schema.
The standalone ghcr.io/cosmos/ibc-relayer-migrate Docker image is no longer published. Deployments that previously used it must switch to invoking migrate on the main ibc-relayer image:
For full details on database migrations, see the Database Migrations section of the relayer README.

Triggering a relay

These commands require both chains to be connected (IBC clients created) and the relayer running. Example command to submit a transaction for relaying:
Example command to check relay status:
The response contains a packetStatuses array:
state will be one of TRANSFER_STATE_UNKNOWN, TRANSFER_STATE_PENDING, TRANSFER_STATE_COMPLETE, or TRANSFER_STATE_FAILED. ackTx and timeoutTx are also present once those legs complete.

Ports

Both ports are configurable in the YAML config. The gRPC API and HTTP health endpoint share a single port via multiplexing.

Observability

The relayer exposes Prometheus metrics at the address set in metrics.prometheus_address. Scrape it with any standard Prometheus-compatible collector:
For the full list of exposed metrics, see the Observability section of the relayer README.