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
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,
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!