Mining 101

Before mining you must register the hotkey of your wallet into a UID slot on one of Bittensor's subnetworks, once this UID is yours you can run your own miner, or select one of Bittensor's many pre-built miners.


Running Pre-Built Miners

Bittensor's pre-built miners are installed from source. For instance,

1$ git clone https://github.com/opentensor/bittensor.git
2$ python3 -m pip install -e bittensor/
3$ tree bittensor
4    bittensor/                             
5        neurons/                            # Miners and Validators across all subnetworks.
6            text_prompting/                 # Miners and Validators for the text_prompting subnetwork.
7                miners/                     # Miners.
8                    GPT4ALL/                # The root folder for the GPT4ALL miner.
9                        neuron.py           # GPT4ALL miner main script.
10                        requirements.txt    # GPT4ALL requirements.
11                        README.md           # GPT4ALL instructions.
12                    ...

Each miner comes with unique requirements and instructions in their source directory bittensor/neurons/<subnetwork>/miners/<miner name>.

1# Installing miner requirements
2python3 -m pip install -r bittensor/neurons/text_prompting/miners/GPT4ALL/requirements.txt

Each miner contains unique setup and hyperparameterization instructions. We recommend reading detailed instructions about each miner through their --help commands.

1# Reading miner --help.
2python3 bittensor/neurons/text_prompting/miners/GPT4ALL/neuron.py 
3    --help

Runing the miner.

1python3 bittensor/neurons/text_prompting/miners/GPT4ALL/neuron.py 
2    --netuid SUBNETWORK_TARGET_UID
3    --wallet.name YOUR_WALLET_NAME 
4    --wallet.hotkey YOUR_HOTKEY_NAME 
5    --logging.debug 

Running with PM2

It is recommended that you run miners using a process manager such as PM2.

1sudo apt-get install npm
2npm install pm2
3pm2 start <path to neuron.py> 
4    --name my_miner 
5    --interpreter python3 
6    -- ... your args i.e. --wallet.name ...