Steps for setting up a witness node (the manual way)

in #witness-category7 years ago (edited)

Several people have asked me for a guide to setup a witness server. I usually send them these two links:

The first link uses @someguy123's "STEEM-in-a-box", which pretty much sets everything up for you - you basically just follow the instructions. There are quite a few people following this method, and I've heard good reviews from the people that use it.

I prefer the second link. I like actually installing all the dependencies and running the build to get it up and running. I've learned quite a bit about the Steem blockchain from all of the times it didn't work. The second link is what I call "the manual way".

While I still prefer the second link for my witness setup, it has gotten to the point though that when I sent people the link, I always need to tell them "It is 95% of what you need, but at this point it is a little bit out of date."

I felt it was time to publish an update that has all the latest instructions using the latest version of the code (20.5). This should hopefully remain current for a while, but of course things may change again. If updated instructions are needed, I (or someone else) will have to publish an updated guide.

As a prerequisite to using this guide, I highly suggest that you also read these other guides. The technical aspect is an obvious and important part of becoming a witness, but as you will soon learn (if you do not know already) - being a good witness involves a lot more than just producing blocks.

Of course you may also be interested in knowing how much witnesses get paid. For that, you can check out TIL - How Much Witnesses and Miners Make Per Block. The post is a little outdated at this point, but if you change "19 top witnesses and one miner" into "20 top witnesses" - all of the other parts are still accurate. You will be able to calculate the current rates based on the current block number.

If you want to see how many blocks per day a witness is making based on their rank, you can go to https://steemdb.com/@witnessname/blocks.

Ok, on to what this post is mostly about - the technical stuff.


I still consider How to become a witness to be the best witness setup guide out there. I did not want to take all of the good stuff in there and repeat it here, because it is not really mine to copy. Therefore, I will refer readers there for the majority of the setup.

As with that guide, this post assumes you're using Ubuntu 16.04 LTS. There are also build instructions here for other operating systems.

Step 1:

Complete Step 1 from the "How to become a witness" guide.

These days a 16 GB RAM server will technically work, but re-indexing the blockchain will be extremely slow. The minimum recommended amount of RAM is 32 GB. 64 GB (or even 128) will give you even faster replays, but is not necessary. Also, fast disk speed is important for replays. Using a SSD disk is the minimum recommendation. NVMe drives are even better.

Step 2:

Complete Step 2 from the "How to become a witness" guide.

Step 3:

 
First install the dependencies:

# Required packages
sudo apt-get install git make automake cmake g++ libssl-dev autoconf libtool libbz2-dev libsnappy-dev -y

# Boost packages (also required)
sudo apt-get install 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 -y

# Optional packages (not required, but will make a nicer experience)
sudo apt-get install doxygen perl libreadline-dev libncurses5-dev -y

#ntp required to keep time
sudo apt-get install ntp -y

#jinja2 required for build dependency
sudo apt-get install python3-pip -y
sudo pip3 install jinja2

 
Next, clone the source code repository, checkout the latest stable version and update the submodules. In the example below, v0.20.5 is used as the version. You can find the list of releases here. Technically it will also work to build from stable or master, but I prefer to explicitly set the version number so I am sure which version I am building, and so I can use the same syntax in case I need to rollback to an earlier version.

git clone https://github.com/steemit/steem
cd steem
git checkout v0.20.5

 
Finally, build and install the software

cmake -DLOW_MEMORY_NODE=ON -DCMAKE_BUILD_TYPE=Release .
make steemd
make cli_wallet
sudo make install

Step 3 (alternate):

 
As an alternate set of instructions, you can follow the official installation instructions in the steem GitHub repository: https://github.com/steemit/steem/blob/master/doc/building.md

Step 4:

Complete Step 4 from the "How to become a witness" guide.

Note - the wss://node.steem.ws/ node listed in the post is no longer active. You can find a more up to date list of nodes here and here. You may still have to try a few until you find one that works.

Step 5:

Complete Step 5 from the "How to become a witness" guide.

In the latest build, it now uses a hidden directory .steemd instead of witness_node_data_dir.

When editing the config.ini file, also make sure that the only plugin that is enabled is the witness plugin. No other plugins besides witness should be listed.
enable-plugin = witness

You can get the latest list of seed nodes here:
https://github.com/steemit/steem/blob/master/doc/seednodes.txt

It may be best to do some separate research on what to use for your price feed, but I will provide a few options here. I modified the steem_price_feed script listed in the post to run once and quit, then control it using crontab. conductor is another popular one.

Step 6:

Complete Step 6 from the "How to become a witness" guide.

With my modified setup, I only run steemd using supervisor. I launch cli_wallet and steem_price_feed as needed using crontab. There are also alternate ways to get steemd to run on its own, so you are welcome to look into those if you don't want to use supervisor.

Step 7:

Complete Step 7 from the "How to become a witness" guide.

Step 8:

Complete Step 8 from the "How to become a witness" guide.


That's it. I hope you find this guide useful. It goes without saying that this guide would not have been possible if it were not for all the great witnesses that came before and charted the way for the rest of us to follow. Thank you to everybody who has contributed knowledge, tools, advise, help, etc. to myself and all the other witnesses that have assembled the material for this guide.

If you run into any issues and need help, you can ask me here, or ask all the folks in the steemit.chat witness channel.

Sort:  

I'm interested in delving into programming eventually and im using this comment to bookmark your post so I can come back and read the whole thing this weekend and learn.

Thanks for sharing this useful information. I have basic programming skills but I have a lot to learn and it's gonna take some time but I will get there.

Exactly how I feel right now. Just that I might have a longer way to go. Will take my time to study this. To know that this is 9 months later!
Thanks

Thankyou Tim, I have been waiting for this for a while. Will try it withing the coming days.

Thank you, I will try to follow

Very useful - thanks @timcliff!
Bookmarked for future reference.

I've just joined the community and this is exactly what I was looking for. I also recommend others like me get on the Steemit.chat #witness channel if they have any specific questions.

Thanks for sharing I have chosen you to be a witness

Cool, thanks :)

dear Tim you have done a nice job by sharing informations about witness.

Thank you friend, Later I will contact you at steemit Chat @timcliff

thanks for your help!!

I want to be a witness. Is this post still valid?

Yes, although the protocol is undergoing a lot of changes at the moment. If you follow this guide, you will get the latest 'stable' version, which I believe is either 19.5 or 19.6. There is a 19.12 version being used by a lot of witnesses (AppBase) and hardfork 20 (20.0) is coming out in less than a month.

Bottom line: you can use the guide, but expect to be upgrading soon.

I'm also concerned. If the new version is released, can you write the guide once again?

I plan to update the guide after HF20.

good thank you ^^

곰돌이가 @ayogom님의 소중한 댓글에 $0.017를 보팅해서 $0.008를 살려드리고 가요. 곰돌이가 지금까지 총 25번 $0.175를 보팅해서 $0.374를 구했습니다. @gomdory 곰도뤼~

어라. 곰돌이가 계산실수를? 통계를 바로잡습니다^^ 곰돌이가 지금까지 총 25번 $0.175을 보팅해서 $0.432을 구했습니다. @gomdory 곰도뤼~

곰돌이가 @ayogom님의 소중한 댓글에 $0.008를 보팅해서 $0.017를 살려드리고 가요. 곰돌이가 지금까지 총 24번 $0.158를 보팅해서 $0.366를 구했습니다. @gomdory 곰도뤼~

어라. 곰돌이가 계산실수를? 통계를 바로잡습니다^^ 곰돌이가 지금까지 총 24번 $0.158을 보팅해서 $0.424을 구했습니다. @gomdory 곰도뤼~

곰돌이가 @ayogom님의 소중한 댓글에 $0.008를 보팅해서 $0.017를 살려드리고 가요. 곰돌이가 지금까지 총 19번 $0.118를 보팅해서 $0.281를 구했습니다. @gomdory 곰도뤼~

어라. 곰돌이가 계산실수를? 통계를 바로잡습니다^^ 곰돌이가 지금까지 총 19번 $0.118을 보팅해서 $0.339을 구했습니다. @gomdory 곰도뤼~

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64724.35
ETH 3436.21
USDT 1.00
SBD 2.55