Skip to main content

How to run a node

Clone and Build#

The darwinia-network/darwinia repo's master branch contains the latest Darwinia code.

$ git clone$ cd darwinia && cargo build --release

Alternatively, if you wish to use a specific release, you can download the binary from release page.(v0.11.4 in the example below):

$ wget


Linux / MacOS#

$ ./darwinia --name my-darwinia-node

Add the --ws-external and --rpc-cors all options if you want to remotely connect to this node:

$ ./darwinia --name my-darwinia-node --ws-external --rpc-cors all


$ docker run -it -v node-data:/darwinia/data --base-path /darwinia/data --name my-darwinia-node

Add the --ws-external and --rpc-cors all options and map out the rpc ports if you want to remotely connect to this node:

$ docker run -it -v node-data:/darwinia/data --base-path /darwinia/data --name my-darwinia-node --ws-external --rpc-cors all

It is recommended to use systemctl, pm2, tmux, screen and other tools to maintain the process.

Appendix--Darwinia and Crab Network Database Snapshot#

Darwinia provides the node database snapshots for node maintainers. It enables maintainers to download the latest snapshot, unarchive, and start a node instantly without syncing from block zero.

Available Snapshots Darwinia Network: Crab Network: The number in the file names indicates the block height of the snapshot. For example, the block number of snapshot darwinia-3468533.tar.zst is 3468533.

Usage For Kubernetes users, please use snapshot-init-container.

  1. Install zstd:
# Debian, Ubuntuapt install zstd# CentOS, Rad Hatdnf install zstd# Arch Linuxpacman -S zstd
  1. Download the snapshot archive and extract:

Copy the snapshot archive URL from (Darwinia Network) or (Crab Network). Always choosing the latest snapshot with the highest block number is strongly recommended.

wget -c # the snapshot URLtar xv --zstd -f darwinia-xxxx.tar.zst -C /path/to/chain-dir # Or tar xv -I zstd -f darwinia-xxxx.tar.zst -C /path/to/chain-dir

It's worth noting that /path/to/chain-dir depends on two factors: 1) the node CLI option --base; 2) the chain name. For example, assume with --base /data, the chain dirs for networks are:

* Darwinia Network: /data/chains/darwinia* Crab Network: /data/chains/crab
  1. Run the validator (optional):

If you want to use the snapshot to initialize a validator node, please notice that the node CLI options --unsafe-pruning and --pruning=xxx are required since the database format of the snapshots are not "archived". For example, to run a darwinia validator:

darwinia --validator --unsafe-pruning --pruning=15000

Thanks To