Croeseid Testnet: Running Nodes With Nix


Nix supports both Linux and Mac, for Windows users, you can follow the manual instructions.

Install nix

Follow official instructions to install nix:

for Mac user, you might need to consult the nix manual for macos installation, simply put, if you have a recent Mac, you can install nix with sh <(curl -L --darwin-use-unencrypted-nix-store-volume

Install cachix and enable crypto-com binary cache:

$ nix-env -iA cachix -f
$ cachix use crypto-com

Install chain utils for testnet

$ nix-env -iA chain-utils-testnet -f

After installation, you'll have these commands in your PATH:

  • chain-maind, the chain binary for testnet

  • init-node, the script to initialize the chain data directory with state sync enabled

  • print-systemd-config, print a systemd config file to stdout


$ export CHAINHOME=/path/to/data # optional, default to $HOME/.chain-maind
$ MONIKER=testnode init-node

Change the value of MONIKER to your node's name.

state sync is initialized and enabled by init-node automatically, if you don't want that to happen, you can disable it by edit $CHAINHOME/config/config.toml manually, set enable field to false under section [statesync] like this:

enable = false


You can now run the chain node manually:

$ chain-maind start --home $CHAINHOME

Or setup systemd service on linux:

$ print-systemd-config | sudo tee /etc/systemd/system/chain-maind.service
$ sudo systemctl start chain-maind

Please refer to Croeseid Testnet for instructions to issue transactions and create validator.

Isolated installation

One of the strengths of nix package manager is you can have multiple isolated installations, it would be important when you want to manage both testnet and mainnet chains or different versions of them on a single machine.

$ nix build -f chain-utils-testnet -o testnet
$ export CHAINHOME=$PWD/testnet_data
$ MONIKER=testnode ./testnet/bin/init-node
$ ./testnet/bin/chain-maind start --home $CHAINHOME

Last updated