Skip to content

ava-labs/icm-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a3365cb · Oct 5, 2023
Sep 27, 2023
Oct 5, 2023
Sep 13, 2023
Sep 29, 2023
Oct 5, 2023
Sep 13, 2023
Oct 5, 2023
Aug 25, 2023
Sep 28, 2023
Oct 5, 2023
Sep 25, 2023
Oct 3, 2023
Sep 1, 2023
Sep 6, 2023
Sep 1, 2023
Sep 26, 2023
Aug 25, 2023
Oct 3, 2023
Aug 25, 2023
Oct 5, 2023
Oct 5, 2023

Repository files navigation

awm-relayer

Standalone relayer for cross-chain Avalanche Warp Message delivery.

Usage

Building

Build the relayer by running the included build script:

./scripts/build.sh

Build a Docker image by running the included build script:

./scripts/build-local-image.sh

Running

The relayer binary accepts a path to a JSON configuration file as the sole argument. Command line configuration arguments are not currently supported.

./build/awm-relayer --config-file path-to-config

Architecture

Note: The relayer in its current state supports Teleporter messages between subnet-evm instances. A handful of abstractions have been added to make the relayer extensible to other Warp message formats and VM types, but this work is ongoing.

Components

The relayer consists of the following components:

  • At the global level:
    • P2P App Network: issues signature AppRequests
    • P-Chain client: gets the validators for a subnet
  • Per Source subnet
    • Subscriber: listens for logs pertaining to cross-chain message transactions
  • Per Destination subnet
    • Destination RPC client: broadcasts transactions to the destination

Data flow

Testing

Unit tests

Unit tests can be ran locally by running the command in root of the project:

./scripts/test.sh

E2E tests

E2E tests are ran as part of CI, but can also be ran locally with the --local flag. To run the E2E tests locally, you'll need to install Gingko following the intructions here

Next, provide the path to the subnet-evm repository and the path to a writeable data directory (here we use the ~/subnet-evm and ~/tmp/e2e-test) to use for the tests:

./scripts/e2e_test.sh --local --subnet-evm ~/subnet-evm --data-dir ~/tmp/e2e-test

Generate Mocks

We use gomock to generate mocks for testing. To generate mocks, run the following command at the root of the project:

go generate ./...