Created
May 14, 2021 13:37
-
-
Save jjangg96/c50c98e37e163c10eb9d8da9ffd88011 to your computer and use it in GitHub Desktop.
Increase your voting power automatically.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you want to increase your voting power, you have to get a reward and delegate it to your validator. | |
I share scripts that use `expect` and TCL script code. | |
[reward.exp] | |
#!/usr/bin/expect | |
spawn ag-cosmos-helper tx distribution withdraw-rewards {your validator} --from {your key} --commission --chain-id agorictest-12 --broadcast-mode block -y | |
expect { | |
"Enter keyring passphrase:" { | |
send "{your password of key}\n" | |
exp_continue | |
} | |
} | |
[delegate.exp] | |
#!/usr/bin/expect | |
spawn ag-cosmos-helper tx staking delegate {your validator} {amount of stake token} --from {your key} --chain-id=agorictest-12 --broadcast-mode block -y | |
expect { | |
"Enter keyring passphrase:" { | |
send "{your password of key}\n" | |
exp_continue | |
} | |
} | |
You can make a cron job with `pm2` | |
[cron.json] | |
{ | |
"apps": [ | |
{ | |
"name": "delegate", | |
"script": "sh", | |
"args": [ | |
"-c" ,"/usr/bin/expect /root/scripts/reward.exp ; sleep 180; /usr/bin/expect /root/scripts/delegate.exp ; sleep 1800" | |
], | |
"exec_interpreter": "none", | |
"exec_mode": "fork_mode" | |
} | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment