How to Migrate a Witness node from Old to New Server

in #utopian-io7 years ago (edited)

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.

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

image.png

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.
image.png

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
image.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.
image.png

and this is the normal logs results.
image.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

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

Check the status with docker logs

docker logs feed
image.png

crontab -e //automate the service process

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.

References I've used to build my Witness node.

Your Guide to Setting up a Witness Server @someguy123
Steem Feed JS - https://github.com/Someguy123/steemfeed-js/
@drakos Guide - https://busy.org/witness-category/@drakos/tips-and-guidelines-for-the-noob-witness-setup
From the official GitHub page - Building Steem
Complete Witness Installation Guide by https://steemit.com/witness-category/@krnel/complete-witness-installation-guide
The Complete Noob Guide to STEEM Witness Setup - https://steemit.com/witness-category/@klye/the-complete-noob-guide-to-steem-witness-setup

Image by JuralMin pixabay

Thank you for reading.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

This can't be approved yet. How is it different from your previous works? See the Utopian rules.

This appears to be a bad copy of that. You should avoid mentions in the contributions. Instead, make the text link to the work you are referring to. And remove the steemit tag.

You can contact us on Discord.
[utopian-moderator]

@espoem,
The previous post is for step-by-step procedure on how to setup a witness server (for first time install).

This is a complete guide on how to Migrate witness server from OLD to NEW upgrade, there are some critical steps to follow for the Witness not to miss a block, properly disabling key, shutting down the node, etc.

I updated the link and removed the steemit tag.

Thank you.

Hey @yehey I am @utopian-io. I have just super-voted you at 12% Power!

Achievements

  • Thanks for explaining to me how it works! Beep beep!
  • Much more informative than others in this category. Good job!
  • You are generating more rewards than average for this category. Super!
  • This is your first accepted contribution here in Utopian. Welcome!
    Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Hi @Yehey,

I'm @joshua-golbuu, or Josh for short and I just joint @TeamAustralia / #TeamAustralia a few week ago (I moved from the islands of Micronesia to Australia to study and live here).

I just wanted to drop a note to say hello.

I'm still learning about being a witness so I really appreciate this post. Thank you for sharing the knowledge in this wonderful post!

I don't have many recent post because I just finish my last exam Friday, but I very much like to get to know everyone in our team. Hope we will meet on Steemit.

here is my re-intro with more details: https://steemit.com/teamaustralia/@joshua-golbuu/from-micronesia-to-australia-my-journey-re-introducing-myself-to-teamaustralia-and-to-everyone-in-steemit-after-my-exams

Peace ✌ & 💖 love!

100% Upvoted for Witness Support To all Steemians, Followed, & Celebrated! Well done @Yehey!