Skip to content

Nillion Validator Node Installation Guide

This guide provides instructions for setting up a Nillion validator node. It covers dependency installation, binary configuration, and service management for production-grade operations.

Before starting the installation, ensure your environment meets the following requirements:

  • Operating System: Ubuntu 22.04 LTS or higher.
  • User Permissions: Standard user with sudo privileges.
  • Hardware: 4 vCPU, 8GB RAM, 100GB+ SSD recommended.

Update the local package index and install the necessary build tools and dependencies.

Terminal window
sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y

Nillion requires Go version 1.21.6 or higher. If you do not have Go installed, use the following commands:

Terminal window
cd $HOME
VER="1.21.6"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
# Update environment variables
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
mkdir -p ~/go/bin

Download the pre-compiled nilchaind binary and move it to your executable path.

Terminal window
cd $HOME
wget -O nilchaind https://explorer.dongqn.com/guidenode/nillion/nilchaind
chmod +x nilchaind
mv nilchaind $HOME/go/bin/
nilchaind version

Configure the client settings and initialize the node’s home directory. Replace YOUR_MONIKER with your desired node name.

Terminal window
nilchaind config set client chain-id nillion-chain-testnet-1
nilchaind config set client keyring-backend test
nilchaind config set client node tcp://localhost:18057
nilchaind init YOUR_MONIKER --chain-id nillion-chain-testnet-1 --home=$HOME/.nillionapp

Download the latest genesis file and address book to ensure the node can connect to the peer-to-peer network.

Terminal window
curl -Ls https://explorer.dongqn.com/guidenode/nillion/genesis.json > $HOME/.nillionapp/config/genesis.json
curl -Ls https://explorer.dongqn.com/guidenode/nillion/addrbook.json > $HOME/.nillionapp/config/addrbook.json

Set the network seeds and define the minimum gas price to prevent transaction rejection.

Terminal window
# Set Seeds
SEEDS="3f472746f46493309650e5a033076689996c8881@nillion-testnet.rpc.kjnodes.com:18059"
sed -i.bak -e "s/^seeds *=.*/seeds = \"${SEEDS}\"/" $HOME/.nillionapp/config/config.toml
# Set Minimum Gas Price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0unil\"|" $HOME/.nillionapp/config/app.toml

To reduce disk usage, configure custom pruning to keep only recent state entries.

Terminal window
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.nillionapp/config/app.toml

Create a systemd unit file to manage the node process in the background with automatic restarts.

Terminal window
sudo tee /etc/systemd/system/nillion.service > /dev/null <<EOF
[Unit]
Description=Nillion Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=$(which nilchaind) start --home $HOME/.nillionapp
Restart=on-failure
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Reload the systemd daemon and enable the service.

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable nillion
sudo systemctl restart nillion

To monitor the node logs in real-time, use:

Terminal window
sudo journalctl -u nillion -f -o cat

Generate a new keypair for your validator. Safeguard your mnemonic seed phrase.

Terminal window
nilchaind keys add YOUR_WALLET_NAME

Note: If you need to restore an existing wallet, append the --recover flag to the command above.

Before performing on-chain transactions, ensure your node is fully synced with the network.

Terminal window
nilchaind status --node tcp://127.0.0.1:18057 2>&1 | jq .SyncInfo.catching_up

If the output is false, your node is synced. You can then check your balance:

Terminal window
nilchaind q bank balances $(nilchaind keys show YOUR_WALLET_NAME -a)