Providers

Providers determine how ZombieNet spawns and manages nodes. Choose based on your environment and requirements.

Quick Comparison

ProviderRuns AsImage RequiredResource Limits
NativeLocal processesNoNo
DockerContainersYesNo
KubernetesK8s podsYesYes

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_dir if 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:

VariableDefaultDescription
POLKADOT_IMAGEdocker.io/parity/polkadot:latestRelay chain nodes
CUMULUS_IMAGEdocker.io/parity/polkadot-parachain:latestParachain collators
MALUS_IMAGEdocker.io/paritypr/malus:latestMalus (malicious node)
COL_IMAGEdocker.io/paritypr/colander:latestColander

Labels

Every node container of a network, its scripts container and both of its volumes carry zombienet.namespace (the namespace name), zombienet.kind (node, collator, custom-process, temp and the other zombie-role values for containers, helper for the scripts container, volume for volumes) and zombienet.name. The short-lived --rm containers that set a namespace up are not labelled. Teardown removes the containers that carry the namespace label or the namespace name prefix, then tries to remove its volumes. To list a network's containers: docker ps --filter label=zombienet.namespace=<namespace>.

Kubernetes

Deploys nodes as Kubernetes pods.

Requirements

  • Kubernetes cluster access
  • kubectl configured 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?;
}

Pod Labels

Node pods carry a zombie-role label with the same values as zombienet v1: node (relay chain nodes, validators or not), collator, cumulus-collator, bootnode (dedicated bootnodes) and temp (short-lived helper pods). Custom processes carry custom-process. The file server has no zombie-role.

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.