Skip to content

Latest commit

 

History

History

multiversx

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

MultiversX Examples

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. Optional: Build MultiversX contracts (make sure you use Rust Nightly version at least 1.76.0 - nightly-2023-12-11). However this is optional, a default wasm contract is provided.
npm run build-multiversx
  1. Run Elasticsearch

docker-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

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.

cd ..
cp external.toml .multiversx/localnet/validator00/config/
cp external.toml .multiversx/localnet/validator01/config/
cp external.toml .multiversx/localnet/validator02/config/

This will connect MultiversX nodes to Elasticsearch to index events used by the MultiversXRelayer.

Then start the localnet: (wait a bit afterwards for everything to initialize)

cd .multiversx
mxpy localnet start
  1. Check that multiversx - enabled flag is set to true in config/default.json file

  2. Run the local server (from the project root)

npm run start

Wait for all the contracts to be successfully deployed.

Basic

ITS