Power to the Hive (but just a little)

in Blockchain Wizardry5 months ago (edited)

During the last Core Dev meeting, I’ve mentioned my Hive consensus node setup that consumes 7W of power. That was just my rough estimate, but because I was asked for more details, I took a closer look to provide a more detailed presentation. Please note that this is just an example, definitely not the optimal. It serves my needs, but yours might be different.

Hardware choices

Brand new, fancy Zotac (except not)

Hey, wait, is this Zotac sponsored content? No, it’s not. They suck (now with AirJet technology) ;-)
I've heard about this particular new model: ZBOX pico PI430AJ with AirJet.
Maybe it’s cool, maybe it’s not.
I wanted to buy it and try it, but it doesn’t seem to be available (as of December 2023), and they ignored my emails.

Maybe it’s expensive, but at least it's unavailable ;-)

Other modern alternatives

There are plenty of those. It depends on the details of what exactly you are looking for.
Intel i3-N300 looks promising with its 7W TDP while being really performant. The N100 and N200 are also great for similar use cases.
However, I needed it ASAP and, due to chronic lack of time, I wanted something that would run out of the box.
I couldn’t find anything with N300 or N100/N200 with a reasonable price and delivery dates so…

Recycled old Zotac

Why Zotac again? Pure coincidence.
It’s about effectively using available resources, not wasting them for fun. So instead of buying a brand new fancy piece of hardware, I decided to reuse one that I bought in early 2016. They had these ready-to-use, good-looking products, where I didn’t have to worry about finding a proper chassis to fit components in without risking inadequate heat dissipation. It served me well running 24/7 for most of the time, so it’s definitely a good candidate.
Back then, I paid 130EUR for the barebone. Originally, it came with 4GB RAM and 128GB SSD, which I upgraded for the purpose of running hived.

Meet the nano

It’s Zotac ZBOX CI323 nano
It’s very small: 127mm x 127mm x 57mm
And handsome:

Nano Hive

You have to admit, the chassis design is perfect for Hive, even though I got it even before the genesis block of the legacy chain was produced.

CPU

Equipped with an Intel(R) Celeron(R) CPU N3150 @ 1.60GHz

To put it into perspective, according to Passmark, one of the most popular CPUs these days, a 5-year-old AMD Ryzen 5 3600 has a CPU Mark of 17779, while Intel Celeron N3150 has a CPU Mark of 1199 (yes, almost 15x less performant).

Memory

Unfortunately, it can handle a maximum of 8GB RAM. So I just installed that.
I would rather go for a setup that could support 16GB, as it would be much easier to manage (like with the N100/N200/N300)
Ideally, 24-32GB would be better, but even N300 wouldn’t suffice for that. It is what it is. We can make do with 8GB.

Storage

Samsung SSD 870 EVO 1TB - I chose this simply because it was available for testing. It’s popular, affordable, and big enough for backup purposes.

Connectivity

It has two Gigabit Ethernet ports and is connected to two different network providers, with 0.2-0.6 ms latency to edge routers.

It has a lot of other fancy features, but for our purposes, those are irrelevant, so we won’t spend time on them. If you are curious, just use the links to the detailed specs provided by the menufaturers.

Software

OS

No, it’s not Ubuntu 22.04 LTS.
I use Debian 12 instead.
Why?
No particular reason.

”Your mama’s so old, she's in Debian Stable.”

Well, maybe I’m just old.

I installed it from a USB, and the whole process took less than 20 minutes.

Prerequisites

I haven’t configured it for development, so while it’s unable to build hived, it’s ready to bootstrap it from a “starter pack” available on my https://gtg.openhive.network

Or so I thought.

Starter pack

To start quickly, I needed a block_log and block_log.artifacts (the latter is optional, but having it reduces the time needed for startup, as downloading is much faster than generating it on this low-performance hardware).

Getting a snapshot and uncompressing it on the fly was an unexpectedly long process (as expected ;-) ).
Simply put, this machine isn’t fast enough to cope with the amount of heavily compressed data coming from a fast network connection.

Of course, I also needed a hived binary. There’s no point wasting time and building it from scratch. The CPU is slow, but it’s still x86_64, and a binary from the starter pack, despite being built on and for Ubuntu 22.04 LTS, runs on Debian 12 without issues.

Getting all the required data, thanks to the fast connection, took less than 2 hours.

Hived Configuration

I want to run a consensus node but with account_by_key and transaction_status plugins for convenience, so it’s mostly based on the exchange-example-config.ini, with the account_history_rocksdb plugin and settings commented out.

Loading from snapshot

When you already have the starter pack in place:

.hived
├── blockchain
│   ├── block_log
│   └── block_log.artifacts
├── config.ini
└── snapshot
    └── latest

You can simply start ~/bin/hived-v1.27.4 --load-snapshot latest

…and wait for 3 hours for it to fail due to running out of memory.

That’s likely because loading the snapshot is configured by default to use a lot of resources, which is not suitable for low-end machines.

Running with copied state

All I had to do was “transplant” an existing state stored in shared_meory.bin from one of my other nodes. Of course, I needed to ensure that the block_log matched. Downloading takes about 5 minutes.

With the new directory structure looking like this:

.hived
├── blockchain
│   ├── block_log
│   ├── block_log.artifacts
│   └── shared_memory.bin
└── config.ini

I simply started it with ~/bin/hived-v1.27.4, and within a minute it was up to the head block and has been keeping up ever since.

Block stats looks like this:

{"num":80829589,"bp":"deathwing","txs":26,"size":8073,"offset":-254133,"exec":{"offset":-318320,"pre":837,"work":63350,"post":1213,"all":65400}}
{"num":80829590,"bp":"good-karma","txs":63,"size":38989,"offset":-209402,"exec":{"offset":-262837,"pre":1157,"work":52278,"post":4951,"all":58386}}
{"num":80829591,"bp":"engrave","txs":109,"size":33431,"offset":-193473,"exec":{"offset":-249851,"pre":3324,"work":53054,"post":6334,"all":62712}}
{"num":80829592,"bp":"themarkymark","txs":88,"size":52161,"offset":-197929,"exec":{"offset":-261370,"pre":3135,"work":60306,"post":5032,"all":68473}}
{"num":80829593,"bp":"roelandp","txs":128,"size":31096,"offset":-229059,"exec":{"offset":-271217,"pre":2247,"work":39911,"post":3351,"all":45509}}
{"num":80829594,"bp":"yabapmatt","txs":93,"size":29071,"offset":-235377,"exec":{"offset":-264357,"pre":2094,"work":26886,"post":5870,"all":34850}}
{"num":80829595,"bp":"quochuy","txs":151,"size":64217,"offset":-234209,"exec":{"offset":-281692,"pre":2835,"work":44648,"post":1632,"all":49115}}
{"num":80829596,"bp":"guiltyparties","txs":88,"size":25814,"offset":-243246,"exec":{"offset":-272498,"pre":1755,"work":27497,"post":4227,"all":33479}}
{"num":80829597,"bp":"abit","txs":174,"size":36404,"offset":-161127,"exec":{"offset":-235618,"pre":3439,"work":71052,"post":7639,"all":82130}}
{"num":80829598,"bp":"stoodkev","txs":148,"size":37167,"offset":-184325,"exec":{"offset":-221677,"pre":3163,"work":34189,"post":5399,"all":42751}}
{"num":80829599,"bp":"ocd-witness","txs":94,"size":31547,"offset":-249496,"exec":{"offset":-292343,"pre":2078,"work":40769,"post":1476,"all":44323}}
{"num":80829600,"bp":"emrebeyler","txs":146,"size":46342,"offset":-215147,"exec":{"offset":-260921,"pre":2987,"work":42787,"post":6332,"all":52106}}
{"num":80829601,"bp":"arcange","txs":132,"size":31830,"offset":-264145,"exec":{"offset":-303826,"pre":2637,"work":37044,"post":2898,"all":42579}}
{"num":80829602,"bp":"smooth.witness","txs":103,"size":28005,"offset":-38917,"exec":{"offset":-82887,"pre":2268,"work":41702,"post":9402,"all":53372}}
{"num":80829603,"bp":"ausbitbank","txs":129,"size":27922,"offset":-236931,"exec":{"offset":-278227,"pre":1819,"work":39477,"post":1615,"all":42911}}
{"num":80829604,"bp":"blocktrades","txs":200,"size":54257,"offset":-84679,"exec":{"offset":-139029,"pre":3185,"work":51165,"post":8174,"all":62524}}
{"num":80829605,"bp":"brofund","txs":157,"size":34013,"offset":-143719,"exec":{"offset":-185494,"pre":4184,"work":37591,"post":4755,"all":46530}}
{"num":80829606,"bp":"therealwolf","txs":101,"size":26220,"offset":-268139,"exec":{"offset":-301179,"pre":2133,"work":30907,"post":2866,"all":35906}}
{"num":80829607,"bp":"steempeak","txs":65,"size":15196,"offset":-238585,"exec":{"offset":-273225,"pre":1681,"work":32959,"post":1526,"all":36166}}
{"num":80829608,"bp":"threespeak","txs":133,"size":28875,"offset":-200882,"exec":{"offset":-247846,"pre":2878,"work":44086,"post":3558,"all":50522}}
{"num":80829609,"bp":"gtg","txs":100,"size":31987,"offset":-235297,"exec":{"offset":-264000,"pre":1871,"work":26832,"post":1649,"all":30352}}

Not great, not terrible. ;-)

As you can see, it can easily keep up with the current traffic.

Temperature

It’s passively cooled, meaning there are no moving elements, such as fans, that would generate noise.

Output of sensors:

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +26.8°C  (crit = +95.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +34.0°C  (high = +90.0°C, crit = +90.0°C)
Core 1:       +34.0°C  (high = +90.0°C, crit = +90.0°C)
Core 2:       +42.0°C  (high = +90.0°C, crit = +90.0°C)
Core 3:       +42.0°C  (high = +90.0°C, crit = +90.0°C)

Power consumption

At peak it never reached 12W (actually, 11.5W) and that was during a massive sync.
When hived is at the head block (which is its usual condition after the initial setup) it consumes 6-7W.

Power to the Hive

The last 24-hour average was 6.3W.

Energy and Power

Trivia (A Light Bulb, a Coffee Machine, and a Tesla)

A Light Bulb

At a conference this year, @detlev and @arcange discussed how a Hive node’s power consumption could be compared to that of a single light bulb.
This comparison is not only accurate but also an understatement in the case of our setup. Our little Hive node consumes about as much power as a single LED light bulb.

Coffee Machine

Interestingly, a standard coffee machine running for an hour consumes significantly more energy than our Hive node does in an entire day.

Tesla Model 3

A fully charged Tesla Model 3 battery has enough energy to run our Hive node for over a year.

Sort:  

You have to admit, the chassis design is perfect for Hive

Hmm... is that a sticker covering air vents? 🔥

yes, almost 15x less performant

And it does show on work times in block stats, but 15 times of almost nothing is still not significant :o)
It would be nice to try it on a testnet with large blocks.

Unfortunately, it can handle a maximum of 8GB RAM.

I'm surprised hived even runs on that. Maybe we can try to put a node on some smartphone next? 📱

Hmm... is that a sticker covering air vents? 🔥

Yes, I got it from @audiarmisg (thanks), but actually it's mostly covering the manufacturer logo and it's for the purpose of taking photo (I also disconnected it from two Giga Ethernet connections and let it work via WiFi during that time as I needed to bring it to a better background :-)

It would be nice to try it on a testnet with large blocks.

I want to test it with a mirror net to see how it would perform in actual top witness role. It would have to keep up with fast confirms, etc.

I'm surprised hived even runs on that. Maybe we can try to put a node on some smartphone next?

I'm surprised that it not only runs on 8GB, but it doesn't actually use swap that much.
Smartphones and toys like Raspberry Pi runs on ARM and it wouldn't be that easy to build it and start it (replay would be a pain and I don't have a state donor for ARM).

So glad to hear you're using the stickers ☺️ about the system and the node I don't know much 🫣 but that it works great 🙌

👀

edit: Ok I'm done reading, nice little machine ! I'm glad you are going with "ancient" hardware instead of going with the new bells and whistles when it's not necessary

Man, this thing looks great! Congratulations, man. I agree with @ph1102's comment. This could be an amazing advertisement.

A fully charged Tesla Model 3 battery has enough energy to run our Hive node for over a year.

There you go... An idea! To run the HIVE node inside the Tesla car!!! Imagine the marketing potential of that! 🙂

Nah, just buzz words without real use case... which is still better than dogecoin ;-)
You missed that easter egg, didn't you? ;-)

Hehehehe... It looks like I did... 😃

So much power, perfect for minecraft hahaha <3

Minehive

Very neat setup.

Have you tinkered with TLP (or something like it) to see if you can fine tune the power usage?

No, TLP isn't necessary in this case. Most of the power-related settings that it manages are irrelevant for my setup:

  • charging thresholds and power profiles for AC/battery - since it's not a laptop and doesn't have a battery.
  • no need to spin down disk drives - as there are no platter drives
  • no need to regulate fan speed - since there are no fans

etc, etc.

Other settings, like turning off the Bluetooth adapter or WiFi, can be managed without the need for such a tool (which has by the way tons of unneeded dependencies)

But of course, I bet there is room for further optimization (I actually didn't bother to turn off radios, etc.) However, my goal wasn't to push it to the limits.
I achieved this setup with minimal effort and tweaking.

The main point is: Hive is awesome.
It's efficient and effective even without extensive customization or optimization.

:-)

I get it!

The main point is: Hive is awesome.
It's efficient and effective even without extensive customization or optimization.

Indeed!

Hi @gtg I was wondering if you'd be open to restarting the testnet for development purposes? It was quite useful for testing dApps. Especially considering many of the calls from dhive and hive-js aren't typed

Currently there's ongoing heavy development before next v1.27.5 release, so I'm low on resources, as most of them are currently used for testing various aspect of new release. There's a mirror net running but at this moment I think there's no corresponding full haf node for that, but basic API (get_block, network_broadcast) should be available at:
http://seed.fake.openhive.network:8091
(that's mirror net so chain-id 42)

I don't plan to run old-style testnet (other than mirrornet) as it is something that people can easily run in their local development environments (very little resources needed)

Please let me know what do you need exactly and I'll try to help

It's good to see you don't need an 8 core monster with huge GPU to run these things. My PC is pretty old, but may be more powerful. It gets by on 8GB running Ubuntu.

A lot of scepticism about crypto seems to be about energy usage, but Hive counters that argument.

Loading...

oh this looks super good
oh que esto pinta super bueno. ❤️✌️

Thank you for running our chain on a sustainable way.

Of course.

r/theydidthemath
Source: reddit/r/theydidthemath

;-)

I was just messing around with running hived on mini pcs not too long ago. The sync times are brutal, but if you can load it, it makes a huge difference.

Yes, sync from scratch or even a replay is a pain, even loading snapshot isn't currently a viable solution because of the issue #623

funny thing, I got 64G of ram on my nodes, and I use only about 512MB to run nodes.

image.png

Pretty cool setup! I was wondering how you'd get 7w from the meeting recording. So the hexagonal case design is purely coincidental? The gods must have known :D

Throw it in a corner at home and help seed hive :)

You running this at home or in a dc? Dual ISP with ping time so low makes it sound like DC.

You running this at home or in a dc?

Yes. ;-)

I love this idea and the project. Even if is seems to be a little bit underpowered, it shows the little resources we need to run and support hive blockchain.

Thanks @gtg for doing this test and thanks for coming back to the comparison I started during the summer. This gives a extra portion of motivation to finish this report I‘m working on with the help of @arcange and some others.

What do you use to measure and graph power consumption?

I used Shelly Plug S to measure and Home Assistant to collect the data and graph it.

why did it take me this long to realize hive’s logo is hexagon shape lol I am sure we can shill hive to Hexicans and Pulsechain fans and garner a lot of conspiracy theories considering Richard Heart seemed to have been a big fan of Dan Larimer.

Congratulations @gtg! Your post has been a top performer on the Hive blockchain and you have been rewarded with this rare badge

Post with the highest payout of the day.

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 our last posts:

Our Hive Power Delegations to the November PUM Winners

!WOC

Great effort on Woc, @gtg! kairke(3/5) is grateful for the work and dedication you've put into this post. Your contributions are truly appreciated.

This post made @kairke's day! As a gift, you've received 0.2 WGOLD! Keep creating amazing content and never give up!

BTW! WGOLD is the token of the War of Clans ecosystem, you can use it to have discounts in all our games or stake it and earn rewards now!


Congratulations @gtg! Your post has been a top performer on the Hive blockchain and you have been rewarded with this rare badge

Post with the highest payout of the week.

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

Ho Ho Ho! @gtg, one of your Hive friends wishes you a Merry Christmas and asked us to give you a new badge!

The HiveBuzz team wish you a Merry Christmas!
May you have good health, abundance and everlasting joy in your life.

To find out who wanted you to receive this special gift, click here!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

It's the Christmas season: give your friends a gift