Hello everyone, I have decided to do little steem updates for the various bits of dev work I do. I just completed work on the first version of a BitShares witness monitoring script with telegram integration. You can find it here: https://github.com/clockworkgr/bitshares-witness-monitor First of all, I would like to acknowledge @roelandp 's work (https://github.com/roelandp/Bitshares-Witness-Monitor) for the inspiration. My monitoring script only checks witness health in its current iteration but price-feed health and seed node might be added in future versions. I've decided to allow almost full control of the monitoring parameters through access controlled telegram commands so in theory you'd almost never have to restart the monitoring script. You can pause it, update backup keys, resume, change API node used as well as update all of the monitoring parameters. For example, if you want very "tight" monitoring, you can set the checking interval to 3 seconds (essentially per block), the missed block threshold to 1 missed block before switching and a very large reset time window. Thus ensuring that your signing key is updated to that of your backup witness as soon as a single block is missed. A "looser" monitoring strategy would be to look for more than 3 missed blocks in quite rapid succession before switching. So missed block threshold at 3, a reset window of 5 minutes (so every 5 minutes the missed block counter gets reset) and checking every 30 secs or so. You can also force a switch to the backup witness on demand in case you need to undertake some work on one of your witness servers etc. If any witnesses try it out please take some time to provide feedback, feature requests or bugs you come across by leaving an issue on GitHub. The following (essentially the repo README file) explains the features better: To use, clone the repo (or download the zip). ``` git clone https://github.com/clockworkgr/bitshares-witness-monitor cd bitshares-witness-monitor npm install ``` Open config-sample.json in your favourite text editor and edit with your own settings: ``` { "witness_id": "1.6.XXX", "api_node": "wss://<your_preferred_api_node>", "private_key": "5kTSOMEPRIVATEKEY111111111111", "missed_block_threshold": 3, "checking_interval": 10, "backup_key": "BTSXXXXXXXXXXXXXXXXXX", "reset_period": 300 "debug_level": 3, "telegram_token": "<telegram_access_token>", "telegram_password": "<chosen_access_password>", "retries_threshold": 3 } ``` and then save as config.json `private_key` The active key of your normal witness-owning account used to sign the witness_update operation. `missed_block_threshold` How many blocks must be missed within a `reset_period` sec window before the script switches your signing key. Recommend to set at 2 or higher since 1 will possibly trigger updates on maintenance intervals (see: https://github.com/bitshares/bitshares-core/issues/504) `checking_interval` How often should the script check for new missed blocks in seconds. `backup_key` The public signing key of your backup witness to be used when switching. `reset_period` The time after which the missed blocks counter is reset for the session in seconds. `debug_level` Logging level. Can be: 0: Minimum - Explicit logging & Errors 1: Info - 0 + Basic logging 2: Verbose - 1 + Verbose logging 3: Transient - 2 + Transient messages but not currently used. `telegram_token` The telegram access token for your notifications bot. You can get one here: https://telegram.me/BotFather `telegram_password` Your chosen access password through telegram. `retries_threshold` Number of failed connections to API node before the bot notifies you on telegram. ## Running Simply use: `node index.js` inside a screen (or similar) session. For peace of mind I recommend you also install the forever tool: `sudo npm install forever -g` and run as: `forever index.js` instead. *NOTE:* In case forever restarts the process, it will start with the DEFAULT config.json you have provided and not with the session-only changes you might have made using the telegram commands below. ## Telegram commands Open a chat to your bot and use the following: `/pass <your_configured_telegram_pass>` This is required to authenticate. Otherwise none of the following commands will work. `/changepass <new_password>` This will update your telegram access password and will require you to authenticate again using `/pass` `/stats` This will return the current configuration and statistics of the monitoring session. `/switch` This will IMMEDIATELY update your signing key to the currently configured backup key. `/new_key <BTS_public_signing_key>` This will set a new backup key in place of the configured one. `/new_node wss://<api_node_url>` This will set a new API node to connect to. `/threshold X` This will set the missed block threshold before updating signing key to X blocks. `/interval Y` This will set the checking interval to every Y seconds. `/window Z` This will set the time until missed blocks counter is reset to Z seconds. `/retries N` This will set the threshold for failed API node connection attempts to N times before notifying you in telegram. `/reset` This will reset the missed blocks counter in the current time-window. `/pause` This will pause monitoring. `/resume` This will resume monitoring.
author | clockwork |
---|---|
permlink | devwork-update-bitshares-witness-monitor |
category | bitshares |
json_metadata | {"tags":["bitshares","witness","graphene"],"users":["roelandp"],"links":["https://github.com/clockworkgr/bitshares-witness-monitor","https://github.com/roelandp/Bitshares-Witness-Monitor","https://github.com/bitshares/bitshares-core/issues/504","https://telegram.me/BotFather"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-06-05 14:09:57 |
last_update | 2018-06-05 14:09:57 |
depth | 0 |
children | 12 |
last_payout | 2018-06-12 14:09:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 37.187 HBD |
curator_payout_value | 9.365 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 5,445 |
author_reputation | 2,206,574,983,916 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 59,377,940 |
net_rshares | 15,295,189,406,875 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
wackou | 0 | 4,948,363,234,091 | 100% | ||
tombstone | 0 | 8,872,811,021,841 | 40% | ||
xeroc | 0 | 118,253,900,055 | 100% | ||
fox | 0 | 23,099,775,982 | 100% | ||
full-steem-ahead | 0 | 242,073,768,203 | 100% | ||
ash | 0 | 595,685,944,382 | 99.8% | ||
chris4210 | 0 | 296,574,790,405 | 100% | ||
malacandrahyoi | 0 | 2,925,275,671 | 100% | ||
intelliguy | 0 | 68,835,357,337 | 100% | ||
paws1t1veev | 0 | 1,124,129,118 | 100% | ||
xfund | 0 | 1,967,019,816 | 100% | ||
diogogomes | 0 | 133,917,551 | 70% | ||
murda-ra | 0 | 10,724,201,054 | 100% | ||
britcoins | 0 | 4,656,874,980 | 100% | ||
toofasteddie | 0 | 20,686,735,993 | 50% | ||
grandslam | 0 | 567,419,633 | 100% | ||
apasia.tech | 0 | 13,609,363,716 | 100% | ||
cliffy32 | 0 | 830,644,646 | 100% | ||
hotbit | 0 | 24,185,713,933 | 100% | ||
swagger | 0 | 53,378,390 | 0.03% | ||
kimchi-king | 0 | 2,915,022,088 | 100% | ||
tt-dogg | 0 | 36,502,041,385 | 100% | ||
bellick4 | 0 | 638,840,719 | 100% | ||
clockwork | 0 | 611,668,308 | 100% | ||
open-asset | 0 | 524,788,639 | 100% | ||
dalexx | 0 | 4,137,474,883 | 100% | ||
freerolll | 0 | 329,457,852 | 100% | ||
bangzi | 0 | 1,679,513,532 | 100% | ||
farmerd | 0 | 600,800,317 | 100% | ||
poppypyro | 0 | 87,332,355 | 100% | ||
python-think | 0 | 0 | -100% |
Very helpful your info for us ...thank you sir
author | alamin1557 |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180618t210446589z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-18 21:06:33 |
last_update | 2018-06-18 21:06:33 |
depth | 1 |
children | 0 |
last_payout | 2018-06-25 21:06:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 46 |
author_reputation | 53,897,364,773 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 61,274,926 |
net_rshares | 0 |
Very helpful your info for us ...thank you sir
author | alamin1557 |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180618t210824562z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-18 21:08:39 |
last_update | 2018-06-18 21:08:39 |
depth | 1 |
children | 0 |
last_payout | 2018-06-25 21:08:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 46 |
author_reputation | 53,897,364,773 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 61,275,108 |
net_rshares | 0 |
Outstanding work @clockwork, along with all of us thanks for your amazing efforts lately towards BitShares Blockchain.
author | apasia.tech |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180605t160019738z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"users":["clockwork"],"app":"steemit/0.1"} |
created | 2018-06-05 16:00:18 |
last_update | 2018-06-05 16:00:18 |
depth | 1 |
children | 0 |
last_payout | 2018-06-12 16:00:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.043 HBD |
curator_payout_value | 0.011 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 118 |
author_reputation | 8,024,713,603,227 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 59,392,773 |
net_rshares | 18,767,488,564 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 7,930,790,699 | 11% | ||
apasia.tech | 0 | 10,258,671,314 | 100% | ||
clockwork | 0 | 578,026,551 | 100% |
And then some... amazing. This is a shining example of witness work on the bitshares blockchain, and probably every witness will be having this available on their mobile phone in no time at all, keeping safe the BitShares decentralized network wherever they may be :)
author | britcoins |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180605t160338617z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-05 16:03:36 |
last_update | 2018-06-05 16:03:36 |
depth | 1 |
children | 0 |
last_payout | 2018-06-12 16:03:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.051 HBD |
curator_payout_value | 0.011 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 267 |
author_reputation | 3,090,086,590,721 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 59,393,249 |
net_rshares | 21,245,480,071 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 7,930,790,699 | 11% | ||
diogogomes | 0 | 131,857,281 | 70% | ||
apasia.tech | 0 | 12,592,572,174 | 100% | ||
clockwork | 0 | 590,259,917 | 100% |
Anything that can help the stability of witness nodes should and will be very popular. Thank you for this!
author | intelliguy |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180605t230650720z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-05 23:06:51 |
last_update | 2018-06-05 23:06:51 |
depth | 1 |
children | 4 |
last_payout | 2018-06-12 23:06:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.067 HBD |
curator_payout_value | 0.016 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 107 |
author_reputation | 62,276,657,564,898 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 59,442,932 |
net_rshares | 28,773,185,804 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 17,664,033,829 | 25% | ||
murda-ra | 0 | 10,509,717,033 | 100% | ||
clockwork | 0 | 599,434,942 | 100% |
Have never actually looked into steem witnesses but this should probably work there as well with very few (if any) changes...
author | clockwork |
---|---|
permlink | re-intelliguy-re-clockwork-devwork-update-bitshares-witness-monitor-20180605t232119430z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-05 23:21:21 |
last_update | 2018-06-05 23:21:21 |
depth | 2 |
children | 3 |
last_payout | 2018-06-12 23:21:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.184 HBD |
curator_payout_value | 0.058 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 125 |
author_reputation | 2,206,574,983,916 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 59,444,403 |
net_rshares | 82,101,317,346 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 71,377,116,292 | 100% | ||
murda-ra | 0 | 10,724,201,054 | 100% |
I think you are very right!
author | intelliguy |
---|---|
permlink | re-clockwork-re-intelliguy-re-clockwork-devwork-update-bitshares-witness-monitor-20180606t151026852z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-06 15:10:27 |
last_update | 2018-06-06 15:10:27 |
depth | 3 |
children | 1 |
last_payout | 2018-06-13 15:10:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.031 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 27 |
author_reputation | 62,276,657,564,898 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 59,542,567 |
net_rshares | 12,388,304,218 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 720,980,972 | 1% | ||
murda-ra | 0 | 10,513,343,236 | 100% | ||
clockwork | 0 | 1,153,980,010 | 100% |
Wow...wow
author | oyan1357 |
---|---|
permlink | re-clockwork-re-intelliguy-re-clockwork-devwork-update-bitshares-witness-monitor-20180606t040325687z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-06 04:03:24 |
last_update | 2018-06-06 04:03:24 |
depth | 3 |
children | 0 |
last_payout | 2018-06-13 04:03:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 9 |
author_reputation | 159,962,673 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 59,470,402 |
net_rshares | 588,482,305 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
oyan1357 | 0 | 588,482,305 | 100% |
Congratulations @clockwork! You have completed some achievement on Steemit and have been rewarded with new badge(s) : [](http://steemitboard.com/@clockwork) Award for the total payout received <sub>_Click on the badge to view your Board of Honor._</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> **Do not miss the [last post](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-russia-vs-saudi-arabia) from @steemitboard!** --- **Participate in the [SteemitBoard World Cup Contest](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd)!** Collect World Cup badges and win free SBD Support the Gold Sponsors of the contest: [@lukestokes](https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1) --- > Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
author | steemitboard |
---|---|
permlink | steemitboard-notify-clockwork-20180613t172451000z |
category | bitshares |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-06-13 17:24:51 |
last_update | 2018-06-13 17:24:51 |
depth | 1 |
children | 0 |
last_payout | 2018-06-20 17:24:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,188 |
author_reputation | 38,975,615,169,260 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,613,043 |
net_rshares | 0 |
This story is so nice, hope that you will write again. This post will be helpful to us in many ways. Thank you very much for your sweet post dear.
author | uniquetips |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180617t081221945z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-17 08:12:24 |
last_update | 2018-06-17 08:12:24 |
depth | 1 |
children | 0 |
last_payout | 2018-06-24 08:12:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 146 |
author_reputation | 2,500,908,423 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 61,067,419 |
net_rshares | 0 |
Thanks for your amazing work. Bitshares exchange bot also can follow this .It is funny to welcome telegram bot when they are in exchange.
author | xfund |
---|---|
permlink | re-clockwork-devwork-update-bitshares-witness-monitor-20180606t092837586z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-06-06 09:28:39 |
last_update | 2018-06-06 09:28:39 |
depth | 1 |
children | 0 |
last_payout | 2018-06-13 09:28:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.041 HBD |
curator_payout_value | 0.011 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 139 |
author_reputation | 424,124,099,848 |
root_title | "DevWork Update: BitShares Witness Monitor" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 59,501,874 |
net_rshares | 18,658,691,960 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
intelliguy | 0 | 7,930,790,699 | 11% | ||
murda-ra | 0 | 10,727,901,261 | 100% |