Witness Server Setup Tutorial - [Steem-in-a-box]

in #witness-categor7 years ago (edited)

Witness Server Setup Tutorial - [Steem-in-a-box]


Did you ever think about being witness.? Do you think you can be good witness, but you don't know how to set up witness node? Read this tutorial!

5% of payout will go to @someguy123 and 5% to @yabapmatt.

Steem-in-a-box aka Steem Docker is docker container created by @someguy123 [Vote for Witness].


What do I need?

  • You need reliable server with at least 64 GB RAM, at least 100 GB disc fast network. I use server from @privex - https://www.privex.io/ - You can pay with STEEM, SBD, BTC, LTC.

  • Ubuntu 16.04


Tutorial:

You need to install some basic dependencies first :
This will update your system.

sudo apt update
sudo apt install git curl wget

Than install Htop. This is optional, but it is useful for monitoring RAM usage.
sudo apt-get install htop


After this, you need to download Steem-in-a-box from Github.
git clone https://github.com/Someguy123/steem-docker.git

And move to steem-docker directory.
cd steem-docker

When you are in steem-docker directory, install docker. (If you are not logged in as root, you need to log out and back in again after installing docker)
./run.sh install_docker

Than:
./run.sh install

Now you need to download blocks from @gtg's server. It will speed up your replay time.
./run.sh dlblocks


Open cli_wallet.
./run.sh remote_wallet

And create public and private key for your witness.
suggest_brain_key

This will look like:

If you get an error, close wallet (CRTL+D) and try again.

When you have pair of keys, save them, you will need them!

Close wallet - CTRL+D


You need to choose how much "Shared memory" you want to use. If you have 64 GB RAM server use few GB less (I use 60 GB). DO NOT CHOSE MORE RAM THAT YOU HAVE. If you have 64 GB server, do not chose 128 GB!!!

You need to chose more than 37.5 GB RAM (April 30,2018).

sudo ./run.sh shm_size 60G
Replace 60 with chosen amount.


Now open config.ini file in text editor, I'm using nano.
nano data/witness_node_data_dir/config.ini

You should see something like this:

Now change:
p2p-endpoint = 0.0.0.0:2001 to #p2p-endpoint = 0.0.0.0:2001 (Add #)

shared-file-size = 60G Change amount of Shared memory (If you chose 59 G before, change to 59)

# name of witness controlled by this node (e.g. initwitness )
witness = "fbslo" Change username. Don't forget to remove # (It is #witness = by default)

# WIF PRIVATE KEY to be used by one or more witnesses or miners
private-key = Put you private key generated by suggest_brain_key here. Name needs quotes, private key don't need quotes.

Save by CTRL+X and then Y.


Then you need to disable ports forwarding for seeds.
nano .env

File will be blank. Enter following:
PORTS=
DOCKER_NAME=witness

Save by CTRL+X and then Y.


You can start server now

./run.sh replay
This will replay all blocks downloaded before.

You can check logs:
./run.sh logs

Or if you want to see logs in real time:
docker logs -f witness

If you don't get red error messages, leave it running. If you get error messages, ask for help in WITNESS channel on Steem.chat

When you get logs like this
application.cpp:514 handle_block ] Got 59 transactions on block 22014958 by pharesim -- latency: -449 ms
your witness is synced.


But you are not done yet. Open cli_wallet: ./run.sh wallet

Set password for cli_wallet: set_password thisismypassword

Unlock wallet: unlock thisismypassword

And import active key from steemit: import_key 5xxxxxxxxxxxxxxx
(You can get active key on steemit: Wallet -> Permissions -> Active Key -> Login to show -> you need to login -> Show private key. It begins with 5.)

Now you need to create witness on the network:
update_witness "ACCOUNT" "https://steemit.com/witness-category/@account/my-witness-thread" "STMxxxxxxx" {"account_creation_fee":"0.100 STEEM","maximum_block_size":65536,"sbd_interest_rate":0} true

Replace "ACCOUNT" with your account name (e.g. "fbslo") It need quotes.

Replace "https://steemit.com/witness-category/@account/my-witness-thread" with link to your witness post. It need quotes.

Replace "STMxxxxxxx" with PUBLIC key from suggest_brain_key.


You are witness now :)


But as witness, you need to run a price feed.

I'm using price feed by @yabapmatt.

You need npm and nodejs (if you alredy have npm and nodejs installed you can skip this).
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs

Now download it form github and install it.
git clone https://github.com/MattyIce/pricefeed.git pricefeed
cd pricefeed
npm install

Now update config.json file in text editor (I use nano).
nano config.json

Enter account name, active key, interval and exchanges.

Run price feed background with PM2.
sudo npm install pm2 -g
pm2 start feed.js
pm2 logs feed


Monitor your RAM usage by Htop: htop


You are witness now. It can take days or weeks to get first block. Try to get votes.

Don't forget to vote for yourself, @someguy123, @yabapmatt and @fbslo!


Sources:
@someguy123's instructions
Price feed


@fbslo


27496184_2012467288996553_1171355060_n.png
(Click on the button)

(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)


Please read my Witness Thread and support me by voting @fbslo for witness.

Sort:  

DON'T FORGET TO RUN ./run.sh install after ./run.sh install_docker to install Steem!!!

This is by far the best and the most concise how to set up the witness / seed node tutorial ever. Deep respect and congrats!


Pismu, sicer se pozno oglašam a ... tale tvoj tutorial je prvi in najbrž edini enostaven recept, kako postaviti witness node.

BRAVO!!!

Zna biti, da ga bom uporabil ;)

Ja, zadnje mesece sem čisto poniknil, kar se tiče družabnosti. Kratki posti, da vzdržujem stanje in to je vse. Čisto preveč dela imam offchain.

A položaj pri meni se umirja, tako da bo čez poletje več časa za dodatne Steem aktivnosti.

Hvala še enkrat. Super si tole povzel.

Used this to get mine going, only thing you missed was after installing the docker - ./run.sh install_docker
you got to install steem using - ./run.sh install

Really awesome though, made it way easier for me!

Been a witness is it like mining Steem

Similar, but it's also much more!

Done vote @fbslo for witness

Thanks for so detailed instructions for installation and configuration! What power supply source of your witness node?

Keren post nya,@fbslo,semoga sukses terusss kedepan nya yaaaa

Thank you for sharing

whether I can be a good witness for you, how

What do you want to add?

Coin Marketplace

STEEM 0.25
TRX 0.21
JST 0.036
BTC 97583.14
ETH 3481.73
USDT 1.00
SBD 3.45