Steem-in-a-Box - Ready for HF15 (v0.15.0)

in #steem8 years ago (edited)

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.


Cardboard Box by Hay Kranen / Public Domain

Many people use my docker image, Steem-in-a-box for deploying their STEEM servers, and it's changed a little since it was first introduced.

Steem-in-a-box uses Docker to isolate the STEEM client, preventing version conflicts, and also allowing for binaries which work on any Linux distribution, since it runs within a compact Ubuntu16.04 docker container.

DISCLAIMER: Sysadmins, If you have any custom iptables rules, Docker can and WILL interfere with them. Read about it here

In this article, I will explain

  1. Installing Steem-in-a-box
  2. Using it for a SEED
  3. Using it for a Witness
  4. Upgrading existing Steem-in-a-box installs

Installation

Installation is the same as the original, except now we have a binary image.

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

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.

Steem-in-a-box comes preconfigured as a seed, and will automatically attempt to expose PORT 2001 to the world.

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 name "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 Steem-in-a-box

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 an existing Steem-in-a-box

If you're running an older version of Steem-in-a-box, you'll need to pull in the latest changes. Back up your config.ini before doing this, as it may get damaged.

cd steem-docker
git pull

Once you've pulled in the latest changes, you can then upgrade the docker image:

./run.sh install

Once your docker image is upgraded, you will need to stop the existing node

./run.sh stop

Destroy the original image, so that it may be replaced by the updated version of STEEM. The default container is called seed, regardless of whether it's a seed, witness or an rpc node. If you've got a customized .env file, or you've modified run.sh, take that into account.

docker rm seed

Now that you've cleaned up, you can start the system again:

./run.sh start

Make sure it's syncing with

./run.sh logs

Once it's done syncing, you can enter the wallet to confirm the version:

./run.sh wallet

new >>> about

{
  "client_version": "v0.15.0",
  "steem_revision": "3379b5be8fa1567ece35beab1c8af1761d5d4e00",
  "steem_revision_age": "4 days ago",
  "fc_revision": "636d4530e3ac9e37040d43f1a1ff56caffb38166",
  "fc_revision_age": "33 days ago",
  "compile_date": "compiled on Nov  6 2016 at 02:33:51",
  "boost_version": "1.58",
  "openssl_version": "OpenSSL 1.0.2g  1 Mar 2016",
  "build": "linux 64-bit"
}

If you see the updated version, this means you've successfully upgraded your STEEM node :)

Steem-in-a-box is an open source project, released under the GNU AGPL 3.0, available at https://github.com/Someguy123/steem-docker

Golos-in-a-box is also available, and works exactly the same, but for the GOLOS (голос) network, https://github.com/Someguy123/golos-docker


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.


Sort:  

Thanks, that is helpful. I'm playing with the idea of becoming a witness an this will save me a ton of time.

This post has been linked to from another place on Steem.

Learn more about and upvote to support linkback bot v0.5. Flag this comment if you don't want the bot to continue posting linkbacks for your posts.

Built by @ontofractal

My Man! Wish I'd come to this thread long ago. Took a couple fixes to data/witness_node_data_dir/config.ini but it's up and running now. Let me know when/if you're on Steemit Chat, I have a question. Thanks again!

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.029
BTC 67865.46
ETH 3258.03
USDT 1.00
SBD 2.64