Hive Tools/Libs on a Raspberry Pi 4

in HiveDevs5 months ago

raspberrypi4_hive.png
Raspberry Pi 4B, image source: https://www.raspberrypi.org/, modified with the Hive logo

I recently bought a Raspberry Pi 4 and finally found the time to set it up:

  • Raspbian
  • Python development environment via virtualenv using
  • remote access from anywhere with an SSH server as a Tor Hidden Service

I added heatsinks to the ICs because they came with the case, not necessarily because they were necessary. In fact I haven't tested it without, so I can't really tell. A fan was included as well, but I didn't install it and it isnt' necessary so far. The CPU reports around 50 degC. Compared to the RPi3 I had before, I'm really excited by the performance! Here's a comparison of the (wall) time it takes to sign the same Hive transaction 200 times on a RPi3 and the RPi4:

pi3.png
pi4.png

DeviceMean Time (s)Median Time (s)
Raspberry Pi 30.33980.3811
Raspberry Pi 40.18390.1969

Now that's a basically a factor 2 difference! The test script is identical, both were idle and both use secp256k1 for signing. I'm not really sure why there are multiple peaks around the same time differences apart from each other. Does the signing algorithm randomly use multiples rounds? Worth to look into - at a later time :)

Main point here:

RPi4 is typically around a factor two faster and than its predecessor makes a decent platform for Hive-related tools and scripts!

For the moment, it runs the following things for me:

  • @curx on Hive and Steem
  • Account creation token claiming script on Hive and Steem
  • An autovoter for my main account on Hive
  • Some tribe-related helpers and scripts

Both beem and lighthive work like a charm!

Anyone else using Pi's for Steem/Hive? What do you do with them?

Sort:  

I think those peaks have something to do with the canonical signatures that Steem/Hive uses. https://github.com/steemit/steem/issues/1944

Thanks for the pointer, you might be right! At least in beem, the sign_message contains

while True
  [...magic secp256k1 stuff...]
  if is_canonical(signature):
    [...]
    break

Depending on the output of the first iteration, this might indeed repeat a few times more.

I have a pi 3 running local html files with steem-js scripts. They do similar things to what you listed. Works perfectly, all day every day. I have thought of getting the Pi 4 but no need for it yet. But I know it is faster and better in some ways, so enjoy it!

nice! I'm not as 'fluent' with JS as with python, but glad to hear that this works equally well on the Pi. Thanks for your comment! :)

remote access from anywhere with an SSH server as a Tor Hidden Service

What tools do You use for above?

tor obviously, basic hidden service config via

HiddenServiceDir /var/lib/tor/ssh
HiddenServicePort 22 127.0.0.1:22

and on client side torify ssh username@superlengthygeneratedaddress123.onion

test

I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!

thanks @chitty!

I'm looking forward to getting into Raspberry Pi when I have time from fighting theft of the Steem blockchain :-)

haha, yes, I can imagine the legal aspects take a good fraction of your time!

I've missed that post!

I also own a RPI4 and it works very well. Using it for home automation and adblocking. (See pi-hole and Adguard)

I also ordered a Zero W to with a e-ink display. Trying to use it as a smart desk watch. Let's see ;)

Saw you home automation post - that's something I haven't started with and for now. Pi Zero with e-ink sounds interesting! Will you go for a full-fledged Linux solution or some bare-betal coding?

Bought this phat

They have a Python library already - so it looks pretty simple. I just need to connect the dots. :)