Vana PoS Validator Setup Guide
This guide walks you through the process of setting up and running a Proof-of-Stake (PoS) validator node on the Vana Moksha testnet. Validators play a crucial role in maintaining network security and consensus.
Prerequisites
To run a Vana PoS validator, you'll need to stake at least 35,000 VANA tokens on the Moksha testnet. This process registers your validator with the network and allows you to participate in consensus.
Hardware Requirements
- CPU: 2+ cores (x86-64 architecture)
- RAM: 8+ GB
- Storage: 100+ GB high-speed SSD
- Network: Stable internet connection
Step 1: Software Installation
Install Docker
Docker is required to run the validator components:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
docker version
Install Docker Compose
Docker Compose helps manage multi-container applications:
VER=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4)
curl -L "https://github.com/docker/compose/releases/download/"$VER"/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
Install OpenSSL
OpenSSL is needed for cryptographic operations:
sudo apt-get install openssl
Step 2: Repository Setup
Clone the Vana private repository:
git clone https://github.com/vana-com/vana-private.git
cd vana-private
Step 3: Environment Configuration
Copy the appropriate environment file for the Moksha testnet:
# For Moksha testnet
cp .env.moksha.example .env
cp .env.mainnet.example .env
instead.Edit the environment file with your preferred text editor:
nano .env
Step 4: Node Configuration and Startup
You can configure your node to run with or without a validator:
Option A: Run Node without Validator
If you want to run a node without validator functions:
- Edit the
.env
file to setUSE_VALIDATOR=false
- Use
GETH_SYNCMODE=snap
for faster initial synchronization - Start the node:
docker compose --profile init --profile node up -d
Option B: Run Node with Validator
For running a full validator node:
- Edit the
.env
file to setUSE_VALIDATOR=true
- Set appropriate
DEPOSIT_*
variables - Generate validator keys (this is an interactive process):
docker compose --profile init --profile manual run --rm validator-keygen
Features
Key Management Tips
- Set a strong, unique password for your validator keys
- Save your mnemonic phrase in a secure location
- Never share your keys or mnemonic with anyone
- Create offline backups of your keys
Verify your configuration:
docker compose --profile init logs check-config-node
Start all services including the validator:
docker compose --profile init --profile validator up -d
Step 5: Monitoring and Management
View Service Logs
You can view logs for specific services to monitor performance:
# View Geth (execution client) logs
docker compose --profile=init --profile=node logs -f geth
# View beacon chain logs
docker compose --profile=init --profile=node logs -f beacon
# View validator logs
docker compose --profile=init --profile=node logs -f validator
Track Synchronization Progress
Wait for the beacon chain to fully synchronize before proceeding further.
Step 6: Submit Validator Deposits
Once your node is synchronized, submit deposits for your validator:
docker compose --profile init --profile manual run --rm submit-deposits
Step 7: Monitor Synchronization Status
Check your node's synchronization status with the network:
LOCAL_RPC="http://localhost:$(grep HTTP_PORT ~/vana-private/.env | cut -d '=' -f2)"
REMOTE_RPC="https://rpc.moksha.vana.org"
get_block_number() {
curl -s -X POST "$1" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | \
jq -r '.result' | \
xargs -I{} printf "%d" {}
}
while true; do
local_height=$(get_block_number $LOCAL_RPC)
network_height=$(get_block_number $REMOTE_RPC)
blocks_left=$((network_height - local_height))
echo -e "\033[1;38mYour node height:\033[0m \033[1;34m$local_height\033[0m | \033[1;35mNetwork height:\033[0m \033[1;36m$network_height\033[0m | \033[1;29mBlocks left:\033[0m \033[1;31m$blocks_left\033[0m"
sleep 5
done
Advanced Operations
The docker-compose setup provides several advanced capabilities for managing your validator node:
Docker Compose Profiles
Different profiles are available for various operations:
- init: Initialize clients and generate secrets
- node: Run main node services
- validator: Run validator-specific services
- manual: For operations like key generation
- delete: Delete data for chain resets
You can combine profiles as needed. When a service depends on another service, you must include both profiles.
Basic Node Management
Start and stop the node:
# Start node
docker compose --profile init --profile node up -d
# Stop node
docker compose --profile init --profile node down
Key Management Operations
# Generate validator keys (interactive)
docker compose --profile init --profile manual run --rm validator-keygen
# Import existing validator keys
docker compose run --rm validator-import
Data Management
Delete data when needed:
# Delete all data (preserves secrets)
docker compose --profile delete run --rm delete-all
# Delete execution layer data
docker compose --profile delete run --rm delete-geth
# Delete consensus layer data
docker compose --profile delete run --rm delete-prysm
Configuration Verification
Verify your configuration:
docker compose --profile=init --profile=node run --rm check-config
Individual Service Management
Start, stop, or restart specific services:
# Start just Geth
docker compose --profile=init --profile=node up -d geth
# Stop beacon chain
docker compose --profile=init --profile=node stop beacon
# Restart validator
docker compose --profile=init --profile=node restart validator
Advanced Log Filtering
Filter logs for specific events:
# Find peer connection activities
docker compose --profile=init --profile=node logs -f geth 2>&1 | grep 'Looking for peers'
# Track new block synchronization
docker compose --profile=init --profile=node logs -f beacon 2>&1 | grep 'Synced new block'
# Monitor validator submissions
docker compose --profile=init --profile=node logs -f validator 2>&1 | grep 'Submitted new'
Troubleshooting
If you encounter issues:
- Check your logs for error messages
- Ensure your node is fully synchronized
- Verify you have enough VANA tokens for staking
- Check your network connectivity
- Ensure your hardware meets the minimum requirements
- Verify that all Docker containers are running properly