Usage (Postman+newman+watch):
https://www.miningrigrentals.com/api/v2/
-
Place scripts into pre-request script tab and post-request script tab in Postman (https://www.postman.com)
-
Create environmental variables "api_key" & "api_secret", "chat_id", "bot_id", "hashrate15min" & "hash"
-
Create 2 requests in your collection:
my request1:
GET https://www.miningrigrentals.com/api/v2/rig/ID ID - from miningrigrentals rig id number, which you like to monitor hashrate (please refer to https://www.miningrigrentals.com/apidocv2)
telegram bot:
POST https://api.telegram.org/{{bot_id}}/sendMessage?chat_id={{chat_id}}&text=Hashrate dropped to {{hash}} T/H
-
download and install newman: https://github.com/postmanlabs/newman
-
Export from Postman your collection into coll.json & environmentals to env.json
-
Run script.sh in terminal by using watch:
chmod +x ./script.sh
watch -n x ./script.sh (example: watch -n 900 ./script.sh, run every 15min)
where x - is time interval in seconds at which to execute a command