Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Increase your voting power automatically.
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