Skip to content

Installation

Vana banner

# Prepare enviroment

Follow these steps to set up your environment, whether you’re creating a new DLP or joining an existing one as a validator.

Prerequisites

For all users:

Additional for DLP creators:

1. Install Python 3.11:
Terminal window
sudo apt update
sudo apt install software-properties-common
Terminal window
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11 python3.11-venv python3.11-dev python3-pip
Terminal window
python3.11 --version
banner banner
2. Install Poetry
Terminal window
curl -sSL https://install.python-poetry.org | python3 -
banner
Terminal window
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bash_profile
source $HOME/.bash_profile
poetry --version
banner
3. Install Nodejs & Npm
Terminal window
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
banner
Terminal window
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
Terminal window
nvm install --lts
Terminal window
node -v
npm -v
banner

# Setup steps

1. Clone Vana-dlp-chatgpt git repo
Terminal window
git clone https://github.com/vana-com/vana-dlp-chatgpt.git
cd vana-dlp-chatgpt
banner
2. Install dependencies
Terminal window
poetry install
banner banner
3. Install Vana CLI
Terminal window
pip install vana
banner
4. Create wallet
Terminal window
vanacli wallet create --wallet.name default --wallet.hotkey default
banner
This creates two key pairs:
  • Coldkey: for human-managed transactions (like staking)
  • Hotkey: for validator-managed transactions (like submitting scores)

Add Satori Testnet to Metamask:

RPC URLhttps://rpc.moksha.vana.org
Chain ID14800
Network nameVana Moksha Testnet
CurrencyVANA
Block Explorerhttps://moksha.vanascan.io
5. Export your private keys
Terminal window
#For coldkey
vanacli wallet export_private_key
banner
Terminal window
#For hotkey
vanacli wallet export_private_key
banner
6. Import your coldkey and hotkey addresses to Metamask:
  • Click your account icon in MetaMask and select “Import Account”
  • Select “Private Key” as the import method
  • Paste the private key for your coldkey
  • Repeat the process for your hotkey
banner
Fund both addresses with testnet VANA:
  • Visit https://faucet.vana.org
  • Connect your Metamask wallet
  • Request VANA for both your coldkey and hotkey addresses

Note: you can only use the faucet once per day. Use the testnet faucet available at https://faucet.vana.org to fund your wallets, or ask a VANA holder to send you some test VANA tokens.

Always keep your private keys and mnemonic phrases secure. Never share them with anyone.

# Creating a DLP

Generate Encryption Keys

Run the key generation script:

Terminal window
./keygen.sh
banner
  1. This script generates RSA key pairs for file encryption/decryption in the DLP.
  2. Follow the prompts to enter your name, email, and key expiration.
  3. The script generates 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 repo:
Terminal window
cd $HOME
rm -rf vana-dlp-smart-contracts
git clone https://github.com/Josephtran102/vana-dlp-smart-contracts
cd vana-dlp-smart-contracts
banner
Install Yarn
Terminal window
npm install -g yarn
yarn --version
banner
Install dependencies:
Terminal window
yarn install
banner
Edit the .env file in the vana-dlp-smart-contracts directory:
  • Copy env.example to .env
Terminal window
cp .env.example .env
  • Edit .env
Terminal window
nano .env
banner
Deploy contracts:

Deploy contract on Moksha testnet (Recommend)

Terminal window
npx hardhat deploy --network moksha --tags DLPDeploy
banner
Update the .env file in the vana-dlp-chatgpt directory:
Terminal window
nano ~/vana-dlp-chatgpt/.env

Paste this content and change your info:

Terminal window
# 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=="
banner

Get OpenAI API here: https://platform.openai.com/settings/profile?tab=api-keys

Find value of public_key_base64.asc at: /root/vana-dlp-chatgpt/public_key_base64.asc

# Validator Setup

Ensure you’re in the vana-dlp-chatgpt directory:
Terminal window
cd ~
cd vana-dlp-chatgpt
Fund Validator with DLP Tokens

For DLP creators:

  1. Import DLP token to Metamask using <DataLiquidityPoolToken address>
  2. Send 10 your own DLP tokens (my token is JOSE) to your coldkey address and hotkey address
banner

For non-DLP creators:

  1. Request DLP tokens from the DLP creator
  2. Once received, ensure they are in your coldkey address

Register as a Validator

Note that the following commands use the local chatgpt vanacli tool that supports custom dlp commands.

Register your validator:
Terminal window
./vanacli dlp register_validator --stake_amount 10
banner
Terminal window
./vanacli dlp approve_validator --validator_address=<your hotkey address from Metamask>
banner

Run Validator

Terminal window
poetry run python -m chatgpt.nodes.validator
banner

You can run with systemd in the background with next step.

Find path of Poetry:

Terminal window
echo $(which poetry)
banner
Create service:
Terminal window
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
banner
Start service
Terminal window
sudo systemctl daemon-reload && \
sudo systemctl enable vana.service && \
sudo systemctl start vana.service && \
sudo systemctl status vana.service
banner
Check log:
Terminal window
sudo journalctl -u vana.service -f
banner