Please refer to Validator HOWTO Guide
Tested on Ubuntu 18.04, using this commit.
Please backup and remove your db.json to start with a clean one before running v1.3
- Python 3 (Tested on 3.6.8)
- working Full-node that completed sync
- configured lite-client and validator-engine-console
- default keys and wallet (as shown in Validator HOWTO Guide) stored along with executables
- executables (fift, lite-client, validator-engine-console)
- configured env variable $FIFTPATH
- recover-query.boc which you can obtain by running (
fift -s recover-stake.fif
) - wallet smart contract in the masterchain (-1 identifier)
- sufficient amount of Grams for validation purposes (20k will result in continuous process of validation in testnet)
- tonos-cli v0.1.29 - Tested to work
#set env variable in .bashrc file using export, here user=ton
export FIFTPATH=/home/ton/ton-sources/ton/crypto/fift/lib:/home/ton/ton-sources/ton/crypto/smartcont
export BETTER_EXCEPTIONS=1
sudo apt install python3-pip
sudo apt install python3-venv
python3 -m venv env
if you use bash -> source env/bin/activate
#After that your promt will change
#Place requirements.txt and validator.py in directory with executables
pip install -r requirements.txt
#Run and check the output
python validator.py
#To exit run
deactivate
Place validator.py along with executables and run
python validator.py
Backup your node config because the script makes a lot of keys.
We recommend to check the output and the source code.
As seqno of your wallet smartcontracts changes - old .boc files are useless, so we don't keep them.
If everything is OK, these files will be periodically overwritten:
- return-stake.boc
- validator-to-sign.bin
- validator-query.boc
- finish.boc
Run the script with watch for a couple of days to test it:
(env) ton@server /m/o/T/b/950e2> watch -n 1800 -d "python validator.py"
When you have checked everything you can proceed and configure running the script with cron:
*/3 * * * * cd /path/to/DIR && env/bin/python validator.py > /dev/null 2>&1
Refer to a good article about cron and python.
Script logs the results of its works to last.log file and to separate directories regarding anything about current elections.
Also, it stores stats and keys in DB file.
The db file is a json generated by TinyDB.
You can parse it by running cat db.json | jq -r '._default' | jq '[.[]]'
to get readable output.
See how to get some graphs and good-looking charts at everstake/ton-helpers