Hived@Home

in #beco1322 years ago

A couple of months (or was it years?) ago I tried running a Hive-Engine witness node on my home PC. I could not find a recent database dump back then and replaying from the blockchain is impossibly slow, so I finally gave up. Recently I found out that the thing has been running on its own for some time. Apparently I had set a restart policy for the docker containers and had forgotten to delete them, so docker had them started at some point. As it is already close to finish (only 10M blocks behind) I will give it a chance. I even decided to run my own Hive node and synchronize the HE from it.

What I've learned so far from running hived

  • it is more lightweight and easy to set up than I expected
  • it runs in a Docker container
  • it doesn't require Hive account/keys to run, they are needed only for witness mode (which seems more fun)
  • as a database it operates with 2 main files - shared_memory.bin which seems like the actual database file, and blockchain_log which is the transaction log since day 1
  • respectively there are 2 main related concepts:
    • blockchain-replay - this is recovery of the database file (shared_memory.bin) from a pre-existing transaction log (blockchain_log). Necessary after any change in the local environment - e.g. new hived version, enable/disable of modules or what not
    • blockchain-resync - the process of getting entire blockchain_log from other nodes and recover local copy of database from it. No need to be done as long as there is a recent copy of the blockchain_log
  • full resync on my home PC takes more than 72 hours
  • full replay needs about 18-20 hours
  • the tricky part - it doesn't work with shared_memory.bin placed on HDD (4 HDDs in RAID10 in my case) - it requires more iops; runs quite good on tmpfs but then it has to be replayed after each reboot; nvme could be a better option, will try when I get one
  • getting block from my local node is +100x faster than internet - feels very satisfying; unfortunately hive-engine is not impressed at all and continues syncing at previous slow pace

That's all for now. In the near future I'll try to optimize the whole thing so it can be easily build and started at home. So far I've found some scripts and Dockerfiles but they are either incomplete/obsolete or part of some CI pipelines which are too complex for personal use. And perhaps I will become a witness one day, who would tell

Sort:  

Congratulations @beco132! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@beco132/upvotes.png?202303090255" /><td>You distributed more than 73000 upvotes.<br />Your next target is to reach 74000 upvotes. <p dir="auto"><sub><em>You can view your badges on <a href="https://hivebuzz.me/@beco132" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">your board and compare yourself to others in the <a href="https://hivebuzz.me/ranking" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ranking<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto"><strong>Check out our last posts: <table><tr><td><a href="/hivebuzz/@hivebuzz/call-for-support"><img src="https://images.hive.blog/64x128/https://i.imgur.com/xu0J1kD.png" /><td><a href="/hivebuzz/@hivebuzz/call-for-support">Keep Hive Buzzing - Support our proposal!<tr><td><a href="/hive-122221/@hivebuzz/pum-202302-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png" /><td><a href="/hive-122221/@hivebuzz/pum-202302-delegations">Our Hive Power Delegations to the February PUM Winners<tr><td><a href="/hive-139531/@hivebuzz/proposal-2324"><img src="https://images.hive.blog/64x128/https://i.imgur.com/RNIZ1N6.png" /><td><a href="/hive-139531/@hivebuzz/proposal-2324">The Hive Gamification Proposal <h6>Support the HiveBuzz project. <a href="https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22248%22%5D&approve=true" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Vote for <a href="https://peakd.com/me/proposals/248" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">our proposal!