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 projectgitclonehttps://github.com/tensorplex-labs/dojo.gitcddojo/
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-fsSLhttps://fnm.vercel.app/install|bash# for windows, choose 1 of the following,# based on https://github.com/Schniz/fnm?#manuallycargoinstallfnmchocoinstallfnmscoopinstallfnmwingetinstallSchniz.fnm# run any post-install shell setup scripts# based on https://github.com/Schniz/fnm?#shell-setup# assuming we are using zshecho'eval "$(fnm env --use-on-cd --shell zsh)"'>>~/.zshrc# you can tell what shell you're using by running:echo $0# verify fnm installationfnm--version# get npm & node, and verify npm installationfnminstalllst/iron&&npm--version# install pm2 and verify installationnpminstall-gpm2&&pm2--version
# for linux, a convenience script is available./dojo/scripts/setup/install_docker.sh# verify both docker and docker compose are installeddocker--versiondockercomposeversion
Create your wallets if they aren't created yet
# run btclimakebtcli# create your walletsbtcliwalletnew_coldkeybtcliwalletnew_hotkey
Get some TAO and ensure you have enough TAO to cover the registration cost
# for mainnet, check netuid 52btclislist# for testnet, check netuid 98btclislist--subtensor.networktest# output from the `btcli s list ...` commandNETUIDNMAX_NEMISSIONTEMPORECYCLEPOWSUDO0128128.000.00%10τ1.0000010.00M5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM...9817256.000.00%360τ0.0000118446744.07T5GTAfh3YTcokxWdGc3DgLV5y3hHB4Bs5PQGqw9fEn1WrcwWP...
Note
the "RECYCLE" column represents the subnet registration cost
Register to our subnet
# run the dockerized btclimakebtcli# register your wallet to our subnet# for mainnetbtclisregister--wallet.namecoldkey--wallet.hotkeyhotkey--netuid52--subtensor.networkfinney# for testnetbtclisregister--wallet.namecoldkey--wallet.hotkeyhotkey--netuid98--subtensor.networktest
Mining
There are currently 2 options when mining, where Option 1 is to connect to our centralized backend, and Option 2 is to self-host the full-stack worker platform application.
Option 1: Centralised Method
Create .env file with the following values first.
# copy .env.miner.examplecp.env.miner.example.env# ENV's that needs to be filled for miners:# for mainnetDOJO_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"DOJO_API_KEY=# blank for nowWALLET_COLDKEY=# the name of the coldkeyWALLET_HOTKEY=# the name of the hotkeyAXON_PORT=8888# port to serve requests over the public network for validators to call
Run the CLI to retrieve API Key and Subscription Key, see Dojo CLI for usage.
makedojo-cli# remember to use tab completions to see list of commands# authenticate and generate keysauthenticateapi_keygeneratesubscription_keygenerate# list all keysapi_keylistsubscription_keylist
Complete the .env file with the variables below:
DOJO_API_KEY=# api key from step 2.
Start the miner by running the following commands:
# for mainnetmakeminer-centralisednetwork=mainnet# for testnetmakeminer-centralisednetwork=testnet
Option 2: Decentralised Method
Create .env file with the following values first.
# copy .env.miner.examplecp.env.miner.example.env# env vars that needs to be filled for miners:DOJO_API_BASE_URL="http://worker-api:8080"# use this valueDOJO_API_KEY=# blank for nowWALLET_COLDKEY=# the name of the coldkeyWALLET_HOTKEY=# the name of the hotkeyAXON_PORT=8888# port to serve requests over the public network for validators to call# for dojo-uiNEXT_PUBLIC_BACKEND_URL=http://localhost:3000# for dojo-worker-apiREDIS_USERNAME=REDIS_PASSWORD=# postgres detailsDB_HOST=postgres-miner:5432# use this valueDB_NAME=dbDB_USERNAME=DB_PASSWORD=DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}# aws credentials for S3AWS_ACCESS_KEY_ID=AWS_SECRET_ACCESS_KEY=AWS_S3_BUCKET_NAME=S3_PUBLIC_URL=JWT_SECRET=# generate a random JWT keyETHEREUM_NODE=# get an ethereum endpoint URL from Infura
Start the worker api which will be connected to the CLI later.
makeminer-worker-api
Run the CLI to retrieve API Key and Subscription Key, see Dojo CLI for usage.
makedojo-cli
Grab the API key and add it to your .env file
DOJO_API_KEY=# api key from earlier
Now, run the full miner service.
# for mainnetmakeminer-decentralisednetwork=mainnet# for testnetmakeminer-decentralisednetwork=testnet# read miner logs using the following:# for mainnetmakeminer-decentralised-logsnetwork=mainnet# for testnetmakeminer-decentralised-logsnetwork=testnet