Socket
Socket
Sign inDemoInstall

@axelar-network/axelar-local-dev-cosmos

Package Overview
Dependencies
332
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @axelar-network/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 Ether


Version published
Maintainers
6
Created

Readme

Source

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.

FAQs

Last updated on 27 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc