Run a Parachain Network Using Zombienet¶
Introduction¶
Zombienet is a testing framework designed for Polkadot SDK-based blockchain networks. It enables developers to efficiently deploy and test ephemeral blockchain environments using a simple CLI.
This tutorial walks you through spawning a local parachain test network using Zombienet's native provider. You will build a custom parachain binary from the Polkadot SDK parachain template, download the relay chain binaries, configure a network with two relay chain validators and a parachain collator, and verify that the network produces blocks.
For detailed information about Zombienet installation methods, providers, CLI commands, and configuration options, refer to the Zombienet reference page.
Prerequisites¶
Before starting, ensure you have the following installed:
- Rust and Cargo
-
The
wasm32-unknown-unknowntarget. Add it with: -
Zombienet - see the reference page for installation instructions
- Git
Set Up the Parachain Template¶
Clone and build the Polkadot SDK parachain template:
-
Clone the repository:
-
Build the parachain node binary:
This compiles the
parachain-template-nodebinary totarget/release/. -
Add the binary to your PATH:
Download Relay Chain Binaries¶
You need the Polkadot relay chain binaries (polkadot, polkadot-prepare-worker, and polkadot-execute-worker) to run the relay chain validators.
Note
When using the parachain template v0.0.5, ensure you use a compatible relay chain binary. The recommended version is polkadot-stable2512-2, which you can download from the Polkadot SDK releases.
Download the binaries for your platform and make them executable:
mkdir -p bin
curl -L -o bin/polkadot \
https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-stable2512-2/polkadot
curl -L -o bin/polkadot-prepare-worker \
https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-stable2512-2/polkadot-prepare-worker
curl -L -o bin/polkadot-execute-worker \
https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-stable2512-2/polkadot-execute-worker
chmod +x bin/polkadot bin/polkadot-prepare-worker bin/polkadot-execute-worker
Alternatively, you can use Zombienet's setup command:
Generate a Paseo Local Chain Spec¶
To run a local Paseo-based relay chain, you need to generate a chain spec using chain-spec-builder and the Paseo runtime. This creates a local testnet chain spec with development accounts (Alice, Bob) as validators.
-
Download
chain-spec-builderfrom the Polkadot SDK releases: -
Download the Paseo runtime Wasm from the Paseo runtimes releases:
-
Generate the local testnet chain spec:
bin/chain-spec-builder -c configs/paseo-local.json \ create -r bin/paseo_runtime.compressed.wasm named-preset local_testnetThis creates a
configs/paseo-local.jsonchain spec with thelocal_testnetpreset, which includes Alice and Bob as validators.
Configure the Network¶
Create a network.toml file that defines the network topology. This configuration sets up a relay chain with two validators and a parachain with one collator, using the Paseo local chain spec generated in the previous step:
[settings]
timeout = 1000
provider = "native"
[relaychain]
chain_spec_path = "./configs/paseo-local.json"
default_command = "./bin/polkadot"
[[relaychain.nodes]]
name = "alice"
validator = true
rpc_port = 9944
[[relaychain.nodes]]
name = "bob"
validator = true
rpc_port = 9945
[[parachains]]
id = 1000
[[parachains.collators]]
name = "collator01"
command = "./polkadot-sdk-parachain-template/target/release/parachain-template-node"
rpc_port = 9988
For a full reference of all available configuration options, see the Zombienet configuration reference.
Spawn the Network¶
Launch the network using Zombienet:
Zombienet will:
- Generate chain specifications.
- Start relay chain validators (Alice and Bob).
- Register and start the parachain collator.
- Display connection endpoints and logs.
Wait for the output to confirm the network has launched. You'll see RPC endpoints for each node.
Verify the Network¶
Once the network is running, verify that the relay chain is producing blocks by querying the RPC endpoint:
curl -s -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"chain_getHeader","params":[],"id":1}' \
http://127.0.0.1:9944
The response should include a number field showing the current block number, confirming the relay chain is producing blocks.
You can also check the parachain collator:
curl -s -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"chain_getHeader","params":[],"id":1}' \
http://127.0.0.1:9988
To stop the network, press Ctrl + C in the terminal where Zombienet is running.
Where to Go Next¶
-
Zombienet Reference
Explore the full Zombienet configuration reference, including all settings, relay chain, parachain, and collator options.
-
External Zombienet Support
Parity Technologies has designed and developed this framework, now maintained by the Zombienet team.
For further support and information, refer to the following contact points:
| Created: November 22, 2024