Steem-in-a-box for v0.17.0

Hardfork 17 has been very controversial. Despite this, I've produced a docker image for v0.17.0 for those who do want to upgrade, however it was postponed today. There may have been bug fixes, memory improvements etc. so you can still upgrade if you want without any negative effects.

This article is a technical article intended for those administrating STEEM servers, including seed nodes, witnesses, and RPC nodes. In layman terms, this article is explaining a piece of software written by myself designed to assist others with setting up STEEM servers (e.g. witnesses).

Are you looking for a new hosting provider? @Privex are offering low-cost dedicated and virtual servers with a 100% Block-Miss SLA for witnesses (we pay you $2 for every block miss caused by our service). Message me on STEEMIT.CHAT or email sales [at] privex.io (We accept STEEM and most other cryptos, as well as PayPal)


What is Steem-in-a-box?

Steem-in-a-box (or just SIAB for short) is a small piece of software I wrote for deploying STEEM nodes (and GOLOS), it is updated alongside my docker images. SIAB is used by quite a few witnesses including myself @someguy123, @chitty, @arcange, @thecryptodrive and many more due to it's ease of use.

Technical details: SIAB is a set of bash scripts which assist with deployment of the STEEM docker images which I create, source available here: https://github.com/Someguy123/steem-docker

Since I never properly explained the "SHM Fix" in a single up to date guide, I've decided to include an up to date fresh install, and upgrade guide for Steem-in-a-box (for witnesses)

If you're upgrading, skip to the bottom of this article for upgrade instructions from HF16

Fresh install

Be aware that docker is a virtualisation technology, which means it's completely safe to run each command as root, since the container will be fully isolated from your system once it's running.

First, install docker if you don't already have it:

apt update && apt install curl git
curl https://get.docker.com | sh

Now, download Steem-in-a-box from my Github:

git clone https://github.com/Someguy123/steem-docker.git
cd steem-docker

The core of Steem-in-a-Box is run.sh. This is a BASH script which abstracts all of the docker magic, making it easy to deploy a docker-ized STEEM container, without needing to fully understand docker.

Run the following command to download the latest copy of STEEM from my DockerHub:

./run.sh install

Now you should have a ready-to-go Steem-in-a-box. Let's configure it

If you're a witness, you'll need to add your name and private key to the config.ini, as well as adjust the shared memory size depending on how much RAM you're willing to give it.

Open data/witness_node_datadir/config.ini, and adjust the size of the shared memory file as needed. 8GB is the minimum for a witness, 12GB is the default and recommended if you have enough RAM for that.

# Remember to comment out p2p-endpoint and rpc-endpoint if they're not needed
# p2p-endpoint is for SEED nodes, rpc-endpoint is for RPC's but it also allows inspection
# of your witness's synchronization state
shared-file-size = 12G
# If you want to use the disk instead of memory, change to /steem/ instead of /shm/
shared-file-dir = /shm/

Now, make sure you adjust the /dev/shm size to the size you put in the config (preferably bigger). If you don't have enough RAM for this, you should reduce the shared memory size or you'll risk missing blocks. You may be able to get away with using SWAP, however I cannot guarantee that you won't miss blocks if you do that.

# Adjust /dev/shm to 13gb
./run.sh shm_size 13G

Configure for a seed

A seed is a type of STEEM node which distributes blocks, and broadcasts transactions to other nodes on the network. It's similar to a Bitcoin Full/Supernode. It does not "mine" or "witness" blocks.

Steem-in-a-box comes preconfigured as a seed, and will automatically attempt to expose PORT 2001 to the world. You DO NOT need to follow the instructions below unless you want to change the port.

Optional: Change the Steem-in-a-box seed port

If for some reason, you don't want to use 2001, you can change this. Edit the file data/witness_node_data_dir/config.ini, and change 2001 to some other port, let's say 2005

p2p-endpoint = 0.0.0.0:2005

You'll also need to create a file in the same directory as run.sh, called .env, this is a file used by Steem-in-a-box to determine custom settings for docker. Put the following in the file:

PORTS=2005

This tells it to forward port 2005 from docker, to your public IP address.


Configure for a Witness

A witness is a special type of STEEM node which produces blocks, similar to a miner. You can read more about what a witness does in my article: Seriously, what is a STEEM witness? Why should I care? How do I become one? (Answer)

To start, create a file in the same directory as run.sh, called .env, this is a file used by Steem-in-a-box to determine custom settings for docker. Put the following in the file:

PORTS=
DOCKER_NAME=witness

By leaving the PORTS blank, this prevents it attempting to forward any P2P ports. We also change the name of the docker container, this prevents confusion when you're managing both a seed and a witness, as the container will be correctly named "witness".

By setting up a witness, I assume that you're aware of the security concerns, and basic procedures for running a witness, so I will explain them only lightly.

Edit data/witness_node_data_dir/config.ini, disable the p2p-endpoint, and fill out your witness details. By default I already disable account_history and all of the other plugins/apis not useful for witnesses/seeds

# p2p-endpoint = 
witness = "someguy123"
private-key = 5JiHZCzXmAhyezYrvSdBu8587YVPPvAnCp5Nx14tJPzGx6MDg4M

Starting the server

Once you've configured Steem-in-a-box to your requirements, you may start the node with:

./run.sh start

You can check the status of it with ./run.sh status, and ./run.sh logs

You should see the node syncing in the logs. Once it's fully synced, you're ready to go!


UPGRADING FROM HF16

For those of you with an existing HardFork 16 installation (of steem-in-a-box), the following instructions will get you up to date:

Disable your witness, or change it to your backup key

./run.sh wallet

locked>> unlock "supersecurepassword"
unlocked>> update_witness "someguy123" " " "STM1111111111111111111111111111111114T1Anm" {"account_creation_fee":"30.000 STEEM","maximum_block_size":65536,"sbd_interest_rate":300} true

Now stop the witness server

./run.sh stop

Delete any old leftover docker containers

docker rm {seed,witness}

Now, make sure you delete the /dev/shm files, as they will not be compatible with HF17 and need to be re-built

rm -rf /dev/shm/*

Finally, upgrade your steem-in-a-box, then start it with replay

git pull
./run.sh install
./run.sh replay

You can now check the logs with ./run.sh logs and see that it's rescanning the blockchain. Once it's fully replayed, you can re-broadcast your witness :)


Tired of missing blocks? @Privex are offering low-cost dedicated and virtual servers with a 100% Block-Miss SLA for witnesses (we pay you $2 for every block miss caused by our service).

Message me on STEEMIT.CHAT or email sales [at] privex.io (We accept STEEM and most other cryptos, as well as PayPal)


Do you like what I'm doing for STEEM/Steemit?

Vote for me to be a witness - every vote counts.

Don't forget to follow me for more like this.


H2
H3
H4
3 columns
2 columns
1 column
3 Comments