3

Say I want to spin up a local Rococo test network with:

  • Four validators
  • Two parachains
  • One collator per parachain

How do I do this with Zombienet?

1 Answer 1

11

You'll need to download the Zombienet executable.

You can find linux and macOS executables of the Zombienet CLI here:

Download the Zombienet CLI according to your operating system.

Tip: If you want the executable to be available system-wide then you can follow these steps (otherwise just download the executable to your working directory):

wget https://github.com/paritytech/zombienet/releases/download/v1.3.100/zombienet-macos
chmod +x zombienet-macos 
cp zombienet-macos /usr/local/bin

Make sure Zombienet CLI is installed correctly:

./zombienet-macos --help

You should see some similar output:

Usage: zombienet [options] [command]

Options:
  -c, --spawn-concurrency <concurrency>    Number of concurrent spawning process to launch, default is 1
  -p, --provider <provider>                Override provider to use (choices: "podman", "kubernetes", "native")
  -l, --logType <logType>                  Type of logging - defaults to 'table' (choices: "table", "text", "silent")
  -d, --dir <path>                         Directory path for placing the network files instead of random temp one (e.g. -d /home/user/my-zombienet)
  -f, --force                              Force override all prompt commands
  -h, --help                               display help for command

Commands:
  spawn [options] <networkConfig> [creds]  Spawn the network defined in the config
  test <testFile> [runningNetworkSpec]     Run tests on the network defined
  setup [options] <binaries...>            Setup is meant for downloading and making dev environment of ZombieNet ready
  convert <filePath>                       Convert is meant for transforming a (now deprecated) polkadot-launch configuration to zombienet configuration
  version                                  Prints zombienet version
  help [command]                           display help for command

Setting up your network config

Zombienet works with a network config file. This file is where you specify your test network's configuration. The network config file is also where you can specify the Polkadot/Cumulus binaries.

Create a network config file:

touch network.toml

So in this example network config we are specifying that we want a Rococo Relay chain with four validators and two parachains - each with one collator. Make sure you have the compiled binaries available.

Zombienet also works with other providers such as Kubernetes and Podman.

[relaychain]
chain = "rococo-local"
default_command = "/Users/bruno/Library/Caches/pop/polkadot-v1.10.0"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[relaychain.nodes]]
name = "charlie"
validator = true

[[relaychain.nodes]]
name = "dave"
validator = true

[[parachains]]
id = 9090
default_command = "awesome-parachain"

[[parachains.collators]]
name = "pop"
command = "/Users/bruno/src/awesome-parachain/target/debug/awesome-parachain"

Save the file and run the Zombienet CLI using this network config:

./zombienet-macos -p native spawn network.toml

You should see some nicely formatted output stating that the nodes are up and ready.

You can now interact with your nodes in polkadotJS apps!

1
  • You can also try pop-cli.
    – Bruno
    Commented Apr 29 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.