This section is focused on guiding users through the process of setting up and running a local network, with clear steps and additional context to ensure a smooth setup experience.
This guide provides detailed instructions for setting up and running a local network using Niskala, built with Substrate. This setup is ideal for development, testing, and experimentation with Niskala.
Before you begin, ensure you have the following:
- A compatible operating system (Linux, macOS, or Windows).
- Rust installed on your system.
- Familiarity with command-line operations.
- Zombienet installed for local testnet setup.
- Get the Latest Binary, visit the Release page of the Mandala Github repository.
Ensure your system has the necessary dependencies. Follow the Substrate Installation Guide for your specific platform to install required packages.
Clone the Mandala Node repository to your local machine:
git clone https://github.com/your-repo/mandala-node.git
cd mandala-node
Compile the node with the desired runtime:
cargo build --release --features mandala-native
Note: Use
niskala-native
if you prefer the Niskala runtime.
Generate the genesis state and runtime for your 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
Navigate to your Zombienet directory and start the relay chain:
cd zombienet
./run.sh <zombienet-path>
Info: This command initializes a 2-node relay chain with Bob and Alice as validators.
Return to the Mandala Node directory and start the collator:
./target/release/mandala --dev --charlie --collator --rpc-port 9944 --port 30333 -- --chain ./zombienet/plain.json --discover-local --port 30334
After starting the Zombienet script, register your parachain:
- Open a browser and navigate to the Polkadot/Substrate Portal.
- In the developer tab, go to "sudo" and select
parasSudoWrapper
. - Choose
sudoScheduleParaInitialize(id, genesis)
. - Set the
id
parameter to2000
. - Upload the
genesis-state
file for thegenesisHead
parameter. - Set
paraKind
totrue
and submit the transaction.
Wait for the next epoch to start, and your parachain should begin producing blocks.
You can interact with your local network using the Polkadot/Substrate Portal. This interface allows you to explore blocks, transactions, and other network activities.