npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@axelar-network/axelar-local-dev-multiversx

v2.3.2

Published

Welcome to the Axelar Local Development MultiversX featuring MultiversX Integration. This package empowers developers to establish a local development environment for streamlined cross-chain communication utilizing the [MultiversX protocol](https://multiv

Downloads

87

Readme

Axelar Local Dev: MultiversX Integration

Welcome to the Axelar Local Development MultiversX featuring MultiversX Integration. This package empowers developers to establish a local development environment for streamlined cross-chain communication utilizing the MultiversX protocol. Currently, the integration facilitates general message passing exclusively with the EVM chain.

Prerequisite

  1. You should have Docker & Docker Compose installed.

  2. Install Mxpy CLI Tool

Download from here: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/

Note: Our examples are tested on Mxpy version 9.4.1, but newer versions might also work.

  1. Run Elasticsearch

dcker-compose up -d (in this folder)

  1. Create & run a MultiversX Localnet

More info: https://docs.multiversx.com/developers/setup-local-testnet

mkdir -p .multiversx && cd .multiversx
mxpy localnet setup
mxpy localnet start

Stop the localnet. You will now have localnet folder populate with the subfolders validator00, validator01, validator02.

Copy the external.toml from this folder into all the validators config folder (eg full path: .multiversx/localnet/validator00/config) and overwrite the existing file.

This will setup connection to Elasticsearch to index events used by the MultiversXRelayer.

Start again the localnet: mxpy localnet start

Installation

To install this package, use the following command:

npm install @axelar-network/axelar-local-dev-multiversx

Configuration

To set up the MultiversX chain stack with the EVM chain stack, you need to modify the createAndExport function in your script. Create an MultiversXRelayer instance and incorporate it with your existing EVM relayer. Here's an example:

const multiversxRelayer = new MultiversXRelayer();
const relayers = { evm: new EvmRelayer({ multiversxRelayer }), multiversx: multiversxRelayer };

For more details on setting up the createAndExport function, check our Standalone Environment Setup Guide.

API Reference

MultiversXNetwork is a generalization of ProxyNetworkProvider (avaliable in the @multiversx/sdk-network-providers package) that includes (among others that are mainly used for intrnal purposes):

  • deployAxelarFrameworkModules(): Deploy Axelar related smart contracts found in contracts.
  • deployContract(contractCode: string, initArguments: TypedValue[]): Promise<string>: A wrapper for deploying a contract from code with init arguments, deployed by alice.pem wallet. Returns the SC address.
  • signAndSendTransaction(transaction: Transaction, privateKey: UserSecretKey = this.ownerPrivateKey): A wrapper to easily sign, send and wait for a transaction to be completed.
  • callContract(address: string, func: string, args: TypedValue[] = []): Promise<ContractQueryResponse>): A wrapper to easily query a smart contract.

Additionaly we export two utility functions

  • createMultiversXNetwork(config?: {gatewayUrl: string}): This deploys all the Axelar related smart contracts (gas-service, auth, gateway) if they are not deployed and saves their addresses to a config file. gatewayUrl defaults to http://localhost:7950
  • loadMultiversXNetwork(gatewayUrl = 'http://localhost:7950'): This loads the preconfigured MultiversXNetwork by reading the contract addresses from the config file. Needs to be used after createMultiversXNetwork was called at least once by a process.

createAndExport (see above) will try to also call createMultiversXNetwork so that relaying works to MultiversX as well.