Validator Setup
This guide walks through setting up a Helix validator node from scratch.
Hardware Spec
Recommended specifications:
- CPU: 4+ cores (modern processor)
- RAM: 8GB+
- Storage: 500GB+ SSD (NVMe preferred)
- Network: 100Mbps+ reliable connection
VM Prerequisites
- Linux OS (Ubuntu 22.04 LTS recommended)
- Go 1.22.7+
- systemd for service management
- Git
Installation
1. Install Dependencies
# Update the system
sudo apt update && sudo apt upgrade -y
# Install dep
sudo apt install -y build-essential git curl wget jq
2. Set Up the Dir Structure
# Create app dir
sudo mkdir -p /app/nuklaivm/{bin,lib,config,scripts}
3. Setup the Nuklai Binary
We have two options:
Option A: Get the Pre-built Binary
NOTE the Nuklai repository might be temporarily unavailable while we are restructuring the project on GitHub.
# Download the binary from Nuklai Github (replace 0.0.0 with version you need)
wget https://github.com/Nuklai/nuklai/releases/download/v0.0.0/nuklaid -O /app/nuklaivm/bin/nuklaid
chmod +x /app/nuklaivm/bin/nuklaid
Option B: Build from Source
# Clone repository
git clone https://github.com/Nuklai/nuklai.git
cd nuklai
# Build the binary
make install
# Copy the binary to app dir
cp $(which nuklaid) /app/nuklaivm/bin/
4. Install WASMVM
export WASMVM_VERSION="v2.1.2"
wget -O /app/nuklaivm/lib/libwasmvm.x86_64.so \
https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm.x86_64.so
5. Scripts
Create /app/nuklaivm/start-nuklaivm-chain.sh:
#!/bin/bash
APP_DIR=/app/nuklaivm
export LD_LIBRARY_PATH=$APP_DIR/lib:/lib:/lib64
export PATH=$PATH:$APP_DIR/bin
exec $APP_DIR/bin/nuklaid "$@"
Create /app/nuklaivm/nuklai-chain.service:
[Unit]
Description=Nuklai Validator Node
After=network-online.target
[Service]
User=root
WorkingDirectory=/app/nuklaivm
ExecStart=/app/nuklaivm/scripts/start-nuklaivm-chain.sh start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
6. Initialize Validator Node
Create a validator-config.sh and past the below in:
APP_DIR=/app/nuklaivm
GENESIS_NODE_IP="52.208.110.202"
GENESIS_NODE_ID="09ff5ce747caf117897a7b09251d4b08fdd31d2d" # From Genesis get from tendermint
CHAIN_ID="nuklai"
NODE_MONIKER="secondary-node"
echo -e "Step 1: Initial setup"
# Get the lib path for the WASM lib
export LD_LIBRARY_PATH=$APP_DIR/lib:$LD_LIBRARY_PATH
# This must return the version of the binary
$APP_DIR/bin/nuklaid version
echo -e "Step 2: Initialize the validator node"
# Initialize node with a chain ID and custom moniker
$APP_DIR/bin/nuklaid init $NODE_MONIKER --chain-id $CHAIN_ID
# Always make sure the config files exists, can be funny sometimes
ls -la ~/.nuklai/config/
echo -e "Step 3: Validator keys setup"
# Creating the validator key
echo "y" | $APP_DIR/bin/nuklaid keys add validator --keyring-backend test
# Store the address in a variable, will be used subsequently
VALIDATOR=$($APP_DIR/bin/nuklaid keys show validator -a --keyring-backend test)
echo "Validator Node Address: $VALIDATOR"
echo -e "Step 4: Set up genesis file"
cp $APP_DIR/config/genesis.json ~/.nuklai/config/
echo -e "Step 5: Configure peers and network settings"
# Set persistent peers
sed -i 's/^persistent_peers = ".*"/persistent_peers = "'"$GENESIS_NODE_ID"'@'"$GENESIS_NODE_IP"':26656"/' ~/.nuklai/config/config.toml
# Make RPC,gRPC & P2P Available
sed -i 's/localhost:1317/0.0.0.0:1317/' ~/.nuklai/config/app.toml
sed -i 's/localhost:9090/0.0.0.0:9090/' ~/.nuklai/config/app.toml
sed -i 's/127.0.0.1:26657/0.0.0.0:26657/' ~/.nuklai/config/config.toml
# Peer-to-peer for this node for discovery
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
sed -i "s|external_address = \":26656\"|external_address = \"$PUBLIC_IP:26656\"|g" ~/.nuklai/config/config.toml
# cors
sed -i 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' ~/.nuklai/config/app.toml
echo -e "Step 6: Minimum gas config"
# Always set minimum gas to avoid previous issues
sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.025nai"/g' ~/.nuklai/config/app.toml
echo -e "Step 7: Startup scripts config"
# Copy startup script
sed -i "s|\[APP_DIR\]|$APP_DIR|g" $APP_DIR/scripts/nuklai-chain.service
sed -i "s|\[APP_DIR\]|$APP_DIR|g" $APP_DIR/scripts/start-nuklaivm-chain.sh
chmod +x $APP_DIR/scripts/start-nuklaivm-chain.sh
cp $APP_DIR/scripts/nuklai-chain.service /etc/systemd/system/
# Enable API server
sed -i 's/enable = false/enable = true/' ~/.nuklai/config/app.toml
# Enable & start the service
chmod +x /app/nuklaivm/start-nuklaivm-chain.sh
# Copy service file
cp /app/nuklaivm/nuklai-chain.service /etc/systemd/system/
# Enable the service
systemctl daemon-reload
systemctl enable nuklai-chain
# Start the service
systemctl start nuklai-chain
# Check status
systemctl status nuklai-chain
echo -e "Validator config done!\n"
echo -e "Commands:\n"
echo -e "Start the node: systemctl start nuklai-chain\n"
echo -e "Verify the node is running: systemctl status nuklai-chain\n"
echo -e "Watch logs: journalctl -u nuklai-chain -f\n"
echo -e "After node is fully synced, create validator with:\n"
9. Sync your Node
Monitor sync progress:
# Check your node sync status
nuklaid status | jq '.SyncInfo'
Wait until catching_up is false before proceeding to next steps.
10. Request Testnet Tokens:
Firstly, get your validator address:
VALIDATOR_ADDRESS=$(/app/nuklaivm/bin/nuklaid keys show validator -a --keyring-backend test)
echo "Validator address: $VALIDATOR_ADDRESS"
Next, Run the curl request below to request test NAI to your address:
You can request a max of 5 times then wait for 2 minutes to request more.
curl -X POST https://faucet.nuklaivm-dev.net/request \
-H "Content-Type: application/json" \
-d '{"address":"YOUR_VALIDATOR_ADDRESS"}'
11. Create Your Validator
# Get your validator public key
PUB_KEY=$(nuklaid tendermint show-validator)
# Create validator.json config
cat > validator.json << EOF
{
"pubkey": $PUB_KEY,
"amount": "1000000nai",
"moniker": "$NODE_MONIKER",
"identity": "",
"website": "",
"security": "",
"details": "",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
EOF
# Create validator transaction
/app/nuklaivm/bin/nuklaid tx staking create-validator validator.json \
--from=validator \
--keyring-backend=test \
--chain-id=nuklai \
--gas=auto \
--gas-adjustment=1.5 \
--gas-prices=0.025nai \
--yes
11. Verify Validator Status
/app/nuklaivm/bin/nuklaid query staking validator $(nuklaid keys show validator --bech val -a --keyring-backend test)
# List all the validators
nuklaid query staking validators