Guide - Miner

Setup Subscription Key for Miners on UI to connect to Dojo Subnet for scoring

Note: URLs are different for devnet, testnet and mainnet. Testnet: https://dojo-testnet.tensorplex.ai Mainnet: https://dojo.tensorplex.ai

To get started as a miner or validator, these are the common steps both a miner and validator have to go through.

The following guide is tailored for distributions utilizing APT as the package manager. Adjust the installation steps as per the requirements of your system.

We will utilize ~/opt directory as our preferred location in this guide.

Install PM2 (If not already installed)

cd dojo/scripts/setup/
./install_pm2.sh

Install Docker (If not already installed)

./install_docker.sh

Clone the project, set up and configure python virtual environment

# 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/

# Set up python virtual environment and pip packages
# Here we use venv for managing python versions

python3 -m venv env
source env/bin/activate
pip install -e .
# for developers, install the extras
pip install -e ".[dev]"
  1. Activate the python virtual environment

source env/bin/activate
  1. Create your wallets and register them to our subnet

# create your wallets
btcli wallet new_coldkey

btcli wallet new_hotkey

# register your wallet to our subnet
# Testnet
btcli s register --wallet.name coldkey --wallet.hotkey hotkey --netuid 98 --subtensor.network test
  1. Retrieve the API Key and Subscription Key with Dojo CLI

# Start the dojo cli tool
# Upon starting the CLI it will ask if you wanna use the default path for bittensor wallets, which is `~/.bittensor/wallets/`.
# If you want to use a different path, please enter 'n' and then specify the path when prompted.
dojo

# TIP: During the whole process, you could actually use tab-completion to display the options, so you don't have to remember them all. Please TAB your way guys! 🙇‍♂️
# It should be prompting you to enter you coldkey and hotkey
# After entering the coldkey and hotkey, you should be in the command line interface for dojo, please authenticate by running the following command.
# You should see a message saying "✅ Wallet coldkey name and hotkey name set successfully."
authenticate

# Afterwards, please generate an API Key with the following command.
# You should see a message saying:  "✅ All API keys: ['sk-<KEY>]". Displaying a list of your API Keys.
api_key generate

# Lastly, please generate a Subscription Key with the following command.
# You should see a message saying:  "✅ All Subscription keys: ['sk-<KEY>]". Displaying a list of your Subscription Keys.
subscription_key generate

# :rocket: You should now have all the required keys, and be able to start mining.

# Other commands available to the CLI:
# You can always run the following command to get your current keys.
api_key list
subscription_key list

# You can also delete your keys with the following command.
api_key delete
subscription_key delete
  1. Create .env file

Please refer to the Official Links to double check any URLs.

# copy .env.miner.example
cp .env.miner.example .env

# ENV's that needs to be filled for miners:
DOJO_API_KEY="sk-<KEY>"
# Please select one
DOJO_API_BASE_URL="https://dojo-api-testnet.tensorplex.ai"
  1. Start the miner by running the following commands:

# For Testnet
pm2 start main_miner.py \
--name dojo-miner \
--interpreter env/bin/python3 \
-- --netuid 98 \
--wallet.name coldkey \
--wallet.hotkey hotkey \
--logging.debug \
--axon.port 9602 \
--neuron.type miner \
--scoring_method "dojo" \
--subtensor.network test

Last updated