Advertisement
Gryph_The_Grey

report.sh

Mar 11th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #sendtip.sh
  2. #!/bin/bash
  3. shopt -s expand_aliases
  4. RESTAPI_PORT=3101
  5. MY_POOL_ID="0c5b04c5c2163ace868018c94e0a0ea105c57188d9aa8aa0ac1ee85e55cb0305"
  6. MY_USER_ID="8d6f2066-f33c-41bd-a6ef-cb0ef513d9ec" # on pooltool website get this from your account profile page
  7. THIS_GENESIS="8e4d2a343f3dcf93" # We only actually look at the first 7 characters
  8.  
  9. if [ ! $JORMUNGANDR_RESTAPI_URL ]; then export JORMUNGANDR_RESTAPI_URL=http://127.0.0.1:${RESTAPI_PORT}/api; fi
  10. alias cli="$(which jcli) rest v0"
  11.  
  12. lastBlockHeight=$(cli node stats get --output-format json | jq -r .lastBlockHeight)
  13. echo ${lastBlockHeight}
  14. if [ "$lastBlockHeight" != "" ]; then
  15. curl -G "https://tamoq3vkbl.execute-api.us-west-2.amazonaws.com/prod/sharemytip?poolid=${MY_POOL_ID}&userid=${MY_USER_ID}&genesispref=${THIS_GENESIS}&mytip=${lastBlockHeight}"
  16. fi
  17.  
  18. #report.sh
  19. watch -n 15 "jcli rest v0 node stats get --host "http://127.0.0.1:3101/api" \
  20. && jcli rest v0 stake-pool get 0c5b04c5c2163ace868018c94e0a0ea105c57188d9aa8aa0ac1ee85e55cb0305 --host "http://127.0.0.1:3101/api" \
  21. && ./sendtip.sh"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement