Mandala chain implementation, build with Substrate. This repository contains both Mandala and Niskala runtimes.
Depending on your operating system and Rust version, there might be additional packages required to compile this repository. Check the Install instructions for your platform for the most common dependencies. Alternatively, you can use one of the alternative installation options.
Use the following command to build the node without launching it:
cargo build --release --features mandala-native
This will build the node with mandala runtime in it, if you want to build it with niskala runtime instead, compile it with
niskala-native
feature.
After you build the project, you can use the following command to explore its parameters and subcommands:
./target/release/mandala -h
You can generate and view the Rust Docs for this repository with this command:
cargo +nightly doc --open
To run a development chain, we first need a relay chain to connect to. In this case, we spin up a 2-node rococo local testnet instance using zombienet. Since zombienet doesn't yet support running ethereun parachain out of the box (issue). So we must manually register our parachain into our Relay chain. To do this, first generate the genesis head and runtime of our node.
./target/release/mandala export-genesis-state --dev > <path>
./target/release/mandala export-genesis-wasm --dev > <path>
Replace the path with folder you wish to store the state and runtime
Go to the zombienet folder and run the script
cd zombienet
./run.sh <zombienet-path>
This will spin up 2 relay node with bob and alice as the validator
Then go the root of the project and run the collator :
./target/release/mandala --dev --charlie --collator --rpc-port 9944 --port 30333 -- --chain ./zombienet/plain.json --discover-local --port 30334
After you run the zombienet script, you should see something like this on your terminal :
Click one of the direct link, and it will take you to polkadotJS
and automatically connect to the node. On the developer tab, go to sudo and select parasSudoWrapper
. You should see something like below :
Select sudoScheduleParaInitialize(id, genesis)
. fill the id
parameter with 2000
. on the genesisHead
parameter, tick the file upload field and drag your genesis state that you've previously exported. Finally, Set the paraKind
to true
and submit the transaction. Wait until the next epoch start and the parachain should produce blocks.
After you start this node locally, you can interact with it using the hosted version of the Polkadot/Substrate Portal front-end by connecting to the local node endpoint. A hosted version is also available on IPFS (redirect) here or IPNS (direct) here. You can also find the source code and instructions for hosting your own instance on the polkadot-js/apps repository.