# Vana Node Setup - DLP Validator Satori

<figure><img src="/files/CIQiBe7Hlbu277h1d6vl" alt=""><figcaption></figcaption></figure>

Special Thanks :clap: : \
\
<https://x.com/Keeperssd> - <https://medium.com/@hamzahnorsihab07> - <https://service.josephtran.xyz/>

### Server Advisor : <a href="#server-advisor" id="server-advisor"></a>

⭐⭐⭐ 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 :**&#x20;

| CPU | RAM   | Disk | Ubuntu       |
| --- | ----- | ---- | ------------ |
| 1+  | 8 GB+ | 10+  | Ubuntu 22.04 |

<figure><img src="/files/dxHJJhq6vAyxKMNTrcOw" alt=""><figcaption></figcaption></figure>

### Update :&#x20;

```
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
```

### 1. Install Python 3.11: <a href="#id-1.-install-python-3.11" id="id-1.-install-python-3.11"></a>

```
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.11 --version
```

### 2. Install Poetry <a href="#id-2.-install-poetry" id="id-2.-install-poetry"></a>

```
curl -sSL https://install.python-poetry.org | python3 -
```

```
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bash_profile
source $HOME/.bash_profile
poetry --version
```

### 3. Install Nodejs & Npm <a href="#id-3.-install-nodejs-and-npm" id="id-3.-install-nodejs-and-npm"></a>

```
# installs nvm (Node Version Manager)
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
```

```
nvm install --lts
```

```
node -v
npm -v
```

### # Setup steps <a href="#setup-steps" id="setup-steps"></a>

#### 1. Clone Vana-dlp-chatgpt git repo <a href="#id-1.-clone-vana-dlp-chatgpt-git-repo" id="id-1.-clone-vana-dlp-chatgpt-git-repo"></a>

```
git clone https://github.com/vana-com/vana-dlp-chatgpt.git
cd vana-dlp-chatgpt
```

#### 2. Install dependencies <a href="#id-2.-install-dependencies" id="id-2.-install-dependencies"></a>

```
poetry install
```

#### 3. Install Vana CLI <a href="#id-3.-install-vana-cli" id="id-3.-install-vana-cli"></a>

```
pip install vana
```

#### 4. Create wallet <a href="#id-4.-create-wallet" id="id-4.-create-wallet"></a>

```
vanacli wallet create --wallet.name default --wallet.hotkey default
```

#### This creates two key pairs: <a href="#this-creates-two-key-pairs" id="this-creates-two-key-pairs"></a>

* Coldkey: for human-managed transactions (like staking)
* Hotkey: for validator-managed transactions (like submitting scores)

*Follow the prompts to set a secure password. Save the **mnemonic phrases** securely; you'll need these to recover your wallet if needed.*

Add Satori Testnet to Metamask:

* Network name: Satori Testnet
* RPC URL: [https://rpc.satori.vana.org](https://rpc.satori.vana.org/)
* Chain ID: 14801
* Currency: VANA

#### 5. Export your private keys <a href="#id-5.-export-your-private-keys" id="id-5.-export-your-private-keys"></a>

*Follow the prompts and securely save the displayed private keys*

```
#For coldkey
vanacli wallet export_private_key
```

```
#For hotkey
vanacli wallet export_private_key
```

#### 6. Import your coldkey and hotkey addresses to Metamask: <a href="#id-6.-import-your-coldkey-and-hotkey-addresses-to-metamask" id="id-6.-import-your-coldkey-and-hotkey-addresses-to-metamask"></a>

* 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: <a href="#fund-both-addresses-with-testnet-vana" id="fund-both-addresses-with-testnet-vana"></a>

* Visit [https://faucet.vana.org](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](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 <a href="#creating-a-dlp" id="creating-a-dlp"></a>

#### Generate Encryption Keys <a href="#generate-encryption-keys" id="generate-encryption-keys"></a>

Run the key generation script:

```
./keygen.sh
```

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 <a href="#deploy-dlp-smart-contracts" id="deploy-dlp-smart-contracts"></a>

#### Clone the DLP Smart Contract repo: <a href="#clone-the-dlp-smart-contract-repo" id="clone-the-dlp-smart-contract-repo"></a>

```
cd $HOME
git clone https://github.com/vana-com/vana-dlp-smart-contracts.git
cd vana-dlp-smart-contracts
```

### Install Yarn <a href="#install-yarn" id="install-yarn"></a>

```
npm install -g yarn
yarn --version
```

#### Install dependencies: <a href="#install-dependencies" id="install-dependencies"></a>

```
yarn install
```

#### Edit the `.env` file in the `vana-dlp-smart-contracts` directory: <a href="#edit-the-.env-file-in-the-vana-dlp-smart-contracts-directory" id="edit-the-.env-file-in-the-vana-dlp-smart-contracts-directory"></a>

Copy `env.example` to `.env`

```
cp .env.example .env
```

Edit `.env`

```
nano .env
```

#### Deploy contracts: <a href="#deploy-contracts" id="deploy-contracts"></a>

```
npx hardhat deploy --network satori --tags DLPDeploy
```

#### Verify contract <a href="#verify-contract" id="verify-contract"></a>

```
npx hardhat verify --network satori <DataLiquidityPool address>
```

```
npx hardhat verify --network satori <DataLiquidityPoolToken address> "<DLP_TOKEN_NAME>" <DLP_TOKEN_SYMBOL> <OWNER_ADDRESS>
```

#### Configure the DLP contract (DataLiquidityPool): <a href="#configure-the-dlp-contract-dataliquiditypool" id="configure-the-dlp-contract-dataliquiditypool"></a>

* Visit <https://satori.vanascan.io/address/>YOUR\_DLP\_POOL\_CONTRACT\_ADDRESS
* Go to "Write proxy" tab
* Connect your cold wallet which you imported at previous step
* Call `updateFileRewardDelay` and set it to 0
* Call `addRewardsForContributors` with 1000000000000000000000000 (1 million tokens)

#### Update the `.env` file in the `vana-dlp-chatgpt` directory: <a href="#update-the-.env-file-in-the-vana-dlp-chatgpt-directory" id="update-the-.env-file-in-the-vana-dlp-chatgpt-directory"></a>

```
nano ~/vana-dlp-chatgpt/.env
```

Paste this content and change your info:

```
# The network to use, currently Vana Satori testnet
OD_CHAIN_NETWORK=satori
OD_CHAIN_NETWORK_ENDPOINT=https://rpc.satori.vana.org

# Optional: OpenAI API key for additional data quality check
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"

# Optional: Your own DLP smart contract address once deployed to the network, useful for local testing

DLP_SATORI_CONTRACT="0x......YOUR_DLP_CONTRACT_POOL"
# Optional: Your own DLP token contract address once deployed to the network, useful for local testing

DLP_TOKEN_SATORI_CONTRACT="0x.....YOUR_DLP_TOKEN_CONTRACT"

# The private key for the DLP, follow "Generate validator encryption keys" section in the README
PRIVATE_FILE_ENCRYPTION_PUBLIC_KEY_BASE64="LS0B...........................E9DSy0tLS0tCg=="
```

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

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)

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

### # Validator Setup <a href="#validator-setup" id="validator-setup"></a>

#### Ensure you're in the `vana-dlp-chatgpt` directory: <a href="#ensure-youre-in-the-vana-dlp-chatgpt-directory" id="ensure-youre-in-the-vana-dlp-chatgpt-directory"></a>

```
cd ~
cd vana-dlp-chatgpt
```

#### Fund Validator with DLP Tokens <a href="#fund-validator-with-dlp-tokens" id="fund-validator-with-dlp-tokens"></a>

For DLP creators:

1. Import DLP token to Metamask using `<DataLiquidityPoolToken address>`
2. Send 10 your own DLP tokens to your coldkey address and hotkey address

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 <a href="#register-as-a-validator" id="register-as-a-validator"></a>

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

#### Register your validator: <a href="#register-your-validator" id="register-your-validator"></a>

```
./vanacli dlp register_validator --stake_amount 10
```

```
./vanacli dlp approve_validator --validator_address=<your hotkey address from Metamask>
```

### Run Validator <a href="#run-validator" id="run-validator"></a>

```
poetry run python -m chatgpt.nodes.validator
```

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

Find path of Poetry:

```
echo $(which poetry)
```

#### Create service: <a href="#create-service" id="create-service"></a>

```
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
```

#### Start service <a href="#start-service" id="start-service"></a>

```
sudo systemctl daemon-reload && \
sudo systemctl enable vana.service && \
sudo systemctl start vana.service && \
sudo systemctl status vana.service
```

### Check log: <a href="#check-log" id="check-log"></a>

```
sudo journalctl -u vana.service -f
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.rpcdot.com/vana-1/vana-node-setup-dlp-validator-moshka/vana-node-setup-dlp-validator-satori.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
