Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Latest commit

 

History

History
128 lines (107 loc) · 6.02 KB

File metadata and controls

128 lines (107 loc) · 6.02 KB

Validating

Network validation is thus open to participants who have registered a UID on any subnetwork and who have enough TAO staked on their hotkey to be considered a top 128 validator.

Staking

Attaching TAO on your validator can be achieved in two ways.

  1. By staking TAO to your miners directly.
# Stake funds to your hotkey account within the bittensor incentive mechanism.
btcli stake
    --wallet.name YOUR_WALLET_NAME
    --wallet.hotkey YOUR_HOTKEY_NAME
  1. By attracting delegated stake by nominating (and then advertising) your hotkey.
# Nominate your hotkey as a delegate, making it available for delegated stake.
btcli nominate
    --wallet.name YOUR_WALLET_NAME
    --wallet.hotkey YOUR_HOTKEY_NAME

# Delegate funds to the hotkey of a delegate (your own or others)
btcli delegate
    --delegate_ss58key DELEGATE_SS58KEY

Validating on Subnetwork 1 with OpenValidators

If you plan to validate on the text prompting network, after attaining enough TAO for a validator permit we recommend running Bittensor's openvalidators. You can run and install openvalidators from source:

$ git clone https://github.com/opentensor/validators.git
$ pip3 install -e openvalidators/
$ tree validators    
    ├── README.md               # Openvalidator instructions.
    ├── requirements.txt        # Openvalidator requirements.
    ├── analysis/               # Analysis toolkit to facilitate exploration of data generated by openvalidators.
    ├── openvalidators/         # The root folder for the openvalidators code.
    ├── scripts/                # Data extraction toolkit to facilitate data collection from wandb
    ├── setup.py                # Openvalidator installation script
    └── tests/                  # Unit-tests for openvalidators code

or from pip:

pip3 install openvalidators

The openvalidators implementation is set by default to subnetwork 1, following our recommendation.

Running openvalidators with PM2

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

sudo apt-get install npm
npm install pm2
pm2 start validators/openvalidators/neuron.py
    --name my_validator
    --interpreter python3
    -- ... your args i.e. --wallet.name ...

Note: Please be aware that the code for openvalidators is consistently being enhanced. Therefore, it is important to have the most up-to-date version when running it in order to optimize your incentives. We are currently working on an automated mechanism to fetch the latest version continuously, which will be released shortly.

Running a core Validator (for Subnetwork 3)

After attaining enough TAO for a validator permit we recommend running Bittensor's core validator. You can run and install the core validator from source.

$ git clone https://github.com/opentensor/bittensor.git
$ python3 -m pip install -e bittensor/
$ tree bittensor
    bittensor/
        neurons/                            # Miners and Validators across all subnetworks.
            text_prompting/                 # Miners and Validators for the text_prompting subnetwork.
                validators/                 # Validators.
                    core/                   # The root folder for the core validator.
                        neuron.py           # Core validator miner main script.
                        requirements.txt    # Core validator requirements.
                        README.md           # Core validator instructions.
                    ...

Note: Even though you can run the core validator in subnet 1, we strongly advise utilizing openvalidators for this purpose, as it offers enhanced incentives for you.

As of this moment, it's still possible to run the core validator in subnetwork 1. When running the core validator, specify the --netuid 1 parameter to select the appropriate subnetwork for your validator, e.g. Subnetwork 1.

python3 ~/.bittensor/bittensor/neurons/text_prompting/validators/core/neuron.py
    --netuid 1
    --wallet.name YOUR_WALLET_NAME
    --wallet.hotkey YOUR_HOTKEY_NAME
    --logging.trace

Running the core validator with PM2

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

sudo apt-get install npm
npm install pm2
pm2 start <path to validator.py>
    --name my_validator
    --interpreter python3
    -- ... your args i.e. --wallet.name ...

Validator Permit

Only the largest 128 validators, in terms of stake, on any particular subnetwork are considered to have validator permit. Validators with permit are considered active within Bittensor's mining mechanism, Yuma Consensus, can validate the network, and get dividends.

How do I check to see if my validator has permit?

The amount can be pulled from the metagraph based on your uid.

import bittensor as bt
subnet = bt.metagraph(1)
wallet = bt.wallet( name = 'my_wallet_name', hotkey = 'my_validator_hotkey_name' )
my_uid = subnet.hotkeys.index( wallet.hotkey.ss58_address )
print ('validator permit', subnet.validator_permit[ my_uid ])

How much TAO is required to attain a validator permit?

The amount of TAO required is depends on how the other largest 128 wallets distribute TAO across themselves. You can calculate the minimum using bt.metagraph:

import bittensor as bt
subnet = bt.metagraph(1)
stake_requirement = subnet.S.sort()[0][-128:]
print ('validator permit requirement', stake_requirement)