ADVERTISEMENT

Missed Blocks Bot for Witnesses (Block Producers) on Telegram

5 days ago

Yesterday I got notified by @murda-ra who asked if I could setup a script for missed blocks which I did earlier for some other Graphene / Chainbase powered chains for Smoke.io
Screenshot 2018-12-05 at 08.58.39.png

Since then I found some time to get the script running on my notification server, through a simple bot interface in a (private) channel on Telegram.

What is it and why is it useful?
All Smoke data is stored on a blockchain (you got that already right :D). The witnesses (block producers) validate and add your transactions, whether a blog, comment, upsmoke, transfer and other actions to the blockchain in a block, once their round to produce one comes. If they start missing on blocks they need to add in their timeframe, the Smoke base becomes less stable, because your transaction gets delayed.

So this "Missed blocks" script notifies individual witnesses (block producers) when they miss a block. Because many have Telegram on multiple devices, including their phone they receive a notification, triggering them to check on the health of their block producing node and keeping the Smoke.io network stable.

How does it work?
The script is a basic python script, utilising the grapheneapi library importing it's GrapheneWebsocketRPC class. Every 30 seconds the script loops through the witness list and compares the amount of missed blocks of the given witnesses compared to the already known data. If it increases, it will trigger a telegram notification in the Missed Blocks channel.

Why is the Telegram channel private?
Although the missed blocks data is publicly available on the Smoke chain, we chose to keep the channel private as it is just a "notification service" which we could, in network related emergency cases (should they ever occur), also use to send out an alert to all active witnesses in private, for example when an instant vulnerability needs to be patched.

I am a Smoke witness, how can I be added to the notification bot?
The bot works by @'-handle-ing your Telegram username in the notifications channel. First step is to have a Telegram @-address (most of you already have that). Then in the Smoke Witness channel, reply to the currently pinned message with your Smoke.io witness name and @telegram username, like so: "smoke_witness_username" : "@telegram_username" so I can add the mapping to the script.

Greetings from Amsterdam,

@roelandp


I run a block producing node on Smoke.io, therefor I am a smoke witness. My witness name is @roelandp - You can vote for witnesses on https://smoke.io/~witnesses - your vote(s) matter so give it some thought!

#witness #python #blockproducing #witness-category


Get 4.2 Free Smoke Power On Sign Up To Start Your Journey On Smoke! The First Cannabis Community That Pays You To Post And Curate Content You Love..
Sort Order:  Trending

I sent my witness name and telegram name on discord witness channel. Could you please add me to the telegram notification distribution.

Thank you for setting this up!

you did a good job) with this you help witnesses and us mere mortals)))))
Bravo!
everywhere you succeed on Steemit and here on Smoke ! by the way glad to see you

·

you need to give me your telegram username :) so i can add you. I noticed you missed a block earlier today, so you would have been notified :)

·
·

He is currently traveling - believe tomorrow will pick up our messages :D

This is great i tell you(even if i am not yet a witness but aspiring to be ).Its another way of developing the platform and witnesses also!!!

I know that you are doing a great job and that is why you are my witness too on steemit... Great work you´re doing here! KUDOS!

This is awesome! Thank you for taking the time to create this for us. :-)

amazing work really nice

Thanks for all the hard work everyone does here.

Many thanks for the great work and what you´re contributing to this community!

This looks great! Will help them out quite a bit!

Nice work yall totally resmoked this!

great job guys like you are putting in here @roelandp @stoner @curationbro @raz @powerpics...welldone!!

you're the man @roelandp!

Great job from you and the whole team. 👍

Great job and thanks for making all this possible. To all witnesses.

Awesome work. Hopefully, I could build some bot for Smoke. Right now, just busy building a private bot ;)