Skip to content
starskiff

hermes

IBC relayer between chain instances

Instance.hermes() wraps the Hermes IBC relayer. Give it running chain instances and a funded relayer account, and it writes the Hermes config, registers keys, creates clients/connections/channels, and starts relaying — start() resolves once every requested channel is open.

Install the binary

Grab a release from informalsystems/hermes and put hermes on PATH.

Usage

import { Instance, testAccounts } from 'starskiff';
 
const relayerMnemonic = testAccounts[1].mnemonic; // must be funded on ALL chains
 
const chainA = Instance.wasmd({
  chainId: 'ibc-a',
  prefix: 'wasm',
  accounts: [{ mnemonic: relayerMnemonic, coins: '1000000000stake', name: 'relayer' }],
});
const chainB = Instance.wasmd({
  chainId: 'ibc-b',
  prefix: 'wasm',
  rpcPort: 26757, // distinct ports — see the multi-chain guide
  // ...
  accounts: [{ mnemonic: relayerMnemonic, coins: '1000000000stake', name: 'relayer' }],
});
 
await Promise.all([chainA.start(), chainB.start()]);
 
const relayer = Instance.hermes(
  {
    channels: [[chainA, chainB]], // one [chain, chain] tuple per channel
    mnemonic: relayerMnemonic,
  },
  { timeout: 180_000 }, // handshakes take a while
);
await relayer.start(); // resolves when channel-0 is open

Channels are created in order: the first tuple becomes channel-0 (on both ends of that pair), the next channel-1, and so on.

EVM chains as counterparties

Instances built on cosmosEvmBase (e.g. evmd) advertise relayerHints — Hermes needs to know they use ethermint address derivation (coin type 60) and which protobuf PubKey type to use. Instance.hermes() picks the hints up automatically; mixed pairs like [wasmd, evmd] just work.

Parameters

ParameterTypeDefaultDescription
channels[CosmosInstance, CosmosInstance][]— (required)Channel pairs to create + relay
mnemonicstring— (required)Relayer account, funded on all chains
binarystring"hermes"Path to the binary
gasPricestring"0.025"Gas price amount
telemetryPortnumber3001Telemetry port
debugbooleanfalseVerbose setup logs
commandTimeoutMsnumber300000 (600000 in CI)Timeout per Hermes command
commandRetriesnumber0 (2 in CI)Retries for setup commands
commandRetryDelayMsnumber5000Delay between retries

See the IBC guide for an end-to-end transfer test.