STEEM WITNESS SETUP HF 19

in #witness-category7 years ago (edited)

I worked very hard in this days to create my First WITNESS SERVER.

I helped myself with these guides, but no one of them was completely useful without adding my skills:

What i have done was a merge of this three articles because I wanted to create a witness server in a manual way.

So i have to say thanks to @klye @timcliff and @krnel.
But someone else helped me on steemit chat #witness channel and i have to say thanks to @drakos @lonelywolf and @crt

Witness Node or Seed Node

Witness Node and Seed Node must reside in two different servers

SEED NODE

The Seed Node is a server used as a Node for Hosting Steem Blockchain.
If you want only to become a witness and you don't want to stay in the "first position", you don't need to create it.

WITNESS NODE

As already explained several times Steemit.com is a Blogging platform based on a decentralized Blockchain called STEEM.
As for Bitcoin, the Steem Blockchain generates Blocks. Unlike Bitcoin, however, the concept based on the Steem Blockchain is called Delegated Proof of Stake (DPOS).
In the DPOS system, witnesses are delegated by users to control the Steem Blockchain and Blocks. (So there aren't external miners).

A WITNESS NODE is exactly what we explained, a node used by Witnesses to find Blocks.

Before to start creating the Server

To start a node you need a server with these minimal requirement:

Operating SystemUbuntu Server 16.04 LTS
RAM32 GB
HDD250 GB
INTERNET10Mbps
PROCESSORXEON Processor or equivalent

I bought my server on privex.io because you can pay directly with STEEM on the account @privex. We have to say thanks to the creator @someguy123

Prepare your server

First of all you need to access on the machine with an SSH Client.
I used putty for this

Immagine.png

On the Hostname filed insert you public ip or host domain.
Put the port (22) -----> for security reason we will change it.

NOW DO THIS STEPS FOR SECURITY REASONS:

  • Install fail2ban to block SSH brute force attacks

apt-get install fail2ban

  • Move your SSH port above 10000. Thi prevents SSH brute force attacks

vi /etc/ssh/sshd_config
Port 22 ----> change with your favorite port (example port 10000)

  • Change your root password

passwd

  • Update and Upgrade your system

apt update
apt upgrade -y

Install dependencies

Once The Update and Upgrade are completed, you need to installa all this dependencies by running this command:

sudo apt-get install git make automake cmake g++ libssl-dev autoconf libtool libboost-thread-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-signals-dev libboost-serialization-dev libboost-chrono-dev libboost-test-dev libboost-context-dev libboost-locale-dev libboost-coroutine-dev libboost-iostreams-dev doxygen perl libreadline-dev libncurses5-dev ntp python3-pip

At the end install jinja2 with pip3

sudo pip3 install jinja2

Start the STEEM Installation

go to the root folder (if you want to have more security use a different username)

cd /root

now proceed to clone STEEM from github executing this command:

git clone https://github.com/steemit/steem.git

It will create a new folder called "steem"

steem.png

Now Update the source and client code to correct version.
First of all verify the versione to use. Go to this site and check the column "Ver."
https://steemian.info/witnesses

version.png

At the moment i'm writing all witnesses are using the version v0.19.2

so start the update to version v0.19.2

git checkout v0.19.2

and before to compile it do a recursive update

git submodule update --init --recursive

Now build and install the software steemd and cli_wallet

cmake -DENABLE_CONTENT_PATCHING=OFF -DLOW_MEMORY_NODE=ON CMakeLists.txt
make steemd
make cli_wallet
make install

  • "steemd" is used to download the blockchain and to make the witness work
  • "cli_wallet" is used to configure your witness account

Configure the files


go to steemd folder and create the config.ini file

cd /root/steem/programs/steemd
./steemt
press ctrl +c

esegui.png

after the program is started, we need to exit with ctrl+c because is necessary to modify the config.ini file

cd /root/steem/programs/steemd/witness_node_data_dir
vi config.ini

settami.png

we need to change this parameters:

CONFIG.INI


P2P nodes to connect to on startup (may specify multiple times)
This are the seed nodes I used to download the blockchain (mantained by other witnesses)
seed-node = steem-seed1.abit-more.com:2001 # @abit
seed-node = seed.jesta.us:2001 # @jesta
seed-node = gtg.steem.house:2001 # @gtg
seed-node = 176.31.126.187:2001 # @timcliff

Size of the shared memory file. It depende on the RAM used by your Server (usually Total - 2GB). I'm using 32GB RAM so i changed it to 30GB
shared-file-size = 30G

Endpoint for websocket RPC to listen on (use your server after the end of blockchain download)
rpc-endpoint = 127.0.0.1:8090

Set an API to be publicly available, may be specified multiple times (leave only this parameters)
public-api = database_api login_api

Plugin(s) to enable, may be specified multiple times (leave only this parameter)
enable-plugin = witness

name of witness controlled by this node (witness username )
witness = "yanosh01"

WIF PRIVATE KEY to be used by one or more witnesses or miners (don't touch for now)
#private-key = don't touch for now, we need to create witness before adding it

Download the Blockchain

To do it you have two way.

1- PARTIAL FILE DOWNLOADED BEFORE

If you prefer to download the partial blockchain file and resume it, follow this istructions:

cd /root/steem/programs/steemd/witness_node_data_dir/blockchain
wget https://gtg.steem.house/get/blockchain/block_log

once the file is downloaded you have to start the resume:

cd /root/steem/programs/steemd
./steemd --replay-blockchain

1- DOWNLOAD FULL BLOCKCHAIN WITHOUT RESUME

I prefer to do the full download for the first time and to resume everytime i interrupt it.

cd /root/steem/programs/steemd
./steemd --resync-blockchai
if for some reason you have to inerrut the download you can do it with ctrl+c (wait the exit signal).
And if you need to restart an already started blockchain download use the command:
./steemd --replay-blockchain

When you see "transaction on block" your download is gone to 100%gone.png

Configure your witness account

Now start a second terminal session or use the"screen" tool to handle multiple session.
With the blockchian started you need to open your cli_wallet and make the first configuration.

cd /root/steem/programs/cli_wallet
./cli_wallet
new>>>set_password “select a password you want for this wallet"
unlock “the password just selected"

import_key YOURSTEEMACTIVEKEY
key.png

now generate your key-pair:
suggest_brain_key

it will give you somenthing like this:

suggest_brain_key
{
"brain_priv_key": "XXXXXXX XXXXXXX XXXXXXXXX XXXXXXX"
"wif_priv_key": "5J8Qq69NbALe37CY2KFfFvDukmM4fxHUe8DirS9Va9RsYu3fH8D"
"pub_key": "STM6fsCZaUkydV0xDsJiykvdWx1sgH4XpyVAF8KwHQ8NFAC58NqPg"
}

Save them in a safe place

Complete the configuration and broadcast your intent

Stop your Blockchain Sync with ctrl+c (wait the end signal every times) and close your wallet

to unlock the wallet use: unlock "password choosen"
to lock the wallet use: lock "password choosen"

Re enter in the file config.ini and edit the "private-key"

WIF PRIVATE KEY to be used by one or more witnesses or miners (don't touch for now)
#private-key = enter wif_priv_key created by the suggest_brain_key

NOW:

a) write you config.ini file (:wq - i use vi editor)
b) restar the blockchain ./steemd --replay-blockchain
c) wait the blockchain reload
c) start the wallet ./cli_wallet

PUBLISH YOUR WITNESS PRESENTATION IF IT IS NOT ALREADY DONE

Broadcast your intent with the following command:

update_witness "username" "your presentation post" "STM6fsCZaUkydV0xDsJiykvdWx1sgH4XpyVAF8KwHQ8NFAC58NqPg" {"account_creation_fee":"0.100 STEEM","maximum_block_size":65536,"sbd_interest_rate":} true

You can take it from steemd:

https://steemd.com/@witness_username

parametri.png

Now set the parameters base and quote (set the value like the first 10 witnesses. This must be changed every XX hours)

publish_feed witnessname {"quote":"1.000 STEEM", "base":"4.147 SBD"} true

Close the wallet and leave the blockchain Synchronized.

YOU ARE NOW A WITNESS

Until the first block is found you will see no activities on your witness

Go here and check your job

https://steemian.info/witnesses

scd.png

If you think that what I'm doing is something you like, please UPVOTE ME AS WITNESS

https://steemit.com/~witnesses

witness.png

Best Regards @yanosh01

steemit.png

Sort:  

Thanks for an interesting and informative post. I am thinking of running a witness myself, but I am trying to figure out if it is self-sustainable.

Cool, but could you explain what the advantages of being a witness are to those who have no idea?

A witness is someone who helps the whole community and keeps the price of STEEM stable. What I want to do is to support all other witnesses by doing interviews and creating a Steem repository portal as explained in my initial post: https://steemit.com/witness-category/@yanosh01/the-time-to-introduce-myself-as-witness-has-arrived-yanosh01
I don't want to substitute myself with anything else. I want only to be the support to all other witnesses

I've noticed you're using 32GB, the current node is at 29GB. You need to upgrade soon.

Welcome to the Witness world. Now, campaign for your next witness vote so you can get up to the rank.

Cheers.

@yehey I changed to 95 GB yesterday. Now, i'm waiting for resync and i'm up in some hours... :-D

In that case, you will be alright for months. The re-sync will take between 8-12 hours depending on CPU and Internet speed.

Good luck.

You got a 5.90% upvote from @buildawhale courtesy of @yanosh01!
If you believe this post is spam or abuse, please report it to our Discord #abuse channel.

If you want to support our Curation Digest or our Spam & Abuse prevention efforts, please vote @themarkymark as witness.

Coins mentioned in post:

CoinPrice (USD)📉 24h📈 7d
BTCBitcoin10714.800$-4.63%27.62%
KEYSelfkey0.020$-8.24%33.51%
SBDSteem Dollars5.310$-5.4%14.03%
STEEMSteem4.313$-6.0%5.56%

Excellent and well written. Great source of information now that i know what a witness is. Im new on this platform so all this is a learning curve at the moment. I have upvoted you ...

i upvoted you! Wonderful Job man.

just few corrections here:


original:
so start the update to version v0.19.2
git checkout v0.19.2

modify in:
so start the update to version v0.19.2
cd steem
git checkout v0.19.2


original:
cd /root/steem/programs/steemd
./steemt

modify in:
cd /root/steem/programs/steemd
./steemd


Thanks,
cheers

Coin Marketplace

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