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. Devnet: https://dojo-dev.tensorplex.dev Testnet: https://dojo.tensorplex.dev Mainnet: https://dojo.tensorplex.ai

  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
# Devnet
btcli s register --wallet.name coldkey --wallet.hotkey hotkey --netuid 1 --subtensor.network ws://13.213.1.80:9946

# 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

# 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-dev.tensorplex.dev" | "https://dojo-api.tensorplex.dev" | "https://dojo-api.tensorplex.ai"
  1. Start the miner by running the following commands:

# For Devnet
pm2 start main_miner.py \
--name dojo-miner \
--interpreter env/bin/python3 \
-- --netuid 1 \
--wallet.name coldkey \
--wallet.hotkey hotkey \
--logging.debug \
--axon.port 9602 \
--neuron.type miner \
--scoring_method "dojo" \
--subtensor.network ws://13.213.1.80:9946

# 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