HOWTO Setup Witness Node by Yehey

Step by step guide on how to setup a Witness Node. Please see my references at the end of this article. This is not just a server it is a Witness Node server.

You can manually install Steem but @someguy123 prepared STEEM-in-a-Box using Docker with technical add-on courtesy by @drakos and my screen captured installation guide to keep it simple stupid (KISS).

What Server Specification is recommended? I’ve tested it using a minimum requirement listed below. You can buy or rent your server, it’s up to you to decide.

  • 4 CPU
  • 16 GB RAM (8GB minimum)
  • 300 GB SSD (100GB minimum)

I’m using Ubuntu 16.04 LTS for my operating system. I failed to install Steem using the latest version of Ubuntu 17.x, so this procedure is using Ubuntu 16.04 LTS.

When I setup a Server or a workstation. I always set the date and time correct, so I can get a good event logs later on for trouble shooting.

Set your timezone, for me it’s EST (optional)
sudo timedatectl set-timezone America/New_York

Install all dependencies.

sudo apt update

sudo apt install git curl wget

Download Steem in the box courtesy by @someguy123 using git clone.

git clone https://github.com/Someguy123/steem-docker.git

THIS IS IMPORTANT. Logout, re-login, then change directory to steem-docker.

cd steem-docker

Let’s install docker.

./run.sh install_docker

You will see something like this captured screen.

Yehey.com.install.docker

Pre-compile Steem.

./run.sh install

Download a copy of blocks. This will take a couple of hours or shorter depending on your server specifications.

./run.sh dlblocks

Run the wallet.

./run.sh remote_wallet

Create a key pair for your witness.

suggest_brain_key

Yehey.com.remote.wallet.PNG

After running suggest_brain_key, copy your wif_priv_key and pub_key you will use this later on.

Adjust your Witness server memory. MUST re-adjust if server upgrade it’s memory. DO NOT GIVE MORE SHARED MEMORY THAN YOU HAVE ACTUAL RAM AVAILABLE. e.g. In our server specification example, we are using 16GB RAM only use 14G for your shared memory.

sudo ./run.sh shm_size 14G (my initial server, now it is using 24G)

Edit the config.ini file.

nano data/witness_node_data_dir/config.ini

Some data in config.ini file.

# p2p-endpoint = 0.0.0.0:2001
shared-file-size = 14G (my initial server, now it is using 24G)
shared-file-dir = /shm
witness = “yehey”  <– change this using your Steem account ID.
# WIF PRIVATE KEY to be used by one or more witnesses or miners
private-key = 5KfKJ………….

Put in your witness name, and your WIF private key from earlier. Be aware the name needs quotes, while the private key doesn’t. You use the private key (wif_priv_key) you generated earlier and put into notepad.

To disable port forwarding for seeds:

nano .env

On a blank line, put the following:
PORTS=
DOCKER_NAME=witness

./run.sh replay

Check the logs, every 10 minutes. Use this command to see the current logs.

./run.sh logs

or if you want to be nerdy, use this command to see the logs in real-time

docker logs –tail=30 –follow witness

You will see something like this results.

Yehey.com.replay.logs.PNG

and this is the normal logs results.

YEHEY.com.Witness.Blockchain.synched.PNG

Your Witness Node server is synced!

As of October 17, 2017 – Running “top” (or htop if you installed it), currently running 5.6% CPU and 89% MEM. The 89% utilization of Memory is too high if you ask me, but this is enough to run your Witness Node server. In humble opinion, you need to bring up your RAM to at least 24GB or 32GB. This will be your decision on how you will go forward managing your Witness Node server.

YEHEY.com.Top.PNG

I also check docker session, ps -aux | grep docker

That’s a normal operations of my Witness Node server.

We are NOT done. Go to Steemit.com website, login to your account. Click on Wallet, Permission, click on Show Private Key. Your Active Private Key will appear as 5andSomeLongCharacter. Take note, your Active Private Key start in number 5 e.g. 5andSomeLongCharacter.

./run.sh wallet

Set a password, unlock the wallet with the same password, then import your ACTIVE private key from Steemit.com website.

For example.

set_password “MyAlph4Num4r1cP4ssw0rd”
unlock “MyAlph4Num4r1cP4ssw0rd”
import_key 5andSomeLongCharacter

Finally, update your witness information on the network.

update_witness “yehey” “https://steemit.com/witness-category/@yehey/My-Witness-Campaign” “Public_Key_from_Suggest_Brain_Key” {“account_creation_fee”:”0.200 STEEM”,”maximum_block_size”:65536,”sbd_interest_rate”:0} true

If no error, congratulation to you as a Witness!

Now, vote for your self and yehey for Witness, go to https://steemit.com/~witnesses and vote for yehey.

YEHEY.com.Witness.Vote

As Witness, you are expected to send update for Price Feed. Thanks to @someguy123 there is a script ready to go.

Installation of Steem Feed JS.
First, download the git repository, then edit config.json as needed. The interval is in minutes.

git clone https://github.com/Someguy123/steemfeed-js.git
cd steemfeed-js
cp config.example.json config.json
nano config.json

Sample config.json file. The Interval is 60 minutes, to send Price Feed update.

{
“name”: “yehey”,
“wif”: “5KUKG…ACTIVE_PRIVATE_KEY”,
“interval”: 60
}

Starting Via Docker

docker build -t steemfeed-js .
docker run -itd –rm –name feed steemfeed-js

# Check the status with docker logs
docker logs feed

Got an error the first time running the docker logs feed, as shown below. Attempting to login account.

YEHEY.com.docker.logs.feed

Waited to make sure the –replay-blockchain is fully synced, re-run the following command again.

docker build -t steemfeed-js .
docker run -itd –rm –name feed steemfeed-js
# Check the status with docker logs
docker logs feed

YEHEY.com.docker.logs.feed.success

Checking your Price Feed update using @drakos https://steemian.info/witnesses website.

If you get an error running “docker logs feed”, exit SSH and re-login again and it will correct itself.

Re-run ps aux | grep docker to check docker session. You will see the 3rd docker session pid “6297” as shown below. It will be a different number on your server.

That’s all for now.

To find out when did you processed a block, visit https://steemdb.com/@yehey/blocks change @yehey using your account.

+++++++++++++++++++++++++++++++++++++++

The following procedures if you will upgrade your Witness Node server memory.

Upgrading my Witness Node server memory from 16GB to 26GB.

New server running at 26GB RAM.
./run.sh stop
sudo ./run.sh shm_size 24G

Edit config.ini in ~/steem-docker/data/witness_node_data_dir
shared-file-size = 24G

./run.sh replay

After synched.

docker build -t steemfeed-js .
docker run -itd –rm –name feed steemfeed-js

# Check the status with docker logs
docker logs feed

Check your server memory, record utilization.

Use “docker logs –tail=30 –follow witness” (two dash line) same result when your run “./run.sh logs” with –follow is to monitor logs in realtime (thanks to @drakos).

 

As noted by @drakos, there is a known but in steemjs-lib and the work around is to run crontab to restart every two hours. with the following command.

crontab -e

# Restart Docker feed every 2 hours everyday. Added 201710180005 by EM@QUE.com
0 */2 * * * docker restart feed
0 */2 * * * cd steemfeed-js && docker run -itd –rm –name feed steemfeed-js

 

To force Price Feed update:

cd steemfeed-js
docker run -itd –rm –name feed steemfeed-js
docker logs feed

 

 

Some useful commands and websites to remember.

docker logs witness | grep yehey

 

https://steem.bitcoiner.me/schedule/?c=show200,includetop20

+++++++++++++++++++++++++++++++++++

For maintenance:

Disable the signing key first to avoid missing blocks. As recommended by @drakos check the timing, if u’re low in the rank and now scheduled soon, u can do your maintenance and not lose your turn.

update_witness “yehey” “https://steemit.com/witness-category/@yehey/My-Witness-Campaign” “STM1111111111111111111111111111111114T1Anm” {“account_creation_fee”:”0.200 STEEM”,”maximum_block_size”:65536,”sbd_interest_rate”:0} true

Press CTRL + d, to exit

./run.sh stop

update_witness “yehey” “https://steemit.com/witness-category/@yehey/My-Witness-Campaign” “Public_Key_from_Suggest_Brain_Key” {“account_creation_fee”:”0.200 STEEM”,”maximum_block_size”:65536,”sbd_interest_rate”:0} true

Press CTRL + d, to exit

./run.sh start – to begin running steemd replay again.

+++++++++++++++++++++++++++++++++++

20171020 Install Conductor a Steem Witness Toolkit

$ steempy addkey

when prompted, paste your active key with shift-insert

Then use “steempy listkeys” to make sure it’s added, also “steempy listsaccounts”

$ steempy listkeys

$ steempy set nodes https://steemd.steemit.com,https://steemd.privex.io,https://gtg.steem.house:8090

$ conductor init
What is your witness account name?: yehey
Imported a witness yehey from its existing settings.

$ conductor feed
Fri Oct 20 16:52:28 2017
Old Price: 1.019
New Price: 1.002
Current STEEM price: 1.002 USD
Current SBD price: 0.942 USD
Quote: 1.000 STEEM
Spread between prices: 1.697%

steempy wallet is in .local/share/steem/steem.sqlite

 

 

 

+++++++++++++++++++++++++++++++++++

Some references I’ve used to build my Witness node and Seed node.

 

EM @QUE.COM

Founder, QUE.COM Game Studios. | Founder, Yehey.com a Shout for Joy! |
MAJ.COM Management of Assets and Joint Venture |

More at KING.NET Ideas to Life | Network of Innovation |

Send your Tip to my Bitcoin/Ethereum or other crypto currency.

One thought on “HOWTO Setup Witness Node by Yehey

Leave a Reply