How To Set Up A Hive Witness Using HIAB At Version 1.24.4

in HiveDevs2 years ago

Used With Permission From @someguy123

Because @someguy123 hasn't written a post about using HIAB I decided to do it, mainly because I use it and always end up referring to discord chats on how to set it up. Much easier to just have it all in one place, and what better place than the chain itself? Im just going over basic setup using snapshots but theres even more functionality(you can replay the server instead of using snapshot, or sync without a blocks_log file) which you can read about here:


First thing that you'll need is a server for this. Thanks to the efforts in HF 24, its become quite a bit easier to run I would recommend a Privex server for this because you can pay with Hive and HBD, but because we have a lot of witnesses already on Privex and its important to have our chain be distributed between different datacenter and providers, I would recommend that you find your own.

I run my witness(@hextech) on a server with 16 gigs of RAM and 4 threads for the witness along with 400 GB(320 GB being used right now) on a NVME on Ubuntu 20. Higher ram usage is required during the snapshot import process(reaching about 15.3 GB used).

Setting Up HIAB

I like to update my server as the first thing to do as well as install git and screen.

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install git -y
sudo apt-get install screen -y

Then we clone the repo.

git clone

And then use it to install docker for you. This shouldn't take too long.

cd hive-docker
./ install_docker

We can then install the latest docker image for the witness with. It will grab whatever is the latest from dockerhub(

./ install

The next step is to download the block_log(somewhere around 300 GB around now) as well as the snapshot files. We are going to do this in a screen so we don't need to remain connected while this goes on.

screen -S download
export BC_HTTP_RAW="" 
export RSYNC_BASE="rsync://"
./ fix_blocks

You'll be presented with a screen like this. For downloading the rest of blocks_log, you'll want to say yes (y). This will take a while, depending on the connection speed. The best thing to do is wait.

Screen Shot 20201107 at 5.17.16 PM.png

After that you'll be asked if you want to grab block_log.index as well. Say yes to that as well.

Then you'll get asked about snapshot, again say yes.

Finally you'll be asked about shared_memory.bin, for that say no(n).

While those are downloading, you can move onto the next few steps, I'll let you know where you'll need those files to move on.

CLI Wallet And Keys

Now we are going to want to generate our witness signing keys. You can reuse some keys that you already use, but it's recommended to generate new ones just for signing blocks. To do that, we use the cli_wallet.

We'll be using the remote wallet as our local instance isn't ready yet.

./ remote_wallet

You should get presented with something like this on a fresh install. If it says locked instead of new then you already have a wallet setup(you won't unless you are updating) and you can unlock it and skip the init step.

Screen Shot 20201107 at 5.25.29 PM.png

You can type in set_password to set your password. For example, if I wanted my password to be 123, I'd type in set_password 123 Remember the password as you'll need this to unlock the wallet in the future. You'll want to unlock your wallet after that. Thats as simple as unlock 123. Replace 123 with the password you set.

Once you are unlocked you can use suggest_brain_key to get a public private keypair generated. You'll want to save that as you'll need it in the future. Screen Shot 20201107 at 5.29.09 PM.png

You can exit the wallet by pressing control + D. If you ever forget your password, you can wipe the wallet clean and use a new password. A wallet.json file is generated and stored within the data directory. Just delete that and it'll start the wallet fresh again.


Next we'll need to modify the config file to work with our witness. Its located at data/witness_node_data_dir/config.ini directory. We'll want to modify that.

nano data/witness_node_data_dir/config.ini

Most of the values there are already good. If you want to modify anything go ahead if you know what you are doing.

The place we want to modify is witness = and private-key =. They are already commented out(line begins with #) so we can just go find them and delete the # at the start of the line. For the witness, you'll want to type in the username of the account that the witness will be running under. This value must go in quotes. The private key should be the private key that we generated from the cli wallet. This should not go in quotation marks. Use the image below as an example.

Screen Shot 20201107 at 5.42.17 PM.png

Starting Up

Going on, you'll need to have all the files that we started downloaded earlier ready to go. If not, please finish downloading then continue. While you wait for this to download, some good things to do are write a post about you staring up your witness, voting @hextech for witness and thinking about how you can help benefit the hive ecosystem.

We are going to load in the snap that we got so that we don't need to replay.

./ load_snap privexsnap  

This does take some time, but nowhere near as long as it would take if we had to run a replay. You can monitor what step of the process this is at by using ./ logs.

Once the snapshot loads in, it'll automatically start syncing up to live. You can check the sync progress using ./ monitor. It'll tell you how long it'll take to get synced up. Again this is a time to wait. You'll know that you are live when you see individual blocks being produced in ./ logs. That'll look like this:

Screen Shot 20201107 at 6.58.25 PM.png

The block numbers will be going up by one. Nows the big time, time to enable as a witness.

Enabling Your Witness

Let's enable the witness, you can do so using either the remote wallet or the local one. To use the local wallet, use ./ wallet and remote is ./ remote_wallet.

./ wallet

Unlock the wallet with the password set before using unlock 123 where 123 is the password. We'll want to import in your active key to sign the transaction that we'll be broadcasting. Find the private active_key using your preferred choice. If your private active key is 5KNrHHigj3PRurkm5moaV1XM3gWGrDZJJZCgPRL2FpBLjWy1obg you'd import it by typing in import_key 5KNrHHigj3PRurkm5moaV1XM3gWGrDZJJZCgPRL2FpBLjWy1obg

Now we want to broadcast enabling the witness. Modify the following command to match what you want and type it into the wallet. Replace username with the name of your witness, the part with the url you want to use for your witness and STM1111111111111111111111111111111114T1Anm with the public key generated for your private signing key when we first got into the wallet. Following that are your witness parameters, modify them to your liking, but these are the current standard ones being used by witnesses and so it's wise to follow along.

update_witness "username" "" "STM1111111111111111111111111111111114T1Anm" {"account_creation_fee":"3.000 HIVE","maximum_block_size":65536,"hbd_interest_rate":0} true

After that gets broadcast, you are up and running as a witness. You can check that you are enabled somewhere like The green ball means that you are enabled. Your version will not report to the version that you are using until you sign your first block so don't worry if it says 0.0.0. Just get the word out there that you are being a witness and get more votes.

Screen Shot 20201107 at 7.09.34 PM.png

I was following along on a fresh server and it took me 2 hours and 15 minutes to get to the point where I could broadcast the enable witness transaction. The latest updates and the work from someguy to make HIAB exist has made it a lot easier to be a witness.

Future & Questions

You'll want to setup a pricefeed and failover script as well. For pricefeed, I recommend someguy's hivefeed-js (can be found here as well for failover script(watcher by therealwolf works

As time goes on, you'll need to update. The update process might involve a replay or it might not. Hard forks involve a replay and soft forks usually don't. You can get information and ask questions about that in the Privex discord which can be found at The server requirements might increase as well and you might need to upgrade that.

If you like what I do, feel free to vote for my witness


Heh, you beat me to it.

Great guide, I've reblogged it so most HIAB users will find it :)

I am trying to figure it out and so far am not having all that much luck.

Here's the latest update on that experience.

I wonder what I may be doing wrong.

Made a comment on the post for anyone else wondering.

This is honestly awesome and very tempting for me to finally pull the trigger on launching a node myself

Posted using Dapplr

Setting up a node isn't too hard. Its maintaining it and campaigning for votes. Good luck if you decide to take the plunge.

Well, I know for a fact I wouldn't win the popularity contest for votes here (at least not yet) considering the amount of tight-knit mega whales there are - but, I would do it solely for the benefit of the community. I know it'd be a resource drain, but I'd simply ask for donations or just upvotes on posts/client posts to make it work.

Otherwise, I pay and it's cool - that's that. Sometimes, people have to act selflessly for the greater good, and I feel this is one of them (even if in just a very small way).

This is a good run down for HIAB - it's an easy starting point for anyone setting up their own server. I started using @drakos price feed it's simple and reliable

I recommended the one from someguy because I work on it from time to time and so I'm more familiar with it.

Sweet, Ill prob set up a witness sometime soon .. just snowballing myself there

Good luck. Setting up is very easy :) Getting the votes is soooooooo much harder.

Ive heard talk about resetting the witness votes in a future HF

Yup, I would love that since it would push me up since I'm newer :) But it would also mean witnesses actually have to work for their spot and can't sit back and relax like some of the top 50 are doing right now.

might be something to do on some rolling .. I kinda feel the same about delegations

Thanks for this. I'm in the process of running HIAB using Docker Desktop on a Windows 10 Home machine using WLS 2 (thanks @themarkymark).

I'd do a post when its all working.

My machine is quite a beast - 112 Gb RAM with 6/12 core Intel i76800k CPU, 500 Gb NVME SSD & 500 Gb SATA SSD - so I'm thinking of turning this into an API node and then running a witness on a second, lighter machine.

What changes do I need to make to do that?


What is the network traffic requirements for a witness node on a monthly basis?

Haven't really measured that. Setting up you'll eat up like 350 GB downloading everything you need. Day to day running is a lot less.

Screen Shot 20201112 at 9.07.15 PM.png

I've attached my network traffic graph for the last hour. I can't really tell how often its being transferred but I'm guessing per second, and using that as an estimate, its about 70 GB/month which really isn't bad at all. (30 kb/sec * 60 sec/min * 60 min/hour * 24/hour/day * 30 day/month).

Do you have a transaction log for how many requests you get during that timeframe.

Witness nodes don't normally handle requests(that'd be the job of a fullnode, but it is possible to take some specific requests which I have my witness node doing for some very small private projects). Witness nodes just get and process blocks and sign blocks when they get assigned to produce a block.

Now that I've got my witness node running I want to be able to take snapshots so I can restart easily in case of computer reboot. How do I do that?

I think you have to stop running it first(I haven't tried it yet) then run ./ dump_snap SNAPSHOTNAME. Then it'll be located within data/witness_node_data_dir/snapshot/ with the name that you chose.


I followed the steps, but getting this error after the steps of import_key.

./ line 1836: STEEM_RUN_ARGS[@]: unbound variable

Why the heck steem still exist?
Any idea why?

Thats a thing from hive-docker and @someguy123 being lazy and not renaming everything to Hive. For importing key, it should be done once you start wallet (./ wallet or ./ remote_wallet if your local node isn't synced up yet). Then unlock it and then do import_key 5XYZ....

I think I will start over.

There’s no need to start over, it only looks like you are doing something wrong in the wallet step. Just try it again.

Glad I found this. Incredibly helpful! 🙌


my blockchain version is 1.25.0

./ dlblocks --> is up to date
./ replay --> last step is database.cpp:5884 apply_hardfork HARDFORK 11 at block 3276913
./ start --> return the following error :

1174662ms database.cpp:170 open ] Opened a blockchain database holding a state specific to head block: 3348714 and last irreversible block: 3348691
1174670ms database.cpp:183 operator() ] Blockchain state database is AT IRREVERSIBLE state specific to head block: 3348714 and LIB: 3348691
1174672ms database.cpp:248 open ] 10 assert_exception: Assert Exception
revision() == head_block_num(): Chainbase revision does not match head block num.
database.cpp:192 operator()
1174672ms database.cpp:248 open ] args.data_dir: /steem/witness_node_data_dir/blockchain args.shared_mem_dir: /shm/ args.shared_file_size: 26843545600
1174675ms chain_plugin.cpp:538 open ] Error opening database. If the binary or configuration has changed, replay the blockchain explicitly using --replay-blockchain.
1174675ms chain_plugin.cpp:539 open ] If you know what you are doing you can skip this check and force open the database using --force-open.
1174675ms chain_plugin.cpp:541 open ] Error: {"code":10,"name":"assert_exception","message":"Assert Exception","stack":[{"context":{"level":"error","file":"database.cpp","line":192,"method":"operator()","hostname":"","timestamp":"2021-12-16T19:19:34"},"format":"revision() == head_block_num(): Chainbase revision does not match head block num.","data":{"rev":0,"head_block":3348714}},{"context":{"level":"warn","file":"database.cpp","line":248,"method":"open","hostname":"","timestamp":"2021-12-16T19:19:34"},"format":"rethrow","data":{"args.data_dir":"/steem/witness_node_data_dir/blockchain","args.shared_mem_dir":"/shm/","args.shared_file_size":"26843545600"}}]}

any idea ?


I just ran into this. You need to invoke ./ shm_size 25G or maybe even 30G to avoid the hive node from crashing and corrupting the database this way.


Thank you for this great guide, but you're missing an important line item: users need to invoke ./ shm_size <size> to prevent the hive node from crashing. I'm not sure what the necessary size is nowadays but I believe it's at least 25GB. Can you please add this to the guide?