If you have a rig mining at [Hiveon](https://hiveon.net), then this script may help you to do automations & notifications. Checking the rig health from this is not the best but I've needed a quick solution for now. (Still delaying to play with HiveOS at API level.) <center></center> <center>Notification example on my mobile</center> *** I was looking for a quick way to restart the rig automatically if it's not sharing to the pool anymore. But cut these logic & lines from here and only left the notifications part. Here is the logic: - Check rig stats from Hiveon - if the hash rate is 0 or the rig looks like it's not connected, then send a notification about the status. Notifications are handled w/ [Pushover](https://pushover.net/). - Repeat (Even though, repeat side should be handled via a crontab entry.) *** ``` import requests import sys from pushover import Client PUSHOVER_TOKEN = "<pushover_token>" machines = [{ "name": "Rig 2.0", "wallet": "<wallet>", "pushover_client_key": "<receiver_key>" }] def send_notification(message, client_key): Client( client_key, api_token=PUSHOVER_TOKEN ).send_message(message, title="HiveON Alert") def check_miners(name, wallet, pushover_client_key): r = requests.get(f"https://hiveon.net/api/v0/miner/{wallet}?currency=ETH") r.raise_for_status() data = r.json().get("data") hash_rate = int(data.get("hashrate")) if not hash_rate or data.get("offlineWorkerCount") > 0: message = f"{name} is not mining! Check the rig." send_notification(message, pushover_client_key) sys.exit(-1) else: mh = round(hash_rate / 1e6, 2) bill = requests.get( f"https://hiveon.net/api/v0/miner/{wallet}/bill?currency=ETH") bill.raise_for_status() stats = bill.json().get("stats") balance = stats.get("balance") message = f"{name} is currently mining with " \ f"{mh} mH. Balance: {balance} ETH." print(message) if __name__ == '__main__': for rig in machines: check_miners(rig["name"], rig["wallet"], rig["pushover_client_key"]) ``` *** <center></center> *** Requires Python3.7+ and requests library. Note that, Hiveon API calls mentioned here are just reverse engineereed. They may change at any time and point. Use the script at your own risk.
author | emrebeyler |
---|---|
permlink | a-python-snippet-to-check-the-hiveon-pool-and-rig-health |
category | python |
json_metadata | {"tags":["hiveon"],"image":["https://images.hive.blog/DQmRcP8YEN4KGM3LX21nHfUWBamkdtJUfKB4v686P127Z9c/heh.jpeg","https://images.hive.blog/DQmTYkvAqBNGicr2ZSK35M7AwNP57a8DWc9DY5mW9WZSGTC/Screen%20Shot%202020-09-20%20at%2022.38.29.png"],"links":["https://hiveon.net","https://pushover.net/"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2020-09-20 20:41:12 |
last_update | 2020-09-20 20:42:30 |
depth | 0 |
children | 0 |
last_payout | 2020-09-27 20:41:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 5.586 HBD |
curator_payout_value | 4.262 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,627 |
author_reputation | 448,535,049,068,622 |
root_title | "A Python Snippet to check the HIVEON pool & rig health" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 99,732,297 |
net_rshares | 41,168,872,547,516 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
boatymcboatface | 0 | 149,846,689,579 | 10% | ||
kingscrown | 0 | 601,877,058,772 | 10% | ||
acidyo | 0 | 11,249,564,258,953 | 100% | ||
theshell | 0 | 40,207,480,029 | 10% | ||
mark-waser | 0 | 460,426,614,015 | 50% | ||
kosimoos | 0 | 530,495,118 | 50% | ||
yury-vas | 0 | 239,203,074,613 | 100% | ||
sharker | 0 | 6,817,140,397 | 12.37% | ||
kibela | 0 | 3,779,719,683 | 13.75% | ||
shaka | 0 | 1,215,135,298,990 | 15% | ||
laoyao | 0 | 47,819,545,954 | 100% | ||
somebody | 0 | 83,195,553 | 100% | ||
midnightoil | 0 | 167,804,370,989 | 100% | ||
alinalazareva | 0 | 973,966,678 | 10% | ||
xiaohui | 0 | 949,541,906,346 | 100% | ||
joele | 0 | 3,533,213,445,314 | 100% | ||
oflyhigh | 0 | 5,235,054,016,448 | 100% | ||
yulan | 0 | 16,461,731,664 | 100% | ||
anech512 | 0 | 9,723,042,612 | 25% | ||
helene | 0 | 1,249,089,124,737 | 100% | ||
uwelang | 0 | 78,201,282,784 | 7.5% | ||
digital-wisdom | 0 | 491,968,034,039 | 50% | ||
ethical-ai | 0 | 1,874,048,199 | 50% | ||
jwaser | 0 | 21,861,229,136 | 50% | ||
bwaser | 0 | 10,002,385,764 | 50% | ||
funnyman | 0 | 797,909,854,282 | 20% | ||
justyy | 0 | 44,414,092,336 | 5% | ||
ellepdub | 0 | 2,475,313,798 | 50% | ||
herpetologyguy | 0 | 269,949,005,016 | 50% | ||
jang | 0 | 226,968,224,384 | 100% | ||
morgan.waser | 0 | 22,552,332,743 | 50% | ||
strong-ai | 0 | 1,919,935,937 | 50% | ||
vannour | 0 | 3,240,817,566 | 3.75% | ||
tangmo | 0 | 94,029,837,981 | 100% | ||
technoprogressiv | 0 | 937,286,004 | 50% | ||
cardboard | 0 | 25,270,258,108 | 100% | ||
blackbunny | 0 | 75,049,954,366 | 100% | ||
lingfei | 0 | 81,203,678,412 | 100% | ||
danielsaori | 0 | 170,695,943,185 | 100% | ||
damla | 0 | 28,322,673,002 | 50% | ||
exec | 0 | 254,001,693,839 | 100% | ||
eval | 0 | 843,388,009 | 100% | ||
ruel.cedeno | 0 | 4,670,129,002 | 100% | ||
maxer27 | 0 | 146,439,390,400 | 25% | ||
ew-and-patterns | 0 | 172,959,905,201 | 9% | ||
eturnerx | 0 | 3,735,177,281,701 | 100% | ||
jacekw | 0 | 46,613,049,966 | 100% | ||
tykee | 0 | 5,703,809,651 | 50% | ||
rafaelaquino | 0 | 11,592,912,259 | 100% | ||
crokkon | 0 | 53,665,802,702 | 100% | ||
revisesociology | 0 | 298,076,888,670 | 20% | ||
msp-foundation | 0 | 0 | 100% | ||
isnochys | 0 | 50,732,277,013 | 28% | ||
investegg | 0 | 340,328,890,404 | 8.95% | ||
long888 | 0 | 55,976,090,231 | 100% | ||
murattatar | 0 | 1,056,818,570 | 20% | ||
unforgettable | 0 | 3,969,943,676 | 100% | ||
steinhammer | 0 | 2,039,524,217 | 25% | ||
emrebeyler | 0 | 2,147,645,665,083 | 100% | ||
not-a-bird | 0 | 11,156,853,133 | 50% | ||
evilest-fiend | 0 | 1,268,595,802 | 50% | ||
mytechtrail | 0 | 41,355,956,671 | 15% | ||
mhm-philippines | 0 | 32,801,917,669 | 24.5% | ||
forkonti | 0 | 562,281,658 | 100% | ||
nathen007 | 0 | 25,729,306,094 | 100% | ||
obvious | 0 | 32,961,999,856 | 15% | ||
nokodemion | 0 | 780,241,904 | 100% | ||
kamchore | 0 | 155,211,280,588 | 100% | ||
fourfourfun | 0 | 7,100,756,767 | 25% | ||
tinowhale | 0 | 21,189,076,196 | 49% | ||
hayirhah | 0 | 1,237,759,350 | 50% | ||
fromhell2sky | 0 | 9,682,294,099 | 24.5% | ||
ydavgonzalez | 0 | 4,138,429,082 | 100% | ||
bala41288 | 0 | 30,831,284,122 | 10% | ||
baycan | 0 | 1,654,868,657 | 20% | ||
samueladams314 | 0 | 1,524,145,209 | 100% | ||
coinmeria | 0 | 750,349,070 | 35% | ||
soyrosa | 0 | 535,901,300,332 | 50% | ||
chorock | 0 | 116,422,428,556 | 10% | ||
cfminer | 0 | 558,959,729 | 100% | ||
lidiceml | 0 | 570,883,880 | 49% | ||
isisfemale | 0 | 1,289,781,818 | 100% | ||
semihbalkanli | 0 | 829,779,732 | 100% | ||
ahmetmertugrul | 0 | 832,386,610 | 100% | ||
sudefteri | 0 | 21,936,765,290 | 100% | ||
tdogvoid | 0 | 571,980,657 | 100% | ||
allyson19 | 0 | 870,210,649 | 8% | ||
agememnon | 0 | 2,332,255,196 | 90% | ||
tipitip | 0 | 802,112,969 | 100% | ||
ahmeterbay | 0 | 10,361,381,341 | 100% | ||
raoul.poenar | 0 | 3,888,024,371 | 100% | ||
cst90 | 0 | 70,008,035,725 | 100% | ||
steempampanga | 0 | 1,304,566,709 | 10% | ||
thomasthewolf | 0 | 29,934,146,693 | 45% | ||
ruh | 0 | 816,119,504 | 100% | ||
nervi | 0 | 2,428,235,633 | 100% | ||
bulent1976 | 0 | 652,028,240 | 100% | ||
muratkbesiroglu | 0 | 45,332,478,400 | 100% | ||
ahmetchef | 0 | 917,172,044 | 50% | ||
mahyulmaulana | 0 | 3,308,488,163 | 100% | ||
sereze | 0 | 1,336,632,844 | 100% | ||
jan23com | 0 | 5,598,657,140 | 90% | ||
emotionalsea | 0 | 918,217,954 | 25% | ||
choco11oreo11 | 0 | 3,426,033,311 | 90% | ||
ecotone | 0 | 8,299,581,453 | 100% | ||
payroll | 0 | 553,277,865,254 | 10% | ||
we-are | 0 | 2,859,846,678 | 16.75% | ||
jumbot | 0 | 63,078,975,047 | 100% | ||
promobot | 0 | 88,230,377,207 | 100% | ||
pladozero | 0 | 75,142,645,939 | 10% | ||
nateaguila | 0 | 445,583,924,494 | 12% | ||
enforcer48 | 0 | 122,714,939,110 | 15% | ||
bilimkurgu | 0 | 19,917,613,859 | 100% | ||
kahvesizlik | 0 | 1,290,567,738 | 100% | ||
moneybaby | 0 | 811,875,997 | 2.5% | ||
luciomcabee | 0 | 646,161,847 | 100% | ||
tahirozgen | 0 | 4,251,177,589 | 100% | ||
pablorg94 | 0 | 606,339,437 | 100% | ||
steinz | 0 | 681,538,435 | 24.5% | ||
thehive | 0 | 106,291,388,799 | 70% | ||
daath | 0 | 0 | 100% | ||
elmauza | 0 | 1,073,677,613 | 100% | ||
littleshadow | 0 | 5,173,294,685 | 90% | ||
joseph6232 | 0 | 1,764,004,983 | 90% | ||
emaillisahere | 0 | 3,170,810,685 | 75% | ||
buzzbee | 0 | 622,500,088 | 50% | ||
ceruleanblue | 0 | 642,410,011 | 100% | ||
altonos | 0 | 31,094,497,179 | 25% | ||
gabbynhice | 0 | 2,820,596,450 | 100% | ||
caoimhin | 0 | 4,069,532,979 | 100% | ||
djtrucker | 0 | 1,429,563,309 | 75% | ||
laissez-faire | 0 | 57,616,510 | 100% | ||
steemituplife | 0 | 652,709,838 | 25% | ||
marshalmugi | 0 | 74,231,936,656 | 85% | ||
podg3 | 0 | 1,676,785,170 | 90% | ||
steemwhalepower | 0 | 944,827,687 | 100% | ||
mister-meeseeks | 0 | 40,369,375,890 | 50% | ||
sbi8 | 0 | 156,786,978,151 | 65.87% | ||
misstaken | 0 | 6,315,794,078 | 90% | ||
anti-bully | 0 | 468,804,673 | 100% | ||
nonsowrites | 0 | 66,666,667,868 | 100% | ||
daisybuzz | 0 | 1,374,117,221 | 75% | ||
jussbren | 0 | 1,956,591,025 | 90% | ||
olivier.jacobs | 0 | 535,554,854 | 100% | ||
criptoanarquista | 0 | 1,569,257,574 | 100% | ||
moneytron | 0 | 367,190,451 | 100% | ||
starrouge | 0 | 603,003,795 | 30% | ||
rasalom | 0 | 15,551,372,549 | 100% | ||
wherein | 0 | 259,869,252,183 | 60% | ||
leviackerman | 0 | 1,547,669,161 | 100% | ||
bluerobo | 0 | 106,871,579,251 | 100% | ||
cnstm | 0 | 163,063,332,765 | 60% | ||
ctime | 0 | 805,464,801,571 | 5% | ||
dpoll.curation | 0 | 65,678,096,496 | 100% | ||
lianjingmedia | 0 | 570,172,283 | 60% | ||
samflow | 0 | 608,721,093 | 100% | ||
realgoodcontent | 0 | 929,374,914 | 100% | ||
cooperfelix | 0 | 1,316,909,000 | 15% | ||
sm-skynet | 0 | 1,296,580,599 | 100% | ||
angelanichole | 0 | 884,753,316 | 50% | ||
cpt-sparrow | 0 | 204,819,097 | 100% | ||
bitcoinator | 0 | 1,586,602,985 | 50% | ||
korle | 0 | 1,980,224,872 | 100% | ||
bigmoneyman | 0 | 899,811,527 | 50% | ||
raspibot | 0 | 3,991,163,035 | 100% | ||
gulf41 | 0 | 2,953,901,372 | 51% | ||
likwid | 0 | 949,946,645,933 | 100% | ||
suigener1s | 0 | 531,594,593 | 100% | ||
yeswecan | 0 | 16,492,760,800 | 90% | ||
boohugs | 0 | 774,954,639 | 100% | ||
sbi-tokens | 0 | 788,289,519 | 2.54% | ||
acta | 0 | 22,365,421,008 | 100% | ||
the-table | 0 | 18,434,734,147 | 90% | ||
cardtrader | 0 | 2,266,578,893 | 100% | ||
thehouse | 0 | 1,826,954,527 | 90% | ||
dpoll.witness | 0 | 9,247,839,512 | 100% | ||
silverquest | 0 | 135,226,872,470 | 90% | ||
honeychip | 0 | 8,295,097,748 | 85% | ||
gmlrecordz | 0 | 4,975,453,286 | 50% | ||
tommys.shop | 0 | 1,673,993,446 | 90% | ||
hivewaves | 0 | 556,763,816 | 75% | ||
blue-witness | 0 | 3,171,423,587 | 100% | ||
hivevenezuela | 0 | 1,260,066,115 | 100% | ||
gitplait | 0 | 77,040,850,365 | 100% | ||
marvschurchill1 | 0 | 1,133,182,392 | 50% | ||
paulman | 0 | 1,451,997,608 | 75% | ||
hivelist | 0 | 6,077,734,832 | 10% | ||
yugimuto | 0 | 1,525,228,730 | 100% | ||
ghaazi | 0 | 4,451,566,410 | 100% | ||
magodelcaosnegro | 0 | 1,524,300,225 | 100% | ||
hivebtc | 0 | 974,714,915 | 100% | ||
ronavel | 0 | 279,569,101,664 | 15% | ||
sagadegeminis | 0 | 1,528,624,101 | 100% | ||
kran6 | 0 | 578,609,041 | 100% | ||
kran7 | 0 | 529,187,480 | 100% | ||
kran8 | 0 | 529,552,451 | 100% | ||
kran9 | 0 | 528,284,574 | 100% | ||
kran10 | 0 | 528,204,536 | 100% | ||
constantinopla | 0 | 979,952,125 | 100% | ||
bellaciao | 0 | 975,623,522 | 100% | ||
jesucristo | 0 | 978,933,178 | 100% | ||
yodinzaku | 0 | 978,538,622 | 100% | ||
lordarianthus | 0 | 978,328,020 | 100% | ||
spiritminer | 0 | 977,997,756 | 100% | ||
drfate | 0 | 977,826,213 | 100% | ||
confucio | 0 | 977,700,742 | 100% | ||
splintergod | 0 | 977,482,445 | 100% | ||
magnor | 0 | 977,279,489 | 100% | ||
meele | 0 | 976,428,396 | 100% | ||
kretchtallevor | 0 | 976,399,331 | 100% | ||
hivecur2 | 0 | 46,966,710,081 | 10% | ||
onyxsentinel | 0 | 974,720,033 | 100% | ||
khymeria | 0 | 974,557,173 | 100% | ||
sicmundus | 0 | 974,573,414 | 100% | ||
lainiwakura | 0 | 974,152,207 | 100% | ||
roymustang | 0 | 973,607,506 | 100% | ||
darkarmy | 0 | 973,610,225 | 100% | ||
reiayanami | 0 | 973,321,649 | 100% | ||
kaiosama | 0 | 973,511,858 | 100% | ||
pitagoras | 0 | 973,447,421 | 100% | ||
steinitz | 0 | 973,248,073 | 100% | ||
kran11 | 0 | 530,323,259 | 100% | ||
kran12 | 0 | 530,517,651 | 100% | ||
kran13 | 0 | 530,546,701 | 100% | ||
kran14 | 0 | 530,546,548 | 100% | ||
kran15 | 0 | 530,599,510 | 100% | ||
kran16 | 0 | 530,517,698 | 100% | ||
kran17 | 0 | 530,546,394 | 100% | ||
anillounico | 0 | 1,476,729,554 | 100% | ||
starino | 0 | 1,733,679,323 | 100% | ||
music.legend | 0 | 1,733,668,164 | 100% |