SteemJS Tools - Witness Update HTML Tool

in utopian-io •  15 days ago

Do you want to broadcast your update_witness command but the cli_wallet is timing out on you or not connecting to the RPC?

You can't find the file where you saved the update_witness command and it's too long to even remember?

You're missing blocks and you're scrambling to log onto your server but the data center is down?

You're on the beach sipping margarita, you have your laptop hooked on the local Wi-Fi but all your communication clients and apps are on your home computer?

What was the command again: update_witness or witness_update?

In other words, you need to switch your public signing key or disable your witness but you're stuck!


As witnesses, we all experienced such inconveniences too often. That's why I'm glad to share with you a tool I've developed to make things a little easier and snappier. All you need is an internet connection, a browser and a mouse.

No, the other type of mouse.


GitHub Repository : https://github.com/Jolly-Pirate/witness-update-html

Months ago, I was creating a tool that could be used in a browser to broadcast the witness update command. Unfortunately, I stumbled on a bug in Steem-JS that prevented me from completing the project. In Steem-JS, When trying to broadcast the signing key to disable the witness, it errors about an Invalid sequence tag. The issue was reported in October 2017 but no fix had been done (https://github.com/steemit/steem-js/issues/267). I even offered a 20 STEEM reward to fix the bug but nobody had a solution for it. Finally, after months of waiting (and frustration), @netuoso came up with a fix that worked. Big thanks to @netuoso for taking the time to look into my request (after some nagging). The pull request is at https://github.com/steemit/steem-js/pull/390. With that fix, I could finally finish what I started.

I present to you


STEEM Witness Update HTML Tool

tool1.png

Features

  • HTML for ease of use in any modern browser.
  • Portability, can be saved on a USB stick.
  • AES-256 encryption of the active key for safe storage in the configuration file.
  • Selectable public signing keys.
  • Selectable RPC nodes.
  • Witness disabling.

Requirements

  • Steem-JS
  • Crypto-JS
  • JQuery
  • Bootstrap
  • Font Awesome

Since the fix hasn't been reviewed and merged yet by Steemit's developers, you can either use the included steem.min.js I built, or build your own. I have used the latest Steem-JS v0.7.1 on Ubuntu 16.04:

Install the latest NodeJS v10.x (10.6 at time of this release)

sudo apt-get purge -y --auto-remove nodejs npm
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

Install Steem-JS

git clone https://github.com/steemit/steem-js.git
cd steem-js
curl https://patch-diff.githubusercontent.com/raw/steemit/steem-js/pull/390.patch | git apply
npm install

Then copy /dist/steem.min.js into the same folder as the html file.

Setup

git clone https://github.com/Jolly-Pirate/witness-update-htmlor download the zipped files.

Configuration

  • Copy the config.json.example and save it as config.json in the same folder as the HTML file.
  • Open config.json in a plaintext editor and modify it with your settings. Follow the JSON format to add or remove values.

For the wif parameter, you have two options: either use your private active key, or encrypt it with a password then store it in the config file. I highly recommend you do the latter, which brings us to the following steps:

  • Open the HTML file in a browser.
  • Go to the Encryption Tool tab, paste your witness private active key, set a strong password and click Encrypt. The encrypted string will change everytime you click the button because of the random salt; don't worry, the password will decrypt the strings just fine.
  • Click Decrypt to test the decryption.
  • Select the encrypted text and paste it as the wif value in the config.json.

tool2.png

Usage

It's straighforward and self-explanatory.

  • Refresh the HTML page or go to the Broadcast Command tab.
  • Enter your decryption password (leave blank if your active key is in plaintext).
  • Click Load Settings, select the public signing key you wish to use (or enter it manually).
  • Click Broadcast or Disable Witness, depending on your needs.

tool3.png

I encourage every witness to learn and understand how things are done manually first (cli_wallet, compiling, etc) before using convenience tools like this one. I hope you like it.

Disclaimer

I'm not responsible for any bugs, misuse or potential bad outcome. I have tested the code extensively and didn't find any issues. Nevertheless, unmerged pull requests are experimental so use at your own risk. When the fix is approved, I'll update the repo to enable the <script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script> line, instead of <script src="steem.min.js"></script>.

ADDENDUM

Please redownload the files from the repository and re-encrypt your password, I did some important changes:- Increase encryption strength against bruteforce attacks by hashing the password with high iterations. The encryption/decryption now takes ~2 seconds instead of a few milliseconds, which makes bruteforcing harder. Thanks to @therealwolf for the tip and discussion about it.

  • Update Crypto-JS library CDN
  • Cleanup comments
  • Minor HTML changes
  • Upload the correct patched steem.min.js

Available & Reliable. I am your Witness. I want to represent You.

🗳 If you like what I do, consider voting for me 🗳

Vote

Check my guide about Voting for Witnesses.
Go to https://steemit.com/~witnesses. My name is listed in the Top 50. Click once.
Alternatively you can use SteemConnect to vote for me or set me as proxy

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

ADDENDUM

Please redownload the files from the repository and re-encrypt your password, I did some important changes:

  • Increase encryption strength against bruteforce attacks by hashing the password with high iterations. The encryption/decryption now takes ~2 seconds instead of a few milliseconds, which makes bruteforcing harder. Thanks to @therealwolf for the tip and discussion about it.
  • Update Crypto-JS library CDN
  • Cleanup comments
  • Minor HTML changes
  • Upload the correct patched steem.min.js

That's great. Thanks. I was using a simple python script that I wrote but it requires python. It's not built-in everywhere. :)

A small feedback to get better reviewing scores at Utopian:

  • Commit messages should be descriptive. "Update x.html" kind of commit messages don't make much sense to the other people browsing the git history.

One side note, we parse the contributions and tag their repositories from the content with an assumption that the first link through the Github is the repository of the contribution. That would be great if you keep it that way for your next post.


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]

·

Hey @emrebeyler
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

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

Vote for Utopian Witness!

·

Update witness_update_tool.htmlon the github, I was removing some leftover comments from the code, will keep in mind to make the changes more descriptive next time :)

True pirate can use a whistle to update his parameters.

·

Non-pirates don't have a whistle. A magic wand also works (requires a level 99 sorcery skill).

Well done @drakos! You successfully guessed the match result.

Quater Finals - Brazil vs Belgium
Click on the badge to view your Board of Honor.
Do you want to know your current ranking? Read this post

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Russia vs Croatia


Do you like the SteemitBoard World Cup Contest?
Vote for @steemitboard as a witness and get one more award!

No, the other type of mouse.

You broke my rib. :))))

Wonderful Robert

That's really cool, drakos!

I remember when I missed one of my first blocks and my failover script didn't disable the witness.

I didn't understand it at first, since the code wasn't buggy or anything. But I found out as well, that steemjs/dsteem didn't support the nullkey.

Hope it gets merged soon!

·

Quite annoying isn't it! I'm disappointed the devs never bothered to fix it although it's been reported months ago. Perhaps it's low priority given their numerous projects, but it's crucial for witnesses.

·
·

Well, it's just a bug in the library which means you can still manage with straight RPC over JSON. One thing that can be done is just not use the library for this task. Also, while it is low priority, it's also low hanging fruit. Unlike documentation, it's super easy to review this. If tests are passing (too bad they aren't), then there should be no problem getting this change in.

Still, there haven't been hardly any merges in a long long time and it's really sad. Point being, I wouldn't hold my breath that this gets approved.

Instead, maybe what people would really want is a PR to steemconnect that does this. That way the feature could be offered as a service instead of witnesses having to implement their own. For example, it would be really cool to see this in @steemchiller's steemworld that allowed you to auth over steemconnect.

Okay, I get about 50% of this, but I'm impressed at what you've created. And your writing is entertaining enough that even glazing over much of the technical stuff I totally enjoyed it.

You're on the beach sipping margarita, you have your laptop hooked on the local Wi-Fi but all your communication clients and apps are on your home computer?

Sir Pirate, ye make me laugh often. Thank ye kindly.

Grrrr what ya say mate?
You got my vote here and as a witness.

·

Yarghhh, many thanks, says I.

·
·

I like your parrot.

just Awesome..

Awwwww.... the first kind of mouse I keep it :) ! so cuteeeee!

I read your publication and I feel totally ignorant, I really admire all your knowledge. When I grow up I want to be like you.😜✌

When my Interne improves I will follow your advice. 👌

that was needed one

I haven't a clue what all this means, but I know you witness work very hard, so if it makes your life easier, hurrah! :)

Well done @drakos! You successfully guessed the match result.

Quater Finals - Sweden vs England
Click on the badge to view your Board of Honor.
Do you want to know your current ranking? Read this post

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Quarter Finals - Day 1


Do you like the SteemitBoard World Cup Contest?
Vote for @steemitboard as a witness and get one more award!

Congratulations @drakos! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Quarter Finals - Day 1


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

It is a very interesting tool in fact facilitating the work anywhere is a breakthrough!

Hey @drakos
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!

Hi!! How have you been? I have been absent/present, looking for jobs in real life!
I am a dinosaur with technology, once I gave you my upvote to be a witness, isn't enough?
Salut from Cambodia :)

·

Of course I remember you. Where have you been?

·
·

I'm slightly anxious because I will be jobless in 2 months and 20 days so...in my free time, when I don't satisfy my sex addiction, I must look for jobs online! And you?

Well done @drakos! You successfully guessed the match result.

Semi Finals - France vs Belgium
Click on the badge to view your Board of Honor.
Do you want to know your current ranking? Read this post

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Croatia vs England


Do you like the SteemitBoard World Cup Contest?
Vote for @steemitboard as a witness and get one more award!

Awesome Tool! May i suggest some margins between the HTML entities? :D

·

I write my code in Netbeans and use its formatter.

Well done @drakos! You successfully guessed the match result.

Semi Finals - Croatia vs England
Click on the badge to view your Board of Honor.
Do you want to know your current ranking? Read this post

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Semi Finals - Day 1


Do you like the SteemitBoard World Cup Contest?
Vote for @steemitboard as a witness and get one more award!

Congratulations @drakos! You have received a personal award!

SteemitBoard World Cup Contest
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The results, the winners and the prizes

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Did you fall into a big toilet hole? :D