Get Started
This guide provides instructions for running the validator using our automatic updater script, run.sh
. It also
introduces the optional --start-generate
flag, which enables the generation of JSON files corresponding to trade data.
These files can be sold to customers using the Request Network (further instructions pending).
Requirements
Before running a validator, follow these steps:
- Ensure PTN is installed.
- Install pm2 and the jq package on your system.
- Create a
secrets.json
file in the root level of the PTN repo to include your TwelveData API key as shown below:
- Obtain API keys by signing up at data providers’ websites.
- Be careful to format your file as shown above or errors will be thrown when running your validator. Don’t forget the comma!
Installation
Using run.sh
Script
-
Mainnet Execution: Run the validator on the mainnet by executing the following command. Include the
[--start-generate]
flag if you wish to generate trade data: -
Testnet Execution: For testnet operations with optional data generation, use this command:
These commands initialize two PM2 processes:
- Validator Process: Default name
ptn
- Autoupdate Process: Named
sn8
, which checks for and applies updates every 30 minutes.
Synchronizing your validator
Once you confirmed that your validator is able to run, you will want to stop it to perform the manual synchronization procedure. This procedure should be used when your validator is starting for the first time or experiences unexpected downtime. After the procedure is complete, your validator will have the most update to date miner positions and will be able to maintain a high trust score.
Please follow the steps here for performing the synchronization.
Get emissions
Register to the root network using the btcli
:
To register your validator to the root network on testnet use the --subtensor.network test
flag.
Then set your weights for the subnet:
To set your weights on testnet --subtensor.network test
flag.
Stopping your validator
To stop your validator, press CTRL + C in the terminal where the validator is running.
Relaunching run.sh
You will need to do this if you want to change any runtime configuration to run.sh such as adding or removing
the --start-generate
flag. Prepare your new pm2 start run.sh ...
command before proceeding to minimize downtime.
Login to validator and cd into the PTN repo
Active venv
Stop + Delete running pm2 processes
Run new run.sh command (USE YOUR OWN COMMAND)
Save configs
Verify that the ptn and sn8 pm2 processes have status “online” and are running smoothly
Testing
You can begin testing PTN on the testnet with netuid 116. You can do this by using running:
Note this won’t launch the autoupdater. To launch with the autoupdater, use the run.sh command.
Pitfalls
- When running on the testnet, it is crucial to include the
--subtensor.network test
and--netuid 116
flags to ensure proper configuration. - Details on how to sell the generated trade data via the Request Network will be provided when available.
Prevention
-
When running a validator in certain cloud environments such as Runpod, you may not have your Bittensor default port open (8091). This will cause your validator to be unable to communicate with miners and thus have a low VTRUST as your validator isn’t receiving the latest orders. In order to correct this issue, explicitly open a tcp port, and pass this as an arugment with
--axon.port <YOUR_OPEN_PORT>
-
Do not use share API keys across multiple validators/scripts. Each API key corresponds to one allowed websocket connection. Using the API keys across multiple scripts will lead to rate limits and failures on your validator.
-
If you see an a
JSONDecodeError
exception when running your validator, ensure you secrets.json file is correctly formatted with proper commas.
- Read about how-to guides in the Diátaxis framework