Skip to content

Script to claim BP rewards on TELOS blockchain (can easily be modified for any EOSIO chain)

Notifications You must be signed in to change notification settings

TelosGlobal/claim_rewards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

TELOS CLAIMREWARDS script

This document explains how to setup an automatic recurring claimreward action for bp's on TELOS. This should work on other EOSIO chains with minimal changes.

OVERVIEW

  1. First, we create a new permission "ACCOUNT/claimer" with a unique KEY
  • This unique key will only be allowed to claim tokens to YOUR account. This way, if they key gets compromised it will do little or argueably "no" harm.
  1. Next, we create a separate wallet "claim" and provide ONLY this unique KEY

  2. Create a shell script "claimrewards.sh" to:

  • Unlock this wallet
  • Execute the claimrewards action
  • Lock the wallet
  1. Setup a LOCAL USER cron job to run every hour. (On TELOS, unclaimed rewards don't expire, so we don't need to worry about missing a claim)

INSTALLATION

  1. Create new EOS KEY Pair (there are many ways to do this).
  • NOTE: SAVE the KEY info!
  1. Create permission:

cleos set account permission ACCOUNT_NAME claimer '{"threshold":1,"keys":[{"key":"YOUR_NEW_CLAIMER_PUB_KEY","weight":1}]}' "active" -p ACCOUNT_NAME@active

cleos set action permission ACCOUNT_NAME eosio claimrewards claimer

  1. Create Wallet

cleos wallet create -n WALLET_NAME -f KEY_FILE_NAME

  • NOTE: SAVE the wallet key!
  1. Add NEW key pair to the wallet

cleos wallet import -n WALLET_NAME

  • paste PRIVATE key when prompted
  1. LOCK THE WALLET (OPTIONAL STEP. We do this so it's in correct state for the script)

cleos wallet lock -n WALLET_NAME

5a. COPY THE WALLET from $HOME/telos-wallet folder to `$HOME/eosio-wallet

  • NOTE: I'm not sure why, but seems cleos looks for this wallet in the eosio-wallet folder ¯\(ツ)

cp $HOME/telos-wallet/YOUR_WALLET_NAME.wallet $HOME/eosio-wallet/.

  1. Create the file "claimrewards.sh". See file in this repo.

  2. Make the file executable

sudo chmod 755 claimrewards.sh

  1. Setup LOCAL_USER crontab job
  • NOTE: Need to have local user added to /etc/cron.d/cron.allow
    • If file doesn't exist, create it and all 2 lines:
      • root
      • LOCAL_USERNAME <-replace with your specific username

crontab -e

  • ADD THE FOLLOWING LINE ( will run every top of the hour ):

5 * * * * /FULL_PATH/claimrewards.sh >>/FULL_PATH/claims.log 2>&1

About

Script to claim BP rewards on TELOS blockchain (can easily be modified for any EOSIO chain)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages