Skip to content

Validator Setup

Minimum System Requirements

Below is the minimum system requirements for running a validator node on the RedTeam Subnet:

  • Bare Metal Server
  • GPU with 24-GB VRAM
  • Ubuntu 22.04 LTS
  • NVIDIA Driver
  • 32-GB RAM
  • 512-GB Storage
  • 8-Core CPU

Setup Instructions

To set up a validator node on the RedTeam Subnet, follow these steps:

  1. Prerequisites

  2. Install the latest version of the RedTeam Subnet repository.

    # Clone the repository
    git clone https://github.com/RedTeamSubnet/RedTeam && cd RedTeam
    
    # Create and activate a virtual environment
    python -m venv .venv
    source .venv/bin/activate
    
    # Install the dependencies
    pip install -e .
    
  3. Install Docker Engine (guide from official Docker documentation):

    For Ubuntu: https://docs.docker.com/engine/install/ubuntu

    # Uninstall old versions:
    for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
    
    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    echo \
    "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
    $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    
    # Install docker engine, CLI, containerd, buildx, and compose:
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    

    To verify the installation, run:

    sudo docker run hello-world
    

    Post-installation steps: https://docs.docker.com/engine/install/linux-postinstall

    # Enable docker service and containerd service to start on boot:
    sudo systemctl enable docker.service
    sudo systemctl enable containerd.service
    
    # Add docker group:
    sudo groupadd docker
    
    # Add your user to the docker group:
    sudo usermod -aG docker ${USER}
    
    # Activate the changes to current user session:
    newgrp docker
    # Or restart your system to apply the changes:
    sudo shutdown -r now
    
    # Verify that you can run docker commands without sudo:
    docker run hello-world
    
    # Check docker info and version:
    docker version
    docker info
    
  4. Install PM2 Process Manager

    # Install NVM (Node Version Manager):
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
    
    # Activate NVM:
    source ~/.bashrc
    
    # Check NVM version:
    nvm --version
    
    # Install Node.js and npm:
    nvm install --latest-npm --alias=default [NODE_VERSION]
    # For example:
    nvm install --latest-npm --alias=default 22.14.0
    
    # Set the default Node.js:
    nvm use default
    
    # Check Node.js and npm versions:
    node --version
    npm --version
    
    # Install PM2 globally with logrotate:
    npm install -g pm2
    pm2 install pm2-logrotate
    
    # Check PM2 version:
    pm2 --version
    
  5. Login to Hugging Face Hub

    Authenticate your Hugging Face Hub account. Run the following command to log in:

    huggingface-cli login
    

    You will be prompted to enter your Hugging Face access token. Visit Hugging Face Access Tokens to generate one if you don't have it already.

  6. Custom Setup for Specific Challenges

    For setup instructions related to specific challenges, please refer to the Validator Custom Setup.

  7. Start the validator node:

    # Activate the virtual environment if not already activated
    source .venv/bin/activate
    
    # Start the validator process
    pm2 start python --name "validator_snxxx" \
        -- -m neurons.validator.validator \
        --netuid xxx \
        --wallet.name "wallet_name" \
        --wallet.hotkey "wallet_hotkey" \
        --subtensor.network <network> \ # default is finney
        --validator.cache_dir "./.cache/" \ # Your local cache dir for miners commits.
        --validator.hf_repo_id "my_username/my_repo" \ # Your HF repo ID for storing miners' commits. You need to create your own repo; recommend creating a new HF account
        --validator.use_centralized_scoring \ # Optional: Recommended for high VTRUST, opt-in to get scores of challenges from a centralized server
    

    Optional flags:

    • --logging.trace - Enable trace logging
    • --logging.debug - Enable debug logging
  8. (Optional but Recommended) Start the Auto-Update Script

    # Activate the virtual environment if not already activated
    source .venv/bin/activate
    
    # Start auto-updater
    pm2 start python --name "validator_autoupdate" \
        -- -m scripts.validator_auto_update \
        -- --process-name "validator_snxxx"