A simple self delegator bot for any Blockchain on the Cosmos ecosystem
Forked from the Desmos bot
- A cosmos blockchain CLI
- Python >= 3
git clone https://github.com/lorenzoPrimi/selfdeleg.git && cd selfdeleg && mkdir logs
mv template.ini config.ini && nano config.ini
And edit:
CLIENT
with your client command name, andUNIT
with the smallest unit of the tokenKEY_NAME
with your validator key name, andKEY_BACKEND
if you use a different keyring backend.
If you use the test keyring, in the future steps you can replace the password inputs with spaces/random charactersVALIDATOR_ADDRESS
,USER_ADDRESS
,DELEGATE_ADDRESS
, with your addresses. If you want to self delegate,USER_ADDRESS
andDELEGATE_ADDRESS
should match.- If you are installing the bot in a machine that is not running a node/validator configure
DEFAULT_NODE_ADDRESS
andDEFAULT_NODE_PORT
with remote nodes addresses MINIMUM_BALANCE
amount of JUNO that the bot will always keep (minimum 1 JUNO)- The other configuration values are optional
To run the bot, use:
python3 bot.py
This will ask for the keyring password at first, if you don't want to you can use
python3 bot.py password
sudo nano ./start.sh
and change the password:
#!/bin/bash
source ~/.profile
/usr/bin/python3 $HOME/selfdeleg/bot.py password
Then,
sudo nano /etc/systemd/system/selfdeleg.service
and paste changing accordingly the User path and username:
[Unit]
Description=Juno Self Delegator Bot
After=network-online.target
[Service]
WorkingDirectory=/home/ubuntu/selfdeleg/
User=ubuntu
Type=simple
Restart=always
ExecStart=/bin/bash /home/ubuntu/selfdeleg/start.sh
[Install]
WantedBy=multi-user.target
Now you can reload and start the service
sudo systemctl daemon-reload
sudo systemctl start selfdeleg
To follow the daily output:
tail -f ./logs/debug.log