Please ensure these prerequisites are installed on your system before proceeding with the installation steps, these are needed by both validators and miners.
Clone the project,
# In this guide, we will utilize the ~/opt directory as our preferred location.
cd ~/opt
# Clone the project
git clone https://github.com/tensorplex-labs/dojo.git
cd dojo/
Install PM2, one way is through fnm
# for linux, a convenience script is available
./scripts/setup/install_pm2.sh
# for mac/linux (if you do not trust the bash script)
curl -fsSL https://fnm.vercel.app/install | bash
# for windows, choose 1 of the following,
# based on https://github.com/Schniz/fnm?#manually
cargo install fnm
choco install fnm
scoop install fnm
winget install Schniz.fnm
# run any post-install shell setup scripts
# based on https://github.com/Schniz/fnm?#shell-setup
# assuming we are using zsh
echo 'eval "$(fnm env --use-on-cd --shell zsh)"' >> ~/.zshrc
# you can tell what shell you're using by running:
echo $0
# verify fnm installation
fnm --version
# get npm & node, and verify npm installation
fnm install lst/iron && npm --version
# install pm2 and verify installation
npm install -g pm2 && pm2 --version
# for linux, a convenience script is available
./dojo/scripts/setup/install_docker.sh
# verify both docker and docker compose are installed
docker --version
docker compose version
Create your wallets if they aren't created yet
# run btcli
make btcli
# create your wallets
btcli wallet new_coldkey
btcli wallet new_hotkey
Get some TAO and ensure you have enough TAO to cover the registration cost
# for mainnet, check netuid 52
btcli s list
# for testnet, check netuid 98
btcli s list --subtensor.network test
# output from the `btcli s list ...` command
NETUID N MAX_N EMISSION TEMPO RECYCLE POW SUDO
0 128 128.00 0.00% 10 τ1.00000 10.00 M 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM
...
98 17 256.00 0.00% 360 τ0.00001 18446744.07 T 5GTAfh3YTcokxWdGc3DgLV5y3hHB4Bs5PQGqw9fEn1WrcwWP
...
Note
the "RECYCLE" column represents the subnet registration cost
Register to our subnet
# run the dockerized btcli
make btcli
# register your wallet to our subnet
# for mainnet
btcli s register --wallet.name coldkey --wallet.hotkey hotkey --netuid 52 --subtensor.network finney
# for testnet
btcli s register --wallet.name coldkey --wallet.hotkey hotkey --netuid 98 --subtensor.network test
Validating
Copy the validator .env file and set up the .env file
# copy .env.validator.example
cp .env.validator.example .env
# edit the .env file with vim, vi or nano
# for mainnet
DOJO_API_BASE_URL="https://dojo-api.tensorplex.ai"
# for testnet - uncomment below line if you are using testnet
#DOJO_API_BASE_URL="https://dojo-api-testnet.tensorplex.ai"
# head to https://wandb.ai/authorize to get your API key
WANDB_API_KEY="<wandb_key>"
# for dojo-synthetic-api
OPENROUTER_API_KEY="sk-or-v1-<KEY>"
# Other LLM API providers, Optional or if you've chosen it over Openrouter
TOGETHER_API_KEY=
OPENAI_API_KEY=
# postgres details for validator
DB_HOST=postgres-vali:5432
DB_NAME=db
DB_USERNAME=
DB_PASSWORD=
DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}
Start the validator
# start the validator
# for mainnet
make validator network=mainnet
# for testnet
make validator network=testnet