Skip to content

RedTeamSubnet/validator

Repository files navigation

RedTeam subnet - Validator (Agent)

This repository is for validator of RedTeam subnet. it is focused on running validator node in an independent, easy to configure, dockerized way with docker compose support. Additionally, it includes additional helper container to automatically update and restart validator image when new version is released.

✨ Features

  • Validator node
  • Automatic updates
  • Easy configuration
  • Dockerized setup
  • Docker Compose support

Getting Started

1. 🚧 Prerequisites


2. 📥 Download or clone the repository

2.1. Prepare projects directory (if not exists):

# Create projects directory:
mkdir -pv ~/workspaces/projects

# Enter into projects directory:
cd ~/workspaces/projects

2.2. Follow one of the below options [A] or [B]:

OPTION A. Clone the repository:

git clone https://github.com/RedTeamSubnet/validator.git && \
    cd validator

OPTION B. Download source code:

  1. Download archived zip or tar.gz file from releases.
  2. Extract it into the projects directory.
  3. Enter into the extracted project directory.

3. 🌎 Configure environment variables

[NOTE] Please, check environment variables section for more details.

[IMPORTANT] Make sure to change the wallet directory and wallet name variables to your own values in the .env file:

# Copy '.env.example' file to '.env' file:
cp -v ./.env.example ./.env

# Edit environment variables to fit in your environment:
nano ./.env

4. ✅ Check configuration

## Check docker compose configuration is valid:
./compose.sh validate
# Or:
docker compose config

5. 🏁 Run validator node

## Start docker compose:
./compose.sh start -l
# Or:
docker compose up -d --remove-orphans --force-recreate && \
    docker compose logs -f --tail 100

⚙️ Configuration

🌎 Environment Variables

.env.example:

## --- Environment variable --- ##
ENV=PRODUCTION
DEBUG=false
# TZ=UTC
# PYTHONDONTWRITEBYTECODE=1


## -- Bittensor configs -- ##
# RT_BT_SUBTENSOR_NETWORK="wss://entrypoint-finney.opentensor.ai:443"


## -- Subnet configs -- ##
# ! WARNING: Do not use `~` character, it will not be expand properly! Use absolute path or ${HOME} instead:
RT_BTCLI_WALLET_DIR="${HOME}/.bittensor/wallets" # !!! CHANGE THIS TO REAL WALLET DIRECTORY !!!
# RT_BT_SUBNET_NETUID=61


## -- Validator configs -- ##
RT_VALIDATOR_WALLET_NAME="validator" # !!! CHANGE THIS TO REAL VALIDATOR WALLET NAME !!!
RT_VALIDATOR_HOTKEY_NAME="default" # !!! CHANGE THIS TO REAL VALIDATOR HOTKEY NAME !!!
# RT_VALIDATOR_LOGS_DIR="/var/log/agent-validator"
# RT_VALIDATOR_DATA_DIR="/var/lib/agent-validator"
# RT_VALIDATOR_USE_CENTRALIZED_SCORING=true

📚 Documentation


📑 References