Running A Witness Node v0.19.4

I'm finally running a witness test server with 0.19.4.

0.19.4 is an optional release that includes significant architectural changes to steemd. These architecture changes lay the framework for future improvements and as of 0.19.4 allows for fully parallel API execution.

There were a number of optimizations to improve reindex performance. Because of this you will need to reindex to run 0.19.4.

The build instructions are found at https://github.com/steemit/steem/blob/master/doc/building.md

Here's my summary for building on Ubuntu 16.04 based on those instructions, with a few modifications. This is the manual way of doing things, if you're a Docker fan, this is the time to learn something. Also I assume you're already familiar with running a witness so I won't go too deep into some of the details, like where to download the block_log file.

Required packages

sudo apt-get install -y autoconf automake cmake g++ git libssl-dev libtool make pkg-config python3 python3-jinja2

Boost packages

sudo apt-get install -y libboost-chrono-dev libboost-context-dev libboost-coroutine-dev libboost-date-time-dev libboost-filesystem-dev libboost-iostreams-dev libboost-locale-dev libboost-program-options-dev libboost-serialization-dev libboost-signals-dev libboost-system-dev libboost-test-dev libboost-thread-dev

Optional packages

sudo apt-get install -y doxygen libncurses5-dev libreadline-dev perl

Missing packages

Also, some packages were missing from the build instructions (@timcliff had opened a Github pull request for it https://github.com/steemit/steem/pull/2477)

sudo apt-get install -y libsnappy-dev libbz2-dev

Building the binaries

git clone https://github.com/steemit/steem
cd steem
git checkout master # for the latest 0.19.4, use `master`, not `stable`, the `stable` version is 0.19.3
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLOW_MEMORY_NODE=ON -DCLEAR_VOTES=ON -DSKIP_BY_TX_ID=ON ..
make -j$(nproc) steemd
make -j$(nproc) cli_wallet

# copy the binaries to the local bin folder
mkdir ~/bin
cp programs/steemd/steemd ~/bin
cp programs/cli_wallet/cli_wallet ~/bin

Verify the version with steemd -v:

steem_blockchain_version: 0.19.4
steem_git_revision:       62b48877d9f731c3fe00ef818e3324a0a3de3e63
fc_git_revision:          62b48877d9f731c3fe00ef818e3324a0a3de3e63

------------------------------------------------------

            STARTING STEEM NETWORK

------------------------------------------------------
initminer public key: STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX
chain id: 0000000000000000000000000000000000000000000000000000000000000000
blockchain version: 0.19.4
------------------------------------------------------

Set up tmpfs

On my test server I have 24GB RAM with a NVME drive, so I created a swap partition on the NVME for the extra memory. No need to worry about a swap if you have 64GB RAM or more, otherwise google for guides how to do that.

sudo mount -o remount,size=64G /dev/shm
sudo sysctl vm.swappiness=1

I was running a backup server using the docker container, so I already have my config.ini and block_log file. I will use those. However, we need to do a few modifications

Edit the config.ini.

  • Comment the line required-participation = false. The new steemd didn't run with that parameter.
  • Replace all seed-node strings with p2p-seed-node. This is optional, if you don't do that, the daemon will spit a notification about it, but it will still run.
  • I left the public-api = database_api login_api as it is, and changed the plugin parameter to plugin = witness condenser_api

Removed login_api
The login_api was designed as a way to map the API names to numeric ids. Because the APIs are no longer called via id, there is now no need for the login_api, and so it has been removed.

Plugins are enabled via the plugin option. There is no more public-api option and all the APIs are now enabled via plugin as well.

So, reflecting the new changes, use the following plugin settings:
plugin = database_api condenser_api witness

  • Make sure shared-file-dir = /dev/shm/ and not shared-file-dir = /shm/ (as in the dockerized setup)

Run the daemon in a screen session with logging

A replay is required for v0.19.4. At this point I can replay the witness node straight up with the following (remember, I have a previous docker setup):
steemd -d ~/steem-docker/data/witness_node_data_dir/ --replay-blockchain

However, I need to run it in the background and have a logging mechanism to monitor the status and errors.

So, create two scripts in the ~/bin folder

echo -e '#!/usr/bin/env bash\nsteemd -d ~/steem-docker/data/witness_node_data_dir/' > ~/bin/steemd-start.sh
echo -e '#!/usr/bin/env bash\nsteemd -d ~/steem-docker/data/witness_node_data_dir/ --replay-blockchain' > ~/bin/steemd-replay.sh
chmod +x ~/bin/steemd*.sh

Add the following aliases to the ~/.bashrc file

alias startsteemd='screen -X -S steem quit ; rm ~/steemd.log ; cd ~ ; screen -c ~/bin/steemd.conf -dmSL steem ~/bin/steemd-start.sh'
alias replaysteemd='screen -X -S steem quit ; rm ~/steemd.log ; cd ~ ; screen -c ~/bin/steemd.conf -dmSL steem ~/bin/steemd-replay.sh'
alias entersteemd='screen -x steem'
alias logsteemd='tail ~/steemd.log -f -n30'

Log out and log in again (or type source ~/.bashrc).
Replay the node with replaysteemd.
Type logsteemd to monitor it in realtime.
If you want to start or restart it, type startsteemd, it will kill the current screen session and start it again.
If you entersteemd, exit the session with ctrl-a-d to leave the process running.
Keep an eye on the steemd.log size, delete if it grows too much.

Performance

The replay went fast and took a few hours. I noticed the replay was using 2 CPU cores out of 4, compared to the single core usage on 0.19.3. That's a good boost.

The memory usage is also lower, 37.8GB vs 42.2GB on my dockerized 0.19.3, that's a significant 4.4GB difference.

htop on the 0.19.4 server

htop master.png

htop on the 0.19.3 server

htop stable.png

And of course, successfully producing blocks with 0.19.4.

success.png


Available & Reliable. I am your Witness. I want to represent You.

🗳 If you like what I do, consider voting for me 🗳

Vote

Check my guide about Voting for Witnesses.
Go to https://steemit.com/~witnesses. My name is listed in the Top 50. Click once.
Alternatively you can use SteemConnect to vote for me or set me as proxy

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
39 Comments