HOWTO Migrate a Witness node from Old to New Server

This how to procedure is for migrating your OLD witness server to a NEW witness server. There are many different ways to complete this task but this one works for me.

Related: How to setup a Witness Node by Yehey

Server requirements. You need to have a minimum server requirements to run your Witness node otherwise it won’t work.

  • 20GB RAM minimum, 32GB RAM is highly recommended. As of writing this article the current memory usage is at 15.1GB.
  • 100GB SSD hard disk minimum, the block log file is around 38GB file size.
  • Fast Internet connection, with the above setup I was able to complete setup within 10-12 hours up and running.
  • Tested using Ubuntu 16.04.3 LTS for operating system.

Please note. If you go beyond 24 hours to setup your node server, you need to check your hardware and your internet bandwidth speed. The STEEM blockchain needs a faster servers to process blocks.

Let’s begin setting up a new server.

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 (alternative download – wget https://gtg.steem.house/get/blockchain/block_log)

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 32GB RAM only use 30G for your shared memory.

sudo ./run.sh shm_size 30G

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 = 30G
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

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!

Go to Yehey.org 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” // save this information, you will need this to update witness.
unlock “MyAlph4Num4r1cP4ssw0rd”
import_key 5andSomeLongCharacter

Login to the OLD Witness Server, run the following commands.

./run.sh wallet

unlock “MyWalletPassword”

Let’s broadcast/disable our OLD Witness Server to avoid missing block.

update_witness “yehey” “https://witness.yehey.org” “STM1111111111111111111111111111111114T1Anm” {“account_creation_fee”:“0.200 STEEM”,“maximum_block_size”:65536,“sbd_interest_rate”:0} true

Press CTRL-D to exit.

./run.sh stop // halt the OLD witness server.

or

steem-docker$ docker ps -a // to see the container id

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0eff5c1ab077 steem “steemd –replay” 3 weeks ago Up 3 weeks 2001/tcp, 5000/tcp, 8090/tcp witness

steem-docker$ stop docker 0eff5c1ab077 // this is to stop running docker in OLD witness server. Change the container id with your server.

Finally, broadcast the NEW Witness information on the network.

./run.sh wallet

unlock “MyWalletPassword”

Format: update_witness “yehey” “https://witness.yehey.org/YourWitnessCampaign” “Public_Key_from_Suggest_Brain_Key” {“account_creation_fee”:”0.200 STEEM”,”maximum_block_size”:65536,”sbd_interest_rate”:0} true

Example: update_witness “yehey” “https://witness.yehey.org” “STM…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 the NEW Witness Server.

yehey-witness-docker:~/steem-docker$ ./run.sh status

Container exists?: YES
Container running?: YES

yehey-witness-docker:~/steem-docker$ docker ps -a // check running  container

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f390f8cb0557 steem “sh -c /usr/local/…” 5 minutes ago Up 5 minutes 2001/tcp, 5000/tcp, 8090/tcp witness

NEXT …

Make sure you install the Steem Feed JS for price update.

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. And if your price feed stop working, run this again.

docker build -t steemfeed-js .
docker run -itd –rm –name feed steemfeed-js (NOTE: 1 dash itd, 2 dash rm and name)

# Check the status with docker logs
docker logs feed

crontab -e //automate the service process

# 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

0 */2 * * * docker logs feed

 

Run ps aux | grep docker to check docker session.

That’s all.

Useful for troubleshooting.

  • docker stop feed
  • docker rm feed // you can remove this container
  • docker logs feed

Notes:

  • You can create multiple Witness Server node. If you do, you should have different signing keys on each one to prevent double signing.

 

References I’ve used to build my Witness node.

 

Image by JuralMin pixabay

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.

Leave a Reply