With the recent hiccup on our witness, @bitcoinparadise decided to release a tool for Scorum witnesses to monitor missed blocks from the Discord app called Scorum Witness Notify.
This is a helpful tool that notifies a user on Discord if they miss a block. Missing blocks is an indicator there might be an issue with the witness node or the server it is running on and can help prevent hiccups similar to ours and keep on top of things so the blockchain continues to run as most stable as possible for users to have the best interactions with the platform.
Installation
First, you need a Discord bot account. You can follow the directions here:
https://discordpy.readthedocs.io/en/rewrite/discord.html
Install Node.js. It is recommended to use Node Version Manager(NVM):
https://github.com/creationix/nvm
Then continue with the installation of Scorum Witness Notify.
$ git clone https://github.com/bitcoinparadise/Scorum_Witness_Notify
$ cd Scorum_Witness_Notify
$ npm install
$ npm install @scorum/scorum-js --save
Rename config-example.json to config.json:
$ mv config-example.json config.json
Then set the following options in config.json:
$ sudo nano config.json
{
"rpc_nodes": [
"https://prodnet.scorum.com/",
"ADDITIONAL_NODE_URL"
],
"chain_id": "chain_id, db4007d45f04c1403a7e66a5c66b5b1cdfc2dde8b5335d1d2f116d592ca3dbb1",
"accountname": "USERNAME",
"discorduser": "DISCORD_USER_ID",
"token": "BOT_TOKEN",
}
Run
$ node witness_notify.js
Currently, the failover does not work as it will be added soon.
Most of the config is self-explanatory but the "USERNAME" is the witness account you are monitoring, "DISCORD_USER_ID" is the Discord ID of the user you want the bot to direct message, and the "BOT_TOKEN" is the bot token you get when you first created the Discord bot.
The code is open-source on Github: https://github.com/bitcoinparadise/Scorum_Witness_Notify
Comments