2.3.2 • Published 1 month ago

@axelar-network/axelar-local-dev-cosmos v2.3.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 month ago

Axelar Local Dev Cosmos

Axelar Local Dev Cosmos offers a comprehensive suite of tools for local development involving Cosmos chains. With this package, developers can easily deploy WebAssembly (Wasm) contracts on a Wasm chain and seamlessly send cross-chain messages to the Ethereum Virtual Machine (EVM) chain.

Note: This package is currently under development. Some functionalities might be unstable.

Prerequisite

  • Docker installed and running on your local machine.

Quick Start

Start Wasm and Axelar Chain

Run the following command to pull the Docker image, set up the chains, and establish IBC connections:

npm run start

Alternatively, you can start the chains programmatically:

import { startChains } from "@axelar-network/axelar-local-dev-cosmos";

startChains();

Running IBC Relayer and Axelar Event Listener

After setting up the chains, follow these steps to run the IBC Relayer and Axelar Event Listener:

Create Axelar Relayer Service for initailizing the IBC channels and keep listening to incoming events:

import {
  defaultAxelarChainInfo,
  AxelarRelayerService,
} from "@axelar-network/axelar-local-dev-cosmos";

const axelarRelayerService = await AxelarRelayerService.create(
  defaultAxelarChainInfo
);

Relaying Messages

To relay messages after they have been submitted on the Ethereum or Wasm chains, use the following method:

import {
  evmRelayer,
  createNetwork,
  relay,
  RelayerType,
} from "@axelar-network/axelar-local-dev";
import {
  defaultAxelarChainInfo,
  AxelarRelayerService,
} from "@axelar-network/axelar-local-dev-cosmos";

// Setup for Ethereum Network and Wasm chain relayer
const evmNetwork = await createNetwork({ name: "Ethereum" });
const wasmRelayer = await AxelarRelayerService.create(defaultAxelarChainInfo);

// Deploy contracts, send messages, and call the relay function
// ...

evmRelayer.setRelayer(RelayerType.Wasm, wasmRelayer);
await relay({
  wasm: wasmRelayer,
  evm: evmRelayer,
});

// Verify results on the destination chain
// ...

Examples

  • We currently support Ethereum as the destination chain for messages originating from the Wasm chain.
  • For implementation details, see our Local Example and Axelar Example.

The Local Example utilizes the same contracts as in the Axelar Examples.

2.3.2

1 month ago

2.3.0

2 months ago

2.2.0-alpha.25

5 months ago

2.2.0-alpha.27

5 months ago

2.2.0-alpha.28

5 months ago

2.2.0-alpha.24

5 months ago

2.2.0-alpha.21

5 months ago

2.2.0-alpha.22

5 months ago

2.2.0-alpha.23

5 months ago

2.2.0-alpha.20

5 months ago

2.2.0-alpha.19

5 months ago

2.2.0-alpha.18

5 months ago

2.2.0-alpha.16

5 months ago

2.2.0-alpha.17

5 months ago

2.2.0-alpha.15

5 months ago

2.2.0-alpha.13

5 months ago

2.2.0-alpha.14

5 months ago

2.2.0-alpha.12

5 months ago

2.2.0-alpha.11

5 months ago

2.2.0-alpha.10

5 months ago

2.2.0-alpha.9

5 months ago

2.2.0-alpha.8

5 months ago

2.2.0-alpha.7

6 months ago

2.2.0-alpha.6

6 months ago

2.2.0-alpha.5

6 months ago

2.2.0-alpha.4

6 months ago

2.2.0-alpha.3

6 months ago

2.2.0-alpha.2

6 months ago

2.2.0-alpha.1

6 months ago