Providers
Providers determine how ZombieNet spawns and manages nodes. Choose based on your environment and requirements.
Quick Comparison
| Provider | Runs As | Image Required | Resource Limits |
|---|---|---|---|
| Native | Local processes | No | No |
| Docker | Containers | Yes | No |
| Kubernetes | K8s pods | Yes | Yes |
Provider Selection
Set the default provider via environment variable:
export ZOMBIE_PROVIDER=native # or: docker, k8s
Or specify per-command with --provider flag. Default is docker.
Native
Runs nodes directly on your machine as local processes.
Requirements
- Node binaries in PATH (e.g.,
polkadot,polkadot-parachain) - Or specify absolute paths in configuration
Usage
CLI:
zombie-cli spawn network.toml --provider native
Programmatically:
#![allow(unused)] fn main() { let network = config.spawn_native().await?; }
Notes
- Fastest startup, no container overhead
- No container images needed
- Ports are assigned randomly to avoid conflicts
- Files stored in a temp directory (or
base_dirif configured)
Docker
Runs nodes in Docker containers.
Requirements
- Docker or Podman installed and running
- Container images with node binaries
Usage
CLI:
zombie-cli spawn network.toml --provider docker
Programmatically:
#![allow(unused)] fn main() { let network = config.spawn_docker().await?; }
Default Images
Override via environment variables:
| Variable | Default | Description |
|---|---|---|
POLKADOT_IMAGE | docker.io/parity/polkadot:latest | Relay chain nodes |
CUMULUS_IMAGE | docker.io/parity/polkadot-parachain:latest | Parachain collators |
MALUS_IMAGE | docker.io/paritypr/malus:latest | Malus (malicious node) |
COL_IMAGE | docker.io/paritypr/colander:latest | Colander |
Kubernetes
Deploys nodes as Kubernetes pods.
Requirements
- Kubernetes cluster access
kubectlconfigured with valid kubeconfig- Container images accessible to the cluster
Usage
CLI:
zombie-cli spawn network.toml --provider k8s
Programmatically:
#![allow(unused)] fn main() { let network = config.spawn_k8s().await?; }
Attaching to Running Networks
Reconnect to a previously spawned network, currently running network using the zombie.json state file:
#![allow(unused)] fn main() { use zombienet_sdk::{AttachToLive, AttachToLiveNetwork}; // Native let network = AttachToLiveNetwork::attach_native("/tmp/zombie-1/zombie.json".into()).await?; // Docker let network = AttachToLiveNetwork::attach_docker("/tmp/zombie-1/zombie.json".into()).await?; // Kubernetes let network = AttachToLiveNetwork::attach_k8s("/tmp/zombie-1/zombie.json".into()).await?; }
The zombie.json file is written to the network's base directory after spawn completes.