PoS Validator

PoS Validator Setup
https://docs.vana.org/vana/core-concepts/roles/propagators
1. Prerequisites
You need to submit deposits for each validator at least 35,000 VANA on Moksha testnet. This process stakes your VANA and registers your validator(s) with the network
Hardware requirements for Testnet
- 2-core CPU
- 8 GB RAM
- 100 GB high-speed SSD
- x86-64 architecture
These hardware requirements are rough guidelines, and each node operator should monitor their node to ensure good performance for the intended task.
- Docker: Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgecho "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 updatesudo apt-get install docker-ce docker-ce-cli containerd.iodocker version


- Docker Compose: Install Docker Compose
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-composedocker-compose --version

- OpenSSL: Install via your package manager:
sudo apt-get install openssl

2. Clone the repository:
git clone https://github.com/vana-com/vana-private.gitcd vana-private
3. Configure your environment:
# For Moksha testnetcp .env.moksha.example .env
# For Mainnetcp .env.mainnet.example .env
Edit .env with your preferred text editor
nano .env

4. Choose your setup:
a. For running a node without a validator:
Edit the .env
file to set the USE_VALIDATOR
variable to false
. It is recommended to use GETH_SYNCMODE=snap
and to update the Prysm variables to match, per the comments in the .env.example
file. Then run the following commands:
docker compose --profile init --profile node up -d
b. For running a validator node:
Edit the .env
file to set the USE_VALIDATOR
variable to true
and set the DEPOSIT_*
variables to the appropriate values. Then run the following commands:
- Generate validator keys (interactive process):
docker compose --profile init --profile manual run --rm validator-keygen

Setting an Eth1 address as your withdrawal address:
- Create a password that secures your validator keystore(s):

- Save your mnemonic carefully:

- Verify your mnemonic phrase


Check config:
docker compose --profile init logs check-config-node

Start all services including the validator:
docker compose --profile init --profile validator up -d

View logs for specific key services:
docker compose --profile=init --profile=node logs -f gethdocker compose --profile=init --profile=node logs -f beacondocker compose --profile=init --profile=node logs -f validator


Wait for beacon chain full synced


Submit deposits for your validator
You need to submit deposits for each validator at least 35,000 VANA on Moksha testnet. This process stakes your VANA and registers your validator(s) with the network
docker compose --profile init --profile manual run --rm submit-deposits

Check block sync left:
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 5done

# Advanced Usage
The docker-compose.yml
file provides several additional capabilities for managing your Vana PoS validator node. Here are some useful commands and their purposes:
Profiles
Different profiles are available for various operations:
init
: Initialize clients, generate secretsnode
: Run the main node servicesvalidator
: Run validator-specific servicesmanual
: For manual operations like key generationdelete
: Delete data, e.g. to reset the chain so you can re-sync
You can combine profiles as needed. Whenever a service depends on another service, you must include the dependent profile.
For example, to start the node, you must include the init
and node
profiles:
#Start nodedocker compose --profile init --profile node up -d
#Stop nodedocker compose --profile init --profile node down
Key Management
Generate validator keys (interactive process):
docker compose --profile init --profile manual run --rm validator-keygen
Import validator keys:
docker compose run --rm validator-import
Deleting Data
To delete all data/ (does not remove generated secrets/):
docker compose --profile delete run --rm delete-all
To delete execution or consensus layer data:
docker compose --profile delete run --rm delete-gethdocker compose --profile delete run --rm delete-prysm
Configuration Check
Run a configuration check:
docker compose --profile=init --profile=node run --rm check-config
Individual Services
You can start, stop, or restart individual services:
docker compose --profile=init --profile=node up -d gethdocker compose --profile=init --profile=node stop beacondocker compose --profile=init --profile=node restart validator
Viewing Logs
View logs for specific services:
docker compose --profile=init --profile=node logs gethdocker compose --profile=init --profile=node logs beacondocker compose --profile=init --profile=node logs validator
Add -f
to follow the logs in real-time:
docker compose --profile=init --profile=node logs -f geth
Use grep to filter for specific events:
docker compose --profile=init --profile=node logs -f geth 2>&1 | grep 'Looking for peers'docker compose --profile=init --profile=node logs -f beacon 2>&1 | grep 'Synced new block'docker compose --profile=init --profile=node logs -f validator 2>&1 | grep 'Submitted new'