Vana Node Setup - DLP Validator - OLD

Special Thanks 👏 : https://x.com/Keeperssd - https://medium.com/@hamzahnorsihab07
Server Advisor :
⭐⭐⭐ Contabo : https://bit.ly/contabourl
PQ : https://pq.hosting/?from=627713
Hetzner : https://hetzner.cloud/?ref=ASjlHtRt2swV
Digital Ocean : https://digitalocean.pxf.io/q465nn
Minimum hardware requirements :
1+
8 GB+
10+
Ubuntu 22.04

Update :
sudo apt update -y && sudo apt upgrade -y
sudo apt install ca-certificates zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev tmux iptables curl nvme-cli git wget make jq libleveldb-dev build-essential pkg-config ncdu tar clang bsdmainutils lsb-release libssl-dev libreadline-dev libffi-dev jq gcc screen unzip lz4 -y
Install Vana :
git clone https://github.com/vana-com/vana-dlp-chatgpt.git
cd vana-dlp-chatgpt

Create your .env
file :
.env
file : cp .env.example .env
Install Dependencies (phyton 3.11.4) + pyenv
sudo apt update
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
source ~/.bashrc
pyenv install 3.11.4
cd ~/vana-dlp-chatgpt
pyenv local 3.11.4
python --version # must be shown Python 3.11.4
poetry env use $(pyenv which python)
cd ~/vana-dlp-chatgpt
poetry install
Install CLI
pip install vana

Wallet :
Create Coldkey wallet & HotKey Wallet. Follow the prompts to set a secure password. Save the mnemonic phrases securely; you’ll need these to recover your wallet if needed.
vanacli wallet create --wallet.name default --wallet.hotkey default

Add Satori Testnet to Metamask:
Network name: Satori Testnet
RPC URL: https://rpc.satori.vana.org
Chain ID: 14801
Currency: VANA
Export your private keys. Follow the prompts and securely save the displayed private keys:
vanacli wallet export_private_key
Enter wallet name (default):
Enter key type [coldkey/hotkey] (coldkey): coldkey
Enter your coldkey password:
Your coldkey private key:
vanacli wallet export_private_key
Enter wallet name (default):
Enter key type [coldkey/hotkey] (coldkey): hotkey
Your hotkey private key:
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
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.
Tutorial CREATE DLP
Create DLP, Follow the prompts to enter your name, email, and key expiration
./keygen.sh

You will get 4 files looks like this :
public_key.asc
andpublic_key_base64.asc
(for UI)private_key.asc
andprivate_key_base64.asc
(for validators)
Deploy DLP Smart Contracts
Clone the DLP Smart Contract repo:
cd ..
git clone https://github.com/vana-com/vana-dlp-smart-contracts.git
cd vana-dlp-smart-contracts
Install dependencies:
yarn install
Edit .ENV
nano .env
Than insert this (fill with the address coldkey & private key you can get from metamask, than fill the description of token up to you)
DEPLOYER_PRIVATE_KEY=(your coldkey private key)
OWNER_ADDRESS=(your coldkey address)
SATORI_RPC_URL=https://rpc.satori.vana.org
DLP_NAME=(your DLP name)
DLP_TOKEN_NAME=(your DLP token name)
DLP_TOKEN_SYMBOL=(your DLP token symbol)

**Save the edit of .ENV file by using “ CTRL + X + Y and ENTER”
Deploy Contract ( You will get deployed addresses for DataLiquidityPool and DataLiquidityPoolToken, please save it)
npx hardhat deploy --network satori --tags DLPDeploy

Check your tx here : https://satori.vanascan.io/address
Configure the DLP contract:
Visit https://satori.vanascan.io/address/ (fill your DataLiquidityPoolToken Contract)
Go to “Write proxy” tab
Connect your wallet
Go to Write Contract
Search
updateFileRewardDelay
and set it to 0Search
addRewardsForContributors
with 1000000000000000000000000 (1 million tokens)





Update you .ENV file by call back your vana-dlp-chatgpt
If you missing your file before you can find it by using :
find / -type d -name "vana-dlp-chatgpt" 2>/dev/null
After you found location than call it (it’s mine /root/vana-dlp-chatgpt)
cd /root/vana-dlp-chatgpt
nano .env
Change the command above and replace it on file .ENV:
OPENAI_API_KEY = "Open Ai Api Key"
DLP_SATORI_CONTRACT=0x... (DataLiquidityPool address)
DLP_TOKEN_SATORI_CONTRACT=0x... (DataLiquidityPoolToken address)
PRIVATE_FILE_ENCRYPTION_PUBLIC_KEY_BASE64=... (content of public_key_base64.asc)
How to find your PUBLIC_KEY_BASE64 & see it ???
find / -name "public_key_base64.asc" 2>/dev/null
Mine shows like this ;
cat /root/vana-dlp-chatgpt/public_key_base64.asc
After you get long text, just copy it and replace it on the Change the command

Save the edit of .ENV file by using “ CTRL + X + Y and ENTER”
REG
cd /root/vana-dlp-chatgpt
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
source ~/.bashrc
pyenv install 3.11.9
pyenv virtualenv 3.11.9 vana-dlp-chatgpt-3.11.9
pyenv activate vana-dlp-chatgpt-3.11.9
poetry install
poetry add python-dotenv



Send 10 tokens to your Hotkey wallet and to your Coldkey wallet (the official documentation says so)
Register your validator:
./vanacli dlp register_validator - stake_amount 10

Just do ENTER when input Name, because it’s default. Fill the password same with you crated before
Just in case you are not DLP Creator and want to registration on another DLP owner you can use the command (Change it)”
./vanacli dlp approve_validator --validator_address=<your hotkey address from Metamask>

Run your validator Node
poetry run python -m chatgpt.nodes.validator


Now Ctrl + C and stop the validator
We create a service file so that the validator works in the background. For this we are looking for a way to poetry
echo $(which poetry)

Command to create a service file, do not forget to replace the path to poetryif it is different for you (copy the entire block and paste into the terminal)
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
We start the service
sudo systemctl daemon-reload && \
sudo systemctl enable vana.service && \
sudo systemctl start vana.service && \
sudo systemctl status vana.service
This conclusion shows that everything Ok

Checking logs
sudo journalctl -u vana.service -f

TEST YOUR VALIDATOR

Last updated