Zero to Witness: Part 6: Unpacking the blockchain and configuring Steem

Welcome back, intrepid Witnesses-To-Be!

It took a while, but the blockchain's now downloaded. Let's continue :)

Unpacking the blockchain

First, log into the server over SSH as usual, and reattach to the Screen session:

screen -r

Hopefully, you'll see a completed download waiting for you. We're going to stay inside the screen session for now, as we're about to kick off another process that will take a long time to complete: Unpacking the blockchain archive.

First, let's make a new top-level directory to contain the blockchain data. The archive also expects a blockchain directory inside that, so we'll create that too, and then change the permissions of the new directory so that they're owned by our steem user:

sudo mkdir /steemdata
sudo mkdir /steemdata/blockchain
sudo chown steem:steem -R /steemdata

(Note that the slash at the start of the new directory name means we want a top-level directory at the root of the filesystem, rather than a new subfolder inside our current directory.)

Decompressing the blockchain data is another long operations, and unfortunately the tar decompressor doesn't come with a built-in progress bar. Not to worry! Let's install the "pv" tool, which will fix that:

sudo apt install pv

Now we'll need the filename of the archive we just downloaded. Can't remember? To see the normal (non-dotted) files in your home directory, just do:

ls -lh

Once you have the correct filename, substitute it into the following command, which will start decompression and pipe everything through pv so we get a nice progress bar as the archive unpacks:

sudo pv steem_witness_20220805.tar.lz4 | lz4 -dc - | tar -xv -C /steemdata

unpacking.PNG

Oh dear! Looks like a good time to put the kettle on. There are quite a few files to be decompressed, but block_log is definitely the biggest. Remember we're in a Screen session, so it's safe to close your SSH window, come back later and reattach your sesh.

Once the decompression has eventually finished, the blockchain archive will have been unpacked to the /steemdata directory.

Let's see how our disk space is doing, with the handy built-in tool "df":

df -h

df reports the amount of space on each of our drives, and the -h switch forces its output into a nice human-readable format.

df.png

There are several drives listed - the one we're interested in is the one mounted on / (shown in the right-most column).

To reclaim 233Gb of disk space, let's delete our local copy of the archive (again substituting the correct filename):

rm steem_witness_20220805.tar.lz4

Doing df again after that shows that total disk usage is 352Gb (41%).

Finally, exit your current Screen session:

exit

Setting up Steem node config

To ensure everything is working correctly, we'll first get Steem running in "Seed Node" configuration. This will make sure that our node is able to connect to the Steem peer-to-peer network, sync the missing blocks that have occured since the block archive was made, and act as a block source for other Steem nodes.

Once this is working, then we'll tweak a couple of things so that our node is a Witness Node.

@ety001 is here to help us once again, with a config file that will drop right in and initially configure our Steem deployment as a Seed Node. Later, we can very easily edit a couple of lines to change to a Witness Node.

Using wget, we'll grab @ety001's config file, and move it to where it needs to be:

wget https://gist.githubusercontent.com/ety001/42aee2d6f32be4baaf55a6f45efd87a9/raw/dce400d1626ed6097ef1646256b4c7f7ed69f3c6/config_witness.ini
mv config_witness.ini /steemdata/config.ini

That's it for the Steem config!

Punch a hole in the firewall

Steem communicates with other peer-to-peer Steem nodes on port 2001. Refer back to Part 3 if you need a refresher on the concept of ports. Docker is already set up to connect the server's port 2001 to the container; but we still need to tell UFW to allow connections to port 2001.

That's easy to do:

sudo ufw allow 2001/tcp

Remember we can check the current firewall rules with:

sudo ufw status

Summing up

That's another good day's work.

At this point, the only thing left to do before starting the Steem node for the first time is to create a couple of little utility scripts to help us manage the node.

Next time, we'll do that, and see First Light from our node!

Series Index

Part 1: We need a big computer!
Part 2: Connecting to the server
Part 3: Securing the server (see also Passwords: A Rant)
Part 4: Enabling certificate authentication
Part 5: Downloading the blockchain

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65306.74
ETH 3488.89
USDT 1.00
SBD 2.51