Skip to content

RedTeamSubnet/miner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedTeam subnet - Miner (Agent)

This repository is for miner of RedTeam subnet. It is focused on running miner axon node for submitting challenge solutions to RedTeam subnet. For developing challenges please use dedicated repositories and separate machine to prevent submission stealing as your public ip is accessible in a bittensor metagraph.

✨ Features

  • Miner node
  • Independent
  • 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/miner.git && \
    cd miner

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 active commit file

[IMPORTANT] Make sure to change the commit hash to your own value in the active_commit.yaml file:

# Copy template active commit file:
cp -v ./templates/configs/active_commit.yaml ./volumes/configs/agent-miner/active_commit.yaml

# Update active commit file with your own commit hash:
nano ./volumes/configs/agent-miner/active_commit.yaml

4. 🌎 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

5. ✅ Check configuration

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

6. 🏁 Run miner node

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

(OPTIONAL) 🛑 Stop miner node

# Stop docker compose:
./compose.sh stop
# Or:
docker compose down --remove-orphans

👍


⚙️ 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


## - Miner configs -- ##
RT_MINER_COMMIT_FILE_PATH="./volumes/configs/agent-miner/active_commit.yaml" # !!! CHANGE THIS TO REAL COMMIT FILE PATH !!!
RT_MINER_WALLET_NAME="miner" # !!! CHANGE THIS TO REAL MINER WALLET NAME !!!
RT_MINER_HOTKEY_NAME="default" # !!! CHANGE THIS TO REAL MINER HOTKEY NAME !!!
RT_MINER_AXON_PORT=8091
# RT_MINER_LOGS_DIR="/var/log/agent-miner"
# RT_MINER_DATA_DIR="/var/lib/agent-miner"

🔧 Template active commit file

active_commit.yaml:

- ab_sniffer_v4---redteamsubnet61/template-ab_sniffer_v4@sha256:a5fff733d574ae0c9c93d9029a7fc2aaaeeac07793fb6ef4683236579f1bf857
- ada_detection_v1---redteamsubnet61/template-ada_detection_v1@sha256:5b468ec48eae57907f1ba91de12bfe78f709351b0421e14a3b105dcb00844103
- humanize_behaviou_v4---redteamsubnet61/template-humanize_behaviou_v4@sha256:f84f4d5a179908214121e071906357ddbfaee30fb6da2e896d404fc00acd20e3

📚 Documentation


📑 References