____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Wolf's Witness Essentials - Witness Watcher & Pricefeed

BY: @therealwolf | CREATED: July 8, 2018, 12:18 a.m. | VOTES: 128 | PAYOUT: $182.87 | [ VOTE ]

[IMAGE: https://cdn.steemitimages.com/DQmeQgmQ75Qm7mHjiJQfLpmbkgaQuZhRXvkTaNHK6AQ5GqW/witness_essentials.png]

Essentials Scripts for STEEM Witnesses - written in Typescript.

I'm very excited to introduce Wolf's Witness Essentials. A project containing scripts, which kind every Witness uses, brought to the next level!

Github: https://github.com/therealwolf42/witness-essentials

Witness Watcher

Witness Watcher is a script, that watches for missed blocks of your witness.

In case of a missed block, the witness signing-key gets changed in order to either fall-back to another server or to disable the witness.

Features

Pricefeed

Pricefeed is a script that gets the current STEEM-price of major exchanges and publishes the pricefeed for your witness.

Features

Info

Both scripts have been tested and are working, but I'm taking no responsibilities for any bugs. Please review the source-code yourself.

Getting Started

Both scripts use the same config-files.

Setup

First off, make sure you have npm/yarn & node installed. Then:

1.) Clone Repository

git clone https://github.com/therealwolf42/witness-essentials.git
cd witness-essentials

2.) Install dependencies

yarn / npm i

3.) Copy config.json from config.example.json

cp config.example.json config.json

4.) Edit config.json

nano config.json

You will get notified if any required fields are missing when running the scripts.

{
  "RPC_NODES": [
    "https://api.steemit.com",
    "https://steemd.privex.io",
    "https://gtg.steem.house:8090",
    "https://rpc.buildteam.io",
    "https://steemd.minnowsupportproject.org"
  ],
  "WITNESS": "", // add your witness account-name here
  "TEST_MODE": false, // changing this to true, will result in no witness-update changes or alerts
  "ENABLE_ENCRYPTION": false, // Encryption doesn't work with PM2. Use tmux for that.
  "EXCHANGES": [
    "bittrex",
    "binance",
    "huboi",
    "upbit"
  ],
  "PEG": 1,
  "INTERVAL_FEED": 60,
  "INTERVAL_WATCHER": 10,
  "BACKUP_KEYS": [ // add your backup-keys here - e.g. "5JZ52MJF...","6TSF24FS..."
  ],
  "MISSED_BLOCKS_THRESHOLD": 1,
  "USE_SMS_ALERT": true,
  "SMS_PROVIDER": "nexmo|twilio", // choose nexmo or twilio
  "USE_EMAIL_ALERT":true,
  "EMAIL_TO":"",
  "EMAIL_FROM":"",
  "ALERT_AFTER_EVERY_MISSED": true,
  "ROTATE_KEYS": false, // rotate between your current signing & backup-keys
  "ROTATE_ROUNDS": 1 // -1 is endless
}

5.) Create an .env file (touch .env) with the following variables, but without the comments.

API_KEY= // API Key for NEXMO or TWILIO
API_SECRET= // API Secret for NEXMO or TWILIO
PHONE_NUMBER= // Incl. country-code: e.g. 49123456789 (+49 would be Germany) - required for both NEXMO and TWILIO
FROM_NUMBER= // Only required for TWILIO
ACTIVE_KEY= // Only required if you don't want to use the encryption feature
ENCRYPTED_ACTIVE_KEY= // You will get an encrypted key after you started either Witness Watcher or Pricefeed for the first time
GOOGLE_MAIL_ACCOUNT= // Email Account where emails are getting send from - required if you want to use Email Alerts with GMAIL
GOOGLE_MAIL_PASSWORD= // Same as above

Starting

Witness Watcher

yarn run watcher

Or with PM2 (keep in mind that encryption doesn't work with PM2 due to the missing functionality for readline)

pm2 start npm --name=watcher -- run watcher
pm2 save
pm2 logs watcher

Pricefeed

yarn run pricefeed

Or with PM2 (keep in mind that encryption doesn't work with PM2 due to the missing functionality for readline)

pm2 start npm --name=pricefeed -- run pricefeed
pm2 save
pm2 logs pricefeed

Test SMS

yarn run test_sms

Test EMAIL

yarn run test_email

Questions or Feedback?

Please let me know in the comments below if you have any questions or feedback!

Have you voted for me yet?

If you believe that I'm a trustworthy witness - then please consider voting for me. Either through a click on the image below or at: https://steemit.com/~witnesses

TAGS: [ #witness ] [ #witness-category ] [ #steem ] [ #utopian-io ] [ #development ]

Replies

@theadmiral0 | July 8, 2018, 12:33 a.m. | Votes: 1 | [ VOTE ]

Thanks for this! I've been interested in starting up my own nodes and trawling through loads of specific guides and versions that don't contain some of the info you've got here.

@therealwolf | July 8, 2018, 1:15 a.m. | Votes: 0 | [ VOTE ]

You're welcome, even though there isn't so much knowledge in this post. It's more a guide on how to use the Witness Watcher & Pricefeed scripts.

@aiyub99 | July 8, 2018, 12:33 a.m. | Votes: 0 | [ VOTE ]

Hi, thank you so much, sorry plz comment my post. https://steemit.com/partiko/@aiyub99/partiko--lesson-13--cardinal-vs-ordinal-utility

Posted using Partiko Android

@crimsonclad | July 8, 2018, 2:31 a.m. | Votes: 1 | [ VOTE ]

The key rotation rounds are a nice touch; good work~

@therealwolf | July 8, 2018, 11:46 a.m. | Votes: 0 | [ VOTE ]

Thanks crimson!

@roundbeargames | July 8, 2018, 4:46 a.m. | Votes: 1 | [ VOTE ]

i'm no witness but this is cool stuff :)
thanks for sharing.

@therealwolf | July 8, 2018, 11:47 a.m. | Votes: 0 | [ VOTE ]

Thanks man!

@lordnigel | July 8, 2018, 7:18 a.m. | Votes: 0 | [ VOTE ]

Hey man,

Off topic but - I'm trying to setup my first witness server; there is very little help for someone doing it first time. Anyways I have learned heaps, this is my 9th attempt. I finally got it to sync with SteemD after pre-downloading the block_log. But silly me I decided to Ctrl_C before the Steemd --replay finished...now when I run I get this crazy message blocklog excetin cannot reindex an empty chain...Oh man I don't want to have to download the whole block_log and start again..any ideas how to save me? I'm asking around but so far no luck.. Cheers.

@therealwolf | July 8, 2018, 3:03 p.m. | Votes: 1 | [ VOTE ]

Hey @lordnigel,

I'm not sure where the problem is, but I've seen that you've asked for help on steem.chat. Hope everything turned out well!

@lordnigel | July 9, 2018, 10:39 a.m. | Votes: 0 | [ VOTE ]

Thanks mate - not easy business being a witness. I'll keep learning and working at it. Cheers

@emrebeyler | July 8, 2018, 3:57 p.m. | Votes: 2 | [ VOTE ]

Thanks. It's great to know how other witnesses solve the same problems. :)

One quick note about utopian compatibility:

Your witness vote request at the end of post, almost takes all my screen on my Macbook.

Even though, this is not strictly forbidden, we have a note on our guidelines for this:

> Asking for Steem witness votes in a disruptive way

Which we expect a small text or link for the self-witness promotion.

Other than that, thanks for the quality contribution.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

@therealwolf | July 8, 2018, 7:29 p.m. | Votes: 0 | [ VOTE ]

Thanks @emrebeyler.

I've made the footer & text a bit smaller :)

@utopian-io | July 9, 2018, 6 a.m. | Votes: 0 | [ VOTE ]

Hey @therealwolf
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

@kayyam09 | July 9, 2018, 10:52 a.m. | Votes: 0 | [ VOTE ]

@therealwolf Hello there. I use Smart Steem just as much as everyone else. I was wondering if I could be part of this amazing team. I was actually thinking to implement various GIF banners for the referral process. I mean, We only have one option that is provided by the website right? Everyone is bored of seeing the same old animation over and over again. Moreover, I can help in implementing various graphics that can be used for posts and all. Check out my profile to see my work and the various items I offer for free like banners and page dividers. Moreover, I can help with any other thing that is related to Steemit. Do get back to me on Discord(@kayyam09) or on Facebook(Surfraz M Umar Kayyam).

@samhacker | July 11, 2018, 7:23 p.m. | Votes: 0 | [ VOTE ]

plz fellow me and upvoting me

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>