create account

Use Peakd Beacon in your Python projects to find reliable nodes by themarkymark

View this thread on: hive.blogpeakd.comecency.com
· @themarkymark ·
$13.97
Use Peakd Beacon in your Python projects to find reliable nodes
![](https://steemitimages.com/DQmSsFP8BDE1DkXNN9hh1729MRexyqupLEKfWJTsRskjt33/image.png) 

Earlier today @peakd announced their new [Node Beacon Project](https://peakd.com/hive-139531/@peakd/announcing-the-hive-node-beacon-project) which allows you to find the best working nodes in real-time.

This is really handy for Peakd to allow you to automatically switch to an optimal node, especially right now when nodes are being replayed at the same time.

I thought this would be really handy for python scripts to be able to intelligently select nodes that are performance best at the current time.  Beem, the python library I use, already has similar support but it isn't as up to date as Beacon.

I created and made public a simple wrapper for the Beacon api to allow you to use it easily in your scripts.  

[GitHub Repo](https://github.com/officiallymarky/best_hive_nodes)

Using the library is really easy to use and understand.  Feel free to submit a pull request if you think of any improvements.  The code is licensed MIT and free to use anyway you like.

```
from best_hive_nodes import get_best_hive_nodes

print(get_best_hive_nodes())
```

Normally you wouldn't print the nodes but feed them into beem like this:

```
from beem import Hive
from best_hive_nodes import get_best_hive_nodes

nodes = get_best_hive_nodes()
hive= Hive(node=nodes)
```

The get_best_hive_nodes will query the @peakd Node Beacon api and return a **list** of the best nodes.  You can optionally specify a score (typically 80-95) you want returned, if you don't it will use 90 as the default score.  Unfortunately, there are not always nodes above 90 and it will return all nodes returned by the api (typically 80+ score) if it cannot find a single node meeting your score.

I recommend you visiting https://beacon.peakd.com/ to see how the nodes are tested and what the typical scores look like.

As of right now, all nodes are 89% or lower.

https://i.imgur.com/jhAvLVo.png

If it is unable to connect to the Beacon api, it will return a list of default nodes that are "usually" working.

As the nodes are currently in a constant state of flux, this library can help ease the difficulty of finding a working node.  If you have script that is running 24/7, you can have it update your node list from time to time.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 331 others
👎  , , , , ,
properties (23)
authorthemarkymark
permlinkuse-peakd-beacon-in-your-python-projects-to-find-reliable-nodes
categorydevelopment
json_metadata{"app":"peakd/2020.10.9","format":"markdown","tags":["development","python","hivenodes","technology","palnet","neoxian","archon"],"users":["peakd"],"links":["/@peakd","/hive-139531/@peakd/announcing-the-hive-node-beacon-project","https://github.com/officiallymarky/best_hive_nodes","/@peakd","https://beacon.peakd.com/"],"image":["https://steemitimages.com/DQmSsFP8BDE1DkXNN9hh1729MRexyqupLEKfWJTsRskjt33/image.png","https://i.imgur.com/jhAvLVo.png"]}
created2020-10-31 04:58:27
last_update2020-10-31 04:58:27
depth0
children8
last_payout2020-11-07 04:58:27
cashout_time1969-12-31 23:59:59
total_payout_value7.920 HBD
curator_payout_value6.051 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,297
author_reputation1,776,784,446,245,050
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,326,914
net_rshares70,960,728,675,228
author_curate_reward""
vote details (401)
@aryankk ·
I am still waiting for your reply. Why are you flagging my post?
properties (22)
authoraryankk
permlinkqj21e6
categorydevelopment
json_metadata{"app":"hiveblog/0.1"}
created2020-10-31 07:13:21
last_update2020-10-31 07:13:21
depth1
children0
last_payout2020-11-07 07:13:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length64
author_reputation73,219,812,103,313
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,818
net_rshares0
@aryankk ·
You have much power so you will downvote to small users ?
properties (22)
authoraryankk
permlinkqj21fi
categorydevelopment
json_metadata{"app":"hiveblog/0.1"}
created2020-10-31 07:14:09
last_update2020-10-31 07:14:09
depth1
children0
last_payout2020-11-07 07:14:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length57
author_reputation73,219,812,103,313
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,824
net_rshares0
@aryankk ·
@themarkymark  hey motherfucker you did not flag this post. https://hive.blog/hive-116702/@aryankk/vycbqhsg 


How did you miss it?
properties (22)
authoraryankk
permlinkqj2mnz
categorydevelopment
json_metadata{"users":["themarkymark"],"links":["https://hive.blog/hive-116702/@aryankk/vycbqhsg"],"app":"hiveblog/0.1"}
created2020-10-31 14:52:48
last_update2020-10-31 14:52:48
depth1
children0
last_payout2020-11-07 14:52:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length131
author_reputation73,219,812,103,313
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,331,792
net_rshares0
@mytechtrail ·
GitHub link not working yet?
👍  
properties (23)
authormytechtrail
permlinkre-themarkymark-qj1w3m
categorydevelopment
json_metadata{"tags":["development"],"app":"peakd/2020.10.9"}
created2020-10-31 05:18:57
last_update2020-10-31 05:18:57
depth1
children2
last_payout2020-11-07 05:18:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation19,007,675,085,002
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,083
net_rshares8,470,572
author_curate_reward""
vote details (1)
@themarkymark ·
It should be public now.
properties (22)
authorthemarkymark
permlinkre-mytechtrail-qj1w6r
categorydevelopment
json_metadata{"tags":["development"],"app":"peakd/2020.10.9"}
created2020-10-31 05:20:51
last_update2020-10-31 05:20:51
depth2
children1
last_payout2020-11-07 05:20:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length24
author_reputation1,776,784,446,245,050
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,102
net_rshares0
@mytechtrail ·
Thanks, now working.
properties (22)
authormytechtrail
permlinkre-themarkymark-qj1wfl
categorydevelopment
json_metadata{"tags":["development"],"app":"peakd/2020.10.9"}
created2020-10-31 05:26:09
last_update2020-10-31 05:26:09
depth3
children0
last_payout2020-11-07 05:26:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation19,007,675,085,002
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,147
net_rshares0
@peakd ·
$0.03
BTW Peak Node Beacon **Github repository** is here: https://github.com/peak-projects/peakd-node-beacon 

👍  ,
properties (23)
authorpeakd
permlinkre-themarkymark-qj1wa8
categorydevelopment
json_metadata{"tags":["development"],"app":"peakd/2020.10.9"}
created2020-10-31 05:23:00
last_update2020-10-31 05:23:00
depth1
children0
last_payout2020-11-07 05:23:00
cashout_time1969-12-31 23:59:59
total_payout_value0.013 HBD
curator_payout_value0.013 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length105
author_reputation318,612,260,913,704
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,119
net_rshares231,220,517,366
author_curate_reward""
vote details (2)
@poshbot ·
https://twitter.com/Bhattg18/status/1322437951582687233
properties (22)
authorposhbot
permlinkre-use-peakd-beacon-in-your-python-projects-to-find-reliable-nodes-20201031t072138z
categorydevelopment
json_metadata"{"app": "beem/0.24.8"}"
created2020-10-31 07:21:39
last_update2020-10-31 07:21:39
depth1
children0
last_payout2020-11-07 07:21:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation5,554,335,374,496
root_title"Use Peakd Beacon in your Python projects to find reliable nodes"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id100,327,867
net_rshares0