create account

Monitor Witness Price Feed Script by themarkymark

View this thread on: hive.blogpeakd.comecency.com
· @themarkymark ·
$68.02
Monitor Witness Price Feed Script
![surprised-1184889_960_720.png](https://files.peakd.com/file/peakd-hive/themarkymark/23w2mFZaAzNsW81ugx4DQqJtn8r9jhvBHns4oNsrcLFu21BBTgFkqKp2cUszVAtYzUCZo.png)

I've noticed a few witness have been having stale price feeds.  They usually get around to fixing it, but sometimes it takes a few days.

I run a simple script that monitors my price feed and alerts me if it is stale by over 8 hours.

There are a lot of reasons why a price feed may be stale, sometimes the script trips up and needs to be restarted, or node issues prevent the your feed from broadcasting.  Whatever the reason, knowing when your feed is stale is extremely helpful and responsible as a witness.

Below you will find the script I use to monitor my feed and use Pushover to send me a Push notification when it is stale.  Feel free to use it and change out the notification service for something you prefer.

You will need python, Beem, and a Pushover account to use this script.  You are free to use it as you please.  I recommend using something like PM2 to keep it running.

```
import requests
import time

from beem import Hive
from beem.witness import Witness
from datetime import datetime, timedelta, timezone

witnesses = []
feed_time_threshold = 8 * 60 * 60
delay = 60 * 60

pushover_endpoint = 'https://api.pushover.net/1/messages.json'
pushover_app_key = ''
pushover_key = ''


def send_pushover_notification(message):
  requests.post(pushover_endpoint, data={"token": pushover_app_key,
     "user": pushover_key, "message": message})


def get_witness_feed_update_time(witness):
        return Witness(witness)['last_hbd_exchange_update']


def check_witness_feed(witness, date):
        print(witness, datetime.now(timezone.utc) - date)
        if (datetime.now(timezone.utc) - date).total_seconds() > feed_time_threshold:
                send_pushover_notification(f"{witness} feed is stale")


while(True):
        for witness in witnesses:
                check_witness_feed(witness, get_witness_feed_update_time(witness))
        time.sleep(delay)
```
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 680 others
πŸ‘Ž  , , , , , , , , , , , , ,
properties (23)
authorthemarkymark
permlinkmonitor-witness-price-feed-script
categoryhive-160391
json_metadata{"app":"peakd/2022.11.2","format":"markdown","tags":["witness","development","technology","palnet","hive-engine","archon","pob","vyb","cent"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/themarkymark/23w2mFZaAzNsW81ugx4DQqJtn8r9jhvBHns4oNsrcLFu21BBTgFkqKp2cUszVAtYzUCZo.png"]}
created2022-12-03 13:02:09
last_update2022-12-03 13:02:09
depth0
children20
last_payout2022-12-10 13:02:09
cashout_time1969-12-31 23:59:59
total_payout_value34.074 HBD
curator_payout_value33.949 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,043
author_reputation1,669,421,895,185,076
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,815,637
net_rshares144,869,151,132,652
author_curate_reward""
vote details (758)
@akumagai ·
Gotdang I can sort of understand the script you got there.

I guess my 100 day code challenge is kind of doing its work on me. Of course I am more inclined to say it is a 1000 day challenge.

I don't have a witness so I will just thank you for everyone's behalf.

Thank you!
πŸ‘  , , ,
properties (23)
authorakumagai
permlinkrmc3e3
categoryhive-160391
json_metadata{"app":"hiveblog/0.1"}
created2022-12-03 21:22:51
last_update2022-12-03 21:22:51
depth1
children0
last_payout2022-12-10 21:22: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_length274
author_reputation70,516,766,654,676
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,826,061
net_rshares1,274,269,805
author_curate_reward""
vote details (4)
@cherepin ·
Now I understand why no one sees my content. Thank God I took a break from my blog. Thanks a lot for the informative post. Good luck sir.
πŸ‘  , , ,
properties (23)
authorcherepin
permlinkre-themarkymark-rmbihl
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:51:21
last_update2022-12-03 13:51:21
depth1
children5
last_payout2022-12-10 13:51: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_length137
author_reputation3,520,306,315,035
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,472
net_rshares1,279,320,471
author_curate_reward""
vote details (4)
@themarkymark ·
properties (23)
authorthemarkymark
permlinkre-cherepin-rmbiis
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:52:06
last_update2022-12-03 13:52:06
depth2
children1
last_payout2022-12-10 13:52:06
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_length44
author_reputation1,669,421,895,185,076
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,488
net_rshares-661,228,352,440
author_curate_reward""
vote details (12)
@cherepin ·
$1.03
I know sir. It was the cry of the soul. Thanks for responding to my comment πŸ™
πŸ‘  ,
properties (23)
authorcherepin
permlinkre-themarkymark-rmbjeq
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 14:11:15
last_update2022-12-03 14:11:15
depth3
children0
last_payout2022-12-10 14:11:15
cashout_time1969-12-31 23:59:59
total_payout_value0.514 HBD
curator_payout_value0.515 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length77
author_reputation3,520,306,315,035
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,936
net_rshares2,189,129,524,730
author_curate_reward""
vote details (2)
@traciyork ·
$0.04
I took a quick peek at your profile @cherepin, and my guess is that no one sees your content because you barely interact with anyone else. And when you do, more often than not, you're complaining that no one "sees" your content (which most people would interpret to be a complaint about the lack of upvotes). 

You're also only posting in the general "GEMS" community, instead of specific communities related to your content (where it would have a higher chance of being seen). 

Try joining communities you find interesting, and genuinely engage with people under their posts (not just in a "great post" sort of way), and I'm sure you'll develop a following soon. 
πŸ‘  , , , ,
properties (23)
authortraciyork
permlinkre-cherepin-rmbp00
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 16:12:00
last_update2022-12-03 16:12:00
depth2
children2
last_payout2022-12-10 16:12:00
cashout_time1969-12-31 23:59:59
total_payout_value0.022 HBD
curator_payout_value0.021 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length665
author_reputation423,067,590,762,015
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,819,677
net_rshares94,320,774,344
author_curate_reward""
vote details (5)
@cherepin ·
$1.05
Expected response.  I would say the standard answer.  I could show you 20 accounts whose content you '' don't see.  I think it's useless, a waste of time.  God is your judge.  As for the ,, complaint β€˜β€™, I won’t do this here, it’s just an exchange of information.  Thanks for responding to my comment.
πŸ‘  ,
properties (23)
authorcherepin
permlinkre-traciyork-rmbxz4
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 19:25:57
last_update2022-12-03 19:25:57
depth3
children1
last_payout2022-12-10 19:25:57
cashout_time1969-12-31 23:59:59
total_payout_value0.524 HBD
curator_payout_value0.525 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length301
author_reputation3,520,306,315,035
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,824,054
net_rshares2,233,569,180,373
author_curate_reward""
vote details (2)
@cwow2 ·
$0.06
What does it mean for the witness or everybody else if the price stales?
πŸ‘  , , , ,
properties (23)
authorcwow2
permlinkre-themarkymark-rmbglq
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:10:36
last_update2022-12-03 13:10:36
depth1
children5
last_payout2022-12-10 13:10:36
cashout_time1969-12-31 23:59:59
total_payout_value0.028 HBD
curator_payout_value0.027 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length72
author_reputation179,364,243,171,312
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,815,778
net_rshares121,628,033,501
author_curate_reward""
vote details (5)
@themarkymark ·
Any one witness feed isn't a major problem as all the top 20 feeds are used.  However it isn't uncommon to have one or two or more feeds to break. When you start looking at backup witnesses, it is even worse.
πŸ‘  , , , , ,
πŸ‘Ž  , , , , , , ,
properties (23)
authorthemarkymark
permlinkre-cwow2-rmbgu4
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:15:42
last_update2022-12-03 13:15:42
depth2
children4
last_payout2022-12-10 13:15:42
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_length208
author_reputation1,669,421,895,185,076
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,815,839
net_rshares-222,687,905,625
author_curate_reward""
vote details (14)
@cwow2 ·
$0.03
Is it a problem when a price doesn't update or stales? Like what happens? :D

I am not that techy regarding hive stuff, just curious :D
πŸ‘  , , , ,
properties (23)
authorcwow2
permlinkre-themarkymark-rmbhh4
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:29:27
last_update2022-12-03 13:29:27
depth3
children2
last_payout2022-12-10 13:29:27
cashout_time1969-12-31 23:59:59
total_payout_value0.014 HBD
curator_payout_value0.014 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length135
author_reputation179,364,243,171,312
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,037
net_rshares65,138,646,140
author_curate_reward""
vote details (5)
@networkallstar ·
I told you to burn your Blurts DH... You downvote people promoting Blurt here, then go over there and claim Blurt rewards for yourself???

Don't have enough money for a cup of coffee buddy?
I thought you don't need those 1380 Blurts? What a friggin loser! xD

Read the details here people: 
https: // hive.blog/hive/@networkallstar/scummy-themarkymark-claims-1380-in-blurt-rewards-downvotes-anybody-promoting-blurt-on-hive

of the original on Blurt here:
https: // blurt.blog/witness/@outofthematrix/themarkymark-claims-1380-in-blurt-rewards-downvotes-anybody-promoting-blurt-on-hive
πŸ‘Ž  , ,
properties (23)
authornetworkallstar
permlinkrmgqsp
categoryhive-160391
json_metadata{"app":"hiveblog/0.1"}
created2022-12-06 09:38:51
last_update2022-12-06 09:38:51
depth3
children0
last_payout2022-12-13 09:38: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_length583
author_reputation-5,617,423,063,785
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,891,350
net_rshares-483,839,030,555
author_curate_reward""
vote details (3)
@eniolw ·
It's good to know.
properties (22)
authoreniolw
permlinkre-themarkymark-2022123t143949933z
categoryhive-160391
json_metadata{"tags":["witness","development","technology","palnet","hive-engine","archon","pob","vyb","cent"],"app":"ecency/3.0.29-vision","format":"markdown+html"}
created2022-12-03 18:39:51
last_update2022-12-03 18:39:51
depth1
children0
last_payout2022-12-10 18:39: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_length18
author_reputation200,285,692,709,162
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,822,950
net_rshares0
@kingscrown ·
you cannot make up what you stole here with voting bots and crashing the platform with few free scripts.
you made money here destroying platform with vote selling bots big group.

we have to remove you from the whales and people making money.

@blocktrades @acidyo @steempeak @gtg @arcange @neoxian @good-karma @roelandp @therealwolf @abit @guiltyparties @theycallmedan @trafalgar @resonator @neoxian @v4vapid @transisto @newsflash
properties (22)
authorkingscrown
permlinkrmeggh
categoryhive-160391
json_metadata{"users":["blocktrades","acidyo","steempeak","gtg","arcange","neoxian","good-karma","roelandp","therealwolf","abit","guiltyparties","theycallmedan","trafalgar","resonator","v4vapid","transisto","newsflash"],"app":"hiveblog/0.1"}
created2022-12-05 04:00:18
last_update2022-12-05 04:00:18
depth1
children0
last_payout2022-12-12 04:00:18
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_length431
author_reputation2,123,419,067,549,261
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,858,422
net_rshares0
@nickydee ·
Ah... is this why sometimes things don't load and a message pops up to say try a new node? 
πŸ‘  , , ,
properties (23)
authornickydee
permlinkre-themarkymark-2022123t153143708z
categoryhive-160391
json_metadata{"tags":["hive-160391","witness","development","technology","palnet","hive-engine","archon","pob","vyb","cent"],"app":"ecency/3.0.35-mobile","format":"markdown+html"}
created2022-12-03 13:31:45
last_update2022-12-03 13:31:45
depth1
children2
last_payout2022-12-10 13:31:45
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_length91
author_reputation165,248,831,846,936
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,092
net_rshares1,284,408,784
author_curate_reward""
vote details (4)
@themarkymark ·
properties (23)
authorthemarkymark
permlinkre-nickydee-rmbiez
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 13:49:48
last_update2022-12-03 13:49:48
depth2
children1
last_payout2022-12-10 13:49: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_length22
author_reputation1,669,421,895,185,076
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,816,436
net_rshares-661,287,470,547
author_curate_reward""
vote details (12)
@nickydee ·
Copy that πŸ‘

*learning learning...
πŸ‘  , , ,
properties (23)
authornickydee
permlinkre-themarkymark-rmbmxz
categoryhive-160391
json_metadata{"tags":["hive-160391"],"app":"peakd/2022.11.2"}
created2022-12-03 15:27:36
last_update2022-12-03 15:27:36
depth3
children0
last_payout2022-12-10 15:27:36
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_length34
author_reputation165,248,831,846,936
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,818,571
net_rshares1,282,697,519
author_curate_reward""
vote details (4)
@poshtoken ·
https://twitter.com/1527185679549345792/status/1599402163293552640
<sub> The rewards earned on this comment will go directly to the people( @documentinghive ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.</sub>
properties (22)
authorposhtoken
permlinkre-themarkymark-monitor-witness-price-feed-script16563
categoryhive-160391
json_metadata"{"app":"Poshtoken 0.0.1","payoutToUser":["documentinghive"]}"
created2022-12-04 13:56:48
last_update2022-12-04 13:56:48
depth1
children0
last_payout2022-12-11 13:56: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_length274
author_reputation3,941,425,902,386,420
root_title" Monitor Witness Price Feed Script"
beneficiaries
0.
accountreward.app
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id118,841,015
net_rshares0
@stemsocial ·
re-themarkymark-monitor-witness-price-feed-script-20221203t184027404z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-themarkymark-monitor-witness-price-feed-script-20221203t184027404z
categoryhive-160391
json_metadata{"app":"STEMsocial"}
created2022-12-03 18:40:27
last_update2022-12-03 18:40:27
depth1
children0
last_payout2022-12-10 18:40:27
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_length565
author_reputation22,460,334,324,555
root_title" Monitor Witness Price Feed Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,822,971
net_rshares0