Vana DLP Validator Setup Guide
The Vana network uses a novel validator model called Data Liquidity Pools (DLPs) that allows for secure, private data processing. This guide walks you through setting up a DLP validator node on the Vana testnet.
Environment Prerequisites
Before proceeding with the validator setup, ensure your system has the following components installed:
- Git: For repository management
- Python 3.11+: Core requirement for the Vana validator software
- Poetry: Python dependency management tool
- Metamask: Or another EVM-compatible wallet for test tokens
Step 1: Environment Setup
Python 3.11 Installation
First, install Python 3.11 and related packages:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11 python3.11-venv python3.11-dev python3-pip
python3.11 --version
Poetry Setup
Install Poetry for Python dependency management:
curl -sSL https://install.python-poetry.org | python3 -
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bash_profile
source $HOME/.bash_profile
poetry --version
Node.js & npm Installation
Install Node Version Manager (nvm) and the latest LTS version of Node.js:
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $HOME/.bash_profile
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> $HOME/.bash_profile
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> $HOME/.bash_profile
source $HOME/.bash_profile
# Install Node.js LTS version
nvm install --lts
# Verify installation
node -v
npm -v
Step 2: Validator Software Setup
Clone Repository
Clone the Vana DLP ChatGPT repository:
git clone https://github.com/vana-com/vana-dlp-chatgpt.git
cd vana-dlp-chatgpt
Install Dependencies
Install the required Python dependencies using Poetry:
poetry install
Install Vana CLI
Install the Vana command-line interface:
pip install vana
Step 3: Wallet Configuration
Create Wallet
Create a new wallet with both cold and hot keys:
vanacli wallet create --wallet.name default --wallet.hotkey default
Configure MetaMask for Testnet
Add the Vana Moksha Testnet to your MetaMask wallet with these parameters:
Features
Network Settings
- RPC URL: https://rpc.moksha.vana.org
- Chain ID: 14800
- Network Name: Vana Moksha Testnet
- Currency: VANA
- Block Explorer: https://moksha.vanascan.io
Export and Import Keys
Export your private keys from the Vana CLI:
# Export coldkey
vanacli wallet export_private_key
# Export hotkey
vanacli wallet export_private_key
Import these keys to MetaMask:
- Open MetaMask and click your account icon
- Select "Import Account"
- Choose "Private Key" as the import method
- Paste your coldkey private key
- Repeat for your hotkey
Fund Your Accounts
Both your coldkey and hotkey addresses need testnet VANA tokens:
- Visit the Vana Testnet Faucet
- Connect your MetaMask wallet
- Request VANA for both addresses
Step 4: Creating a DLP (For DLP Creators Only)
Generate Encryption Keys
Run the key generation script:
./keygen.sh
Follow the prompts to enter your name, email, and key expiration details. This will generate four files:
- public_key.asc and public_key_base64.asc (for UI)
- private_key.asc and private_key_base64.asc (for validators)
Deploy DLP Smart Contracts
Clone the DLP Smart Contract repository:
cd $HOME
rm -rf vana-dlp-smart-contracts
git clone https://github.com/Josephtran102/vana-dlp-smart-contracts
cd vana-dlp-smart-contracts
Install Yarn and dependencies:
npm install -g yarn
yarn --version
yarn install
Configure the environment:
cp .env.example .env
nano .env
Deploy the contracts to the Moksha testnet:
npx hardhat deploy --network moksha --tags DLPDeploy
Update the environment settings in the DLP ChatGPT directory:
nano ~/vana-dlp-chatgpt/.env
Add these configuration values:
# The network to use, currently Vana Moksha testnet
OD_CHAIN_NETWORK=moksha
OD_CHAIN_NETWORK_ENDPOINT=https://rpc.moksha.vana.org
# Optional: OpenAI API key for additional data quality check
OPENAI_API_KEY="sk-aIKhy1wmK6Vfx.............._CIJvZx7uZl2HjAA"
# Optional: Your own DLP smart contract address once deployed to the network, useful for local testing
DLP_MOKSHA_CONTRACT=0x5cb.......eE04
# Optional: Your own DLP token contract address once deployed to the network, useful for local testing
DLP_TOKEN_MOKSHA_CONTRACT=0x69e..........2741
# The private key for the DLP, follow "Generate validator encryption keys" section in the README
PRIVATE_FILE_ENCRYPTION_PUBLIC_KEY_BASE64="LS0tLS1CRUdJTiB..........g=="
Step 5: Validator Setup and Registration
Prepare Your Environment
Ensure you're in the correct directory:
cd ~
cd vana-dlp-chatgpt
Fund Validator with DLP Tokens
For DLP creators:
- Import your DLP token to MetaMask using the DataLiquidityPoolToken address
- Send 10 of your DLP tokens to both your coldkey and hotkey addresses
For validators joining an existing DLP:
- Request DLP tokens from the DLP creator
- Ensure they are in your coldkey address
Register as a Validator
Register your validator with the network:
./vanacli dlp register_validator --stake_amount 10
Approve your validator (using your hotkey address from MetaMask):
./vanacli dlp approve_validator --validator_address=<your hotkey address from Metamask>
Run the Validator
Start the validator process:
poetry run python -m chatgpt.nodes.validator
Step 6: Creating a Systemd Service
For continuous operation, set up a systemd service:
Find the path to Poetry:
echo $(which poetry)
Create the service file:
sudo tee /etc/systemd/system/vana.service << EOF
[Unit]
Description=Vana Validator Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/vana-dlp-chatgpt
ExecStart=/root/.local/bin/poetry run python -m chatgpt.nodes.validator
Restart=on-failure
RestartSec=10
Environment=PATH=/root/.local/bin:/usr/local/bin:/usr/bin:/bin:/root/vana-dlp-chatgpt/myenv/bin
Environment=PYTHONPATH=/root/vana-dlp-chatgpt
[Install]
WantedBy=multi-user.target
EOF
Enable and start the service:
sudo systemctl daemon-reload && \
sudo systemctl enable vana.service && \
sudo systemctl start vana.service && \
sudo systemctl status vana.service
Monitor the validator logs:
sudo journalctl -u vana.service -f
Troubleshooting
If you encounter issues, check the following:
- Ensure your MetaMask has sufficient VANA tokens
- Verify that your .env file has the correct contract addresses
- Check the validator logs for any error messages
- Make sure your system meets all the hardware and software requirements
- Confirm that your keys have been properly generated and imported