Skip to content

Get Started

Requirements

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

Installation

Clone repository

Terminal window
git clone https://github.com/taoshidev/proprietary-trading-network.git

Change directory

Terminal window
cd proprietary-trading-network

Create Virtual Environment

Terminal window
python3 -m venv venv

Activate a Virtual Environment

Terminal window
. venv/bin/activate

Disable pip cache

Terminal window
export PIP_NO_CACHE_DIR=1

Install dependencies

Terminal window
pip install -r requirements.txt

Create a local and editable installation

Terminal window
python3 -m pip install -e .

Create mining/miner_secrets.json and replace xxxx with your API key.

{
"api_key": "xxxx"
}

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.

Terminal window
btcli wallet new_coldkey --wallet.name miner
btcli wallet new_hotkey --wallet.name miner --wallet.hotkey default

(Optional) Getting faucet tokens

Faucet is disabled on the testnet. Hence, if you don’t have sufficient faucet tokens, ask the Bittensor Discord community for faucet tokens.

Register keys

This step registers your subnet miner keys to the subnet, giving it the first slot on the subnet.

Terminal window
btcli subnet register --wallet.name miner --wallet.hotkey default

To register your miner on the testnet add the --subtensor.network test flag.

Follow the below prompts:

Terminal window
>> Enter netuid (0): # Enter the appropriate netuid for your environment
Your balance is: # Your wallet balance will be shown
The cost to register by recycle is τ0.000000001 # Current registration costs
>> Do you want to continue? [y/n] (n): # Enter y to continue
>> Enter password to unlock key: # Enter your wallet password
>> Recycle τ0.000000001 to register on subnet:8? [y/n]: # Enter y to register
📡 Checking Balance...
Balance:
τ5.000000000 τ4.999999999
Registered

Check that your keys have been registered

This step returns information about your registered keys.

Check that your miner has been registered:

Terminal window
btcli wallet overview --wallet.name miner

To check your miner on the testnet add the --subtensor.network test flag

The above command will display the below:

Terminal window
Subnet: 8 # or 116 on testnet
COLDKEY HOTKEY UID ACTIVE STAKE(τ) RANK TRUST CONSENSUS INCENTIVE DIVIDENDS EMISSION(ρ) VTRUST VPERMIT UPDATED AXON HOTKEY_SS58
miner default 196 True 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0 0.00000 * 134 none 5HRPpSSMD3TKkmgxfF7Bfu67sZRefUMNAcDofqRMb4zpU4S6
1 1 1 τ0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 ρ0 0.00000
Wallet balance: τ4.998999856

Run your Miner

Run the subnet miner:

Terminal window
python neurons/miner.py --netuid 8 --wallet.name miner --wallet.hotkey default --logging.debug

To run your miner on the testnet add the --subtensor.network test flag and override the netuuid flag to --netuid 116.

You will see the below terminal output:

Terminal window
>> 2023-08-08 16:58:11.223 | INFO | Running miner for subnet: 8 on network: ws://127.0.0.1:9946 with config: ...

Get Emissions

Register to the root network using the btcli:

Terminal window
btcli root register

To register your miner to the root network on testnet use the --subtensor.network test flag.

Then set your weights for the subnet:

Terminal window
btcli root weights

To set your weights on testnet --subtensor.network test flag.

Stop your miner

To stop your miner, press CTRL + C in the terminal where the miner is running.

Run 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:

Terminal window
python neurons/miner.py --netuid 116 --subtensor.network test --wallet.name miner2 --wallet.hotkey default --logging.debug --axon.port 8095