Upgrading your Witness Node for HF26

in Hive Governance2 years ago (edited)

HF26 is right around the corner, on the 11th of October 2022. If you're a witness, now is the time to update your node(s).

Below is a short guide to get you started with Docker asap. If you prefer to install & run hived manually, check out this post by @themarkymark.


Prerequisites

  • Ubuntu 20.04 or 22.04 (check via lsb_release -a)
  • At least 400GB disk-space if using & downloading compressed block log, though I'd say 1 TB is recommended

Step 1

Git clone the hive-docker script (originally created by @someguy123, forked by @drakos)

# Clone Repo
git clone https://github.com/Jolly-Pirate/hive-docker.git && cd hive-docker

# Create & edit .env file
touch .env && nano .env

Step 2

Paste the code-snippet below into the .env file (make sure to comment/uncomment the line for BUILD_OS depending on your ubuntu version)

PORTS=8090
DOCKER_NAME=witness
CONTAINER_TYPE=witness

#SHM_DIR=$(pwd)
SHM_DIR=/dev/shm

# HF25 doesn't build on ubuntu 22.04
# Don't use ubuntu:bionic or focal on HF26 develop, gives a: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
BUILD_OS=phusion/baseimage:focal-1.2.0 # ubuntu 20.04
# BUILD_OS=phusion/baseimage:jammy-1.0.0 # ubuntu 22.04
REPO_SOURCE=https://gitlab.syncad.com/hive/hive
TAG_VERSION=v1.26.0rc4

Step 3 (Optional)

Run these if needed

# Install linux utils packages
./run.sh preinstall

# Install Docker
./run.sh install_docker

# Install and configure NTP synchronization
./run.sh install_ntp

# Set some optimization configs
./run.sh optimize

Step 4

Build the hived software, edit the config

# Build Hived
./run.sh build v1.26.0rc4

# Set SHM size
./run.sh shm_size 20G

Step 5

Edit the config and change the witness + private-key parameter. If you have a previous config.ini file, you can just copy the values from there.

nano data/witness_node_data_dir/config.ini

Step 6

Download the block log. Make sure you confirm the deletion of the old block log and select compressed. You could also use an existing one, but the script downloads the latest from @gtg and that's always a trusted & reliable source.

# Download Block Log
./run.sh dlblocks

Step 7

Replay the blockchain. You can also set a checkpoint by adding checkpoint = [68492031,"04151aff878fe5945aca7f4e9052044ecf743875"] to the config.ini, though when I set it, I didn't noticed anything on startup. However, the replay was quite fast either way!

# Replay
./run.sh replay

Step 8

If a new version should be released, simply edit the TAG_VERSION within the .env file, rebuild, and then (if not otherwise noted) ./run.sh restart


And that's it. I hope these instructions are helpful!

Big thanks to @drakos for providing the forked script. If you like, make sure to toss a vote to his witness.

Sort:  

Thanks for the shout out.

😊😎🤙 Nice! very good of u. what exactly will this HF do?

Congratulations @therealwolf! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You distributed more than 195000 upvotes.
Your next target is to reach 200000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

Trick or Treat - Share your scariest story and win your Halloween badge
Hive Power Up Day - November 1st 2022
Support the HiveBuzz project. Vote for our proposal!