Hermes IBC Relayer

repository·master·Indexed 19 days ago

https://github.com/informalsystems/hermes

A high-performance Inter-Blockchain Communication (IBC) relayer implemented in Rust. Hermes provides a CLI for operators and a library for developers to integrate IBC relaying capabilities into applications. It includes a REST server interface via the ibc-relayer-rest crate, telemetry services via ibc-telemetry, and formal TLA+ specifications for verifying IBC protocols such as ICS02, ICS03, and ICS20.

Tokens
186.3K
Snippets
679
Records
860
Agent score
66%

What's inside Hermes

  1. Overview of the IBC Core TLA+ Specification

    master

    The TLA+ specification provides a formal model of the IBC Core protocols, covering ICS02 (Client Semantics), ICS03 (Connection Semantics), ICS04 (Channel and Packet Semantics), and ICS18 (Relayer Algorithms).

    The main module, IBCCore.tla, models a system consisting of two chains and two relayers. This model is designed to express concurrency aspects of a system with multiple correct relayers and is structured modularly to facilitate formal verification of properties and invariants in adversarial settings.

  2. Overview of the ibc-relayer-types IBC module

    master

    The ibc-relayer-types crate provides the implementation of the Inter-Blockchain Communication (IBC) module. It is designed to facilitate communication between different blockchains.

    Note that this implementation is part of the ibc-rs ecosystem. For detailed usage information, refer to the main hermes repository root or the official documentation on docs.rs.

  3. Overview of Hermes IBC relayer

    master

    Hermes is a Rust implementation of an Inter-Blockchain Communication (IBC) relayer. It is composed of several specialized crates that allow users to run a relayer via a CLI, integrate it as a library, or extend its functionality with REST APIs and telemetry.

    Core components include:

    • ibc-relayer: The core relayer implementation provided as a library.
    • ibc-relayer-cli: The hermes binary, which is a CLI wrapper around the ibc-relayer library.
    • ibc-chain-registry: Tools to fetch data from the chain registry to automatically generate Hermes configurations.
    • ibc-relayer-rest: A library to expose a REST API for inspecting the relayer's state.
    • ibc-telemetry: A library for gathering telemetry data and exposing it via a Prometheus endpoint.
    • ibc-test-framework: Infrastructure for writing end-to-end (E2E) tests involving the relayer and Cosmos full nodes.
  4. Overview of Hermes CLI command sections

    master

    The Hermes CLI is organized into several functional sections. Depending on your task, you will use commands from one of the following categories:

    • Keys: Manage private keys for each configured chain.
    • Config: Manage and validate configuration files.
    • Path Setup: Manage IBC clients, connections, and channels.
    • Relaying: Start the relayer process and relay packets.
    • Listen Mode: Listen for specific IBC events.
    • Upgrade: Perform client upgrades.
    • Monitor: Monitor clients and submit evidence of misbehaviour.
    • Queries: Execute queries on configured chains.
    • Transactions: Submit individual transactions to configured chains.
  5. Understand the IBC Connection Handshake Specification roadmap

    master

    The IBC Connection Handshake specification is organized into two levels of abstraction following the VDD workflow. This documentation provides both English and TLA+ specifications for the ICS-003 connection semantics problem.

    • Level 1 (Abstract): High-level abstraction of the system model and protocol. Detailed in L1_2.md.
    • Level 2 (System Model & Distributed Protocol): A more concrete model of the distributed protocol. The TLA+ specification for this level is located in the L2-tla/ directory.
  6. Explore IBC protocol specifications and verification

    master

    The docs/spec directory provides formal and informal specifications for Inter-Blockchain Communication (IBC) protocols used within Hermes. It is divided into three main areas:

    • TLA+ Specifications: Located in the tla directory, these contain formal TLA+ specifications for the IBC protocol to enable mathematical verification.
    • Relayer Specification: Located in the relayer directory, this provides the English-language specification of the Hermes relayer's behavior.
    • Connection Handshake Protocol (Deprecated): The connection-handshake directory contains both English and TLA+ specifications for the IBC Connection Handshake Protocol (ICS 003). Note that this section is marked as deprecated.
  7. Use the IBC Relayer as a Rust library

    master
    The ibc-relayer crate provides the core logic for the Hermes IBC Relayer as a Rust library. Developers can integrate this library into their own Rust applications to perform Inter-Blockchain Communication (IBC) relaying tasks programmatically, rather than using the standalone CLI tool.
  8. Identify Hermes Component Modules

    master

    The ibc-rs codebase is organized into several functional crates:

    • ibc: The core crate containing data structures and on-chain logic (Clients, Connections, Channels).
    • relayer: The library containing the logic for relaying datagrams between chains.
    • relayer-cli: The CLI wrapper that provides the hermes binary for issuing commands.
    • relayer-rest: A REST server used for debugging and exposing internal runtime details.
    • proto: Contains protobuf-generated Rust types and gRPC client/server methods for interacting with Cosmos SDK chains.
    • proto-compiler: A CLI tool for automating the compilation of protobuf files into gRPC code.
    • telemetry: Provides Prometheus endpoints for gathering and exposing Hermes telemetry data.