Get Started
System Requirements
- Requires Python 3.10.
- Bittensor
Below are the prerequisites for miners. You may be able to make a miner work off lesser specs but it is not recommended.
- 2 vCPU + 8 GB memory
- Run the miner using CPU
Getting Started
1. Install PTN
Clone repository
Change directory
Create Virtual Environment
Activate a Virtual Environment
Disable pip cache
Install dependencies
Note: You should disregard any warnings about updating Bittensor after this. We want to use the version specified in requirements.txt
.
Create a local and editable installation
Create mining/miner_secrets.json
and replace xxxx with your API key. The API key value is determined by you and needs to match the value in mining/sample_signal_request.py
.
2. Create Wallets
This step creates local coldkey and hotkey pairs for your miner.
The miner will be registered to the subnet specified. This ensures that the miner can run the respective miner scripts.
Create a coldkey and hotkey for your miner wallet.
You can list the local wallets on your machine with the following.
2a. Getting Testnet TAO
Discord
Please ask the Bittensor Discord community for testnet TAO. This will let you register your miner(s) on Testnet.
Please first join the Bittensor Discord here: https://discord.com/invite/bittensor
Then request testnet TAO here: https://discord.com/channels/799672011265015819/1190048018184011867
Bittensor -> help-forum -> requests for testnet tao
3. Register keys
This step registers your subnet miner keys to the subnet, giving it the first slot on the subnet.
To register your miner on the testnet add the --subtensor.network test
and --netuid 116
flags.
Follow the below prompts:
4. Check that your keys have been registered
This step returns information about your registered keys.
Check that your miner has been registered:
To check your miner on the testnet add the --subtensor.network test
flag
The above command will display the below:
6. Run your Miner
Run the subnet miner:
To run your miner on the testnet add the --subtensor.network test
flag and override the netuuid flag to --netuid 116
.
To enable debug logging, add the --logging.debug
flag
To enable the local miner dashboard to view your stats and positions/orders, add the --start-dashboard
flag.
You will see the below terminal output:
7. Stopping your miner
To stop your miner, press CTRL + C in the terminal where the miner is running.
Running Multiple Miners
You may use multiple miners when testing if you pass a different port per registered miner.
You can run a second miner using the following example command:
Miner Dashboard
Prerequisites
- A package manager like npm, yarn, or pnpm
Running the Dashboard
Each miner now comes equipped with a dashboard that will allow you to view the miner’s stats and positions/orders.
In order to enable the dashboard, add the --start-dashboard
flag when you run your miner.
This will install the necessary dependencies and start the app on http://localhost:5173/ by default.
Open your browser and navigate to this URL to view your miner dashboard.
Important Note
The miner will only have data if validators have already picked up its orders. A brand new miner may not have any data until after submitting an order.
The miner dashboard queries and awaits responses from a validator. Please allow the dashboard some time to load on startup and refresh.
If you would like to view your miner dashboard on a different machine than your miner:
In order to view the miner dashboard on a different machine from your miner, we recommend opening a ssh tunnel to the
default ports 41511
and 5173
. If you are running multiple miners on one machine or those ports are busy, you can view
the miner startup logs to confirm which ports to use.
41511
is used by the backend miner data API.
5173
is used by the dashboard frontend. This is what you will be connecting to on your local machine.
To create an ssh tunnel:
ex:
As an example if you are using a Google Cloud VM to run your miner:
This will map port 41511
and 5173
on your local machine to the same ports on the miner, allowing you to view your miner’s
dashboard at http://localhost:5173/ on your local machine.
Issues?
If you are running into issues, please run with --logging.debug
and --logging.trace
set so you can better analyze why your miner isn’t running.