📌 claim_rewards.sh
A script to automate claimrewards. For security reasons you should only automate this, if you have configured a permission that can only perform the claimrewards action.
Create your claimer account
As an added layer of security, we can create a separate subaccount and wallet just for actioning the claimrewards
. The worst thing that could happen if this was compromised would be that a kind hacker could claim the rewards for you ಠ‿ಠ
.
In these examples, replace blockmatrix
for your own producer name.
- Create a new public/private key pair:
cleos create key
- Create a new wallet and save the wallet password:
cleos wallet create -n claims
- Import the private key created earlier:
cleos wallet import CLAIM_PRIVATE_KEY -n claims
- Activate the
claimrewards
action for this new account:
cleos set account permission eos42freedom claims '{"threshold":1,"keys":[{"key":"CLAIM_PUBLIC_KEY","weight":1}]}' "active" -p eos42freedom@active
cleos set action permission eos42freedom eosio claimrewards claims