As some people may know already from the witness chats, I released a new version of Steem-in-a-box for Appbase/Chainbase.
Appbase is a major overhaul of the steemd software, it brings many breaking changes, such as the removal of plugin numbering (thus apps that still use @xeroc's piston will break if connecting to an appbase server).
For most witnesses, these breaking changes will not affect the software itself. Over the past few appbase releases, bugs have been ironed out, and I've now upgraded to v0.19.12 myself after holding out for a while (when I first tested 0.19.10 I found several bugs immediately).
Why upgrade to Appbase?
Appbase brings many new features (soft fork, so it's not mandatory), such as the ability to change posts older than 30 days, memory and performance improvements, and an overhauled config format. It also includes a change to shared memory (shm), where it will automatically resize the shared memory file as needed.
I will still be maintaining non-appbase versions until they're no longer supported (probably in 1 month when HF20 hits).
Until then, you'll need to follow some slightly different instructions than the standard upgrade procedure, as steem-docker has appbase on a separate branch.
Upgrading from non-appbase
Please be warned. Upgrading from non-appbase (anything lower than 0.19.10) to appbase will require a replay. It's strongly recommended to do this on your backup server first, or change to your backup server during the upgrade.
Server Version Check
First, you'll want to check your server's version.
This is as simple as:
docker logs seed | grep "blockchain version"
You should see something like:
blockchain version: 0.19.6
If your version is lower than 0.19.10, then you're not on appbase, and will have to re-make your config.
Again, upgrading from non-appbase to appbase will require a replay. Do this on your backup server, or disable your witness during the upgrade!
First, checkout the appbase branch. To avoid upgrading unsuspecting users to appbase, it's on a separate git branch, meaning you have to activate this branch first.
~/steem-docker $ git fetch ~/steem-docker $ git checkout appbase
Move your old config out of the way. Appbase has a new config format, Steem-in-a-box will create a new example config for you.
mv data/witness_node_data_dir/config.ini data/witness_node_data_dir/config.ini.bak-aug2018
Download the appbase docker image using this command. Assuming you've renamed your config file, this will also generate a new example config for you into config.ini.
Fixing your config
Now, you'll want to put your witness name and key back into the new config.
This command will quickly obtain your witness name and private key for copy pasting:
cat data/witness_node_data_dir/config.ini.bak-aug2018 | grep -E "^witness|private-key"
You'll see something like this:
~/steem-docker $ cat data/witness_node_data_dir/config.ini.bak-aug2018 | grep -E "^witness|private-key" witness = "someguy123" private-key = 5xxxxxxxxxxxxxxxxx
Open your new config:
Comment out p2p-endpoint (put a # at the start of it) if this is for a witness. You don't want your witness node running a seed.
# p2p-endpoint = 0.0.0.0:2001
Place your witness name and private key somewhere in the middle of the file (near the "name of witness controlled" comment makes it easy to find), like this:
# Percent of witnesses (0-99) that must be participating in order to produce blocks required-participation = 33 # name of witness controlled by this node (e.g. initwitness ) # witness = witness = "someguy123" private-key = 5xxxxxxxxxxxxxxxxx
For the shared memory settings at the top, I strongly recommend leaving it at 60G, as it will automatically expand (new appbase feature) when it needs to.
A server with 64gb RAM is still the recommended size for witnesses, however this may change over the next few weeks as the chain grows.
Now for the slow part - replaying
When upgrading from non-appbase to appbase, you'll need to replay.
To replay your witness, do the following (this will shutdown and remove the pre-appbase software, and start an appbase one in replay mode)
./run.sh stop ./run.sh replay
You can check the status of the replay with the logs command
Note: the command now automatically updates in realtime. to exit the logs press CTRL-C
If all is well, you'll see it replaying on v0.19.12 (or whatever appbase version is out by the time you read this):
blockchain version: 0.19.12 ------------------------------------------------------ 1075751ms main.cpp:121 main ] Backtrace on segfault is enabled. 1075751ms chain_plugin.cpp:394 plugin_startup ] Starting chain with shared_file_size: 64424509440 bytes 1075751ms chain_plugin.cpp:472 plugin_startup ] Replaying blockchain on user request. 1075751ms database.cpp:173 reindex ] Reindexing Blockchain 1078354ms block_log.cpp:142 open ] Log is nonempty 1078355ms block_log.cpp:151 open ] Index is nonempty 1078355ms database.cpp:181 reindex ] Replaying blocks... 0.395276% 100000 of 25298786 (61434M free) 0.790552% 200000 of 25298786 (61434M free) 1.18583% 300000 of 25298786 (61433M free) 1.5811% 400000 of 25298786 (61432M free)
Once it's replayed (may take 3 or more hours), you'll see the standard "got x transactions on block y".
1668107ms p2p_plugin.cpp:210 handle_block ] Got 54 transactions on block 25299003 by cervantes -- latency: 107 ms 1671090ms p2p_plugin.cpp:210 handle_block ] Got 36 transactions on block 25299004 by blocktrades -- latency: 90 ms 1674098ms p2p_plugin.cpp:210 handle_block ] Got 28 transactions on block 25299005 by roelandp -- latency: 98 ms
If you see this, you can now re-enable this server :)
You're successfully upgraded to 0.19.12 (or higher).
For future appbase releases, it will now be as simple as
./run.sh install && ./run.sh restart, but as always, be careful, always assume a replay may be needed. Test on your backup, or disable your witness before attempting to update.
To see if I've released a new version of the docker image and haven't made a post yet, just check my docker hub: https://hub.docker.com/r/someguy123/steem/tags/
GIF Avatar by @stellabelle
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.
Have you ever thought about being a witness yourself? Join the witness channel. We're happy to guide you! Join in shaping the STEEM economy.
Are you looking for a new server provider? My company @privex offers highly-reliable and affordable dedicated and virtual servers for STEEM, LTC, and BTC! Check out our website at https://www.privex.io