Minting on Raspberry Pi - tutorial online

The tutorial for start minting with a Raspberry is online @ https://docs.nubits.com/nu-raspberry-minting/ .

Holding NuShares comes with a responsibility : it is in your best interest to participate to the network by submitting your votes in each block you mint.

To maximise the impact of your votes and the reward that comes with staking shares, your Nu client should be minting 24/7. A cost-efficient solution is delegating the minting to a cheap Raspberry Pi connected to the internet : unlike VPS or cloud service you will keep control over your shares, and you can finally turn off your home computer. Thanks to Nu data-feeds, you can subscribe your raspberry to an external source and control your votes without need to access the pi all the time.

The Raspberry Pi is a cheap (~40$) and efficient device with enough computational power to let you mint.

Soon I will also upload nud binaries and update the guide so people will be able to skip the compilation part of the tutorial ;).

Feedback appreciated

3 Likes

:thumbsup:

:smile:

1 Like

Unofficial builds uploaded and documentation updated : https://github.com/NuNetwork/documentation/commit/0666860d869d7ca9f50ffe7f4097d3e8c6360fdb#diff-7ede7e872e2c9e93eca653d0ac31bd2cR89 .

I’ll maintain these binaries up to date, feel free to fork and PR

Download nud from : https://github.com/desrever-nu/nu-raspberry-unofficial/raw/master/latest/nud

1 Like

That will make it a lot easier for people not familiar with compiling stuff - some might even be challenged with working on a linux shell if they haven’t done that before! Thanks to the guide this should be challenge that can be accepted.

Providing them with binaries is greatly appreciated. Does the disclaimer contain a warning regarding the use of “non official” software"?
Not that I’d distrust you, on the contrary. But other people might appreciate such a thought-provoking impulse.

What ARM version is it compiled for?
ARMv6 binaries (RaPi1) can run on ARMv7 (RaPi2), but not the other way round, right?

Oh yes there are some warning on the README of https://github.com/desrever-nu/nu-raspberry-unofficial

This builds are unofficial, privately maintained, and unlike clients distributed via nubits.com did not undergo a proper testing process. Use it at your own risk

By using this build you declare to have accepted the terms of use.

Nud is provided “as is” and “with all faults.” The Nu Development Team makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of NuBot. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this NuBot is compatible with your equipment and other software installed on your equipment.You are also solely responsible for the protection of your equipment and backup of your data, and the Nu Development Team will not be liable for any damages you may suffer in connection with using, modifying, or distributing nud.

I hope :arrow_up: is enough

What ARM version is it compiled for?

I compiled with a rpi2

I think so.
As professional as always! I’m not in the slightest surprised :wink:

Let me try to find my old rpi1 and test it.

very nice. what are the benefits of minting on a PI rather than on a normal client (PC or MAC or a linux machine)?

The nud provided by you runs fine!
It took longer than expected, but finally it’s up:

nud getinfo
{
    "version" : "v1.2.0-4-ga544017-beta",
    "protocolversion" : 50000,
    "walletversion" : 1,
    "walletunit" : "S",
    "balance" : 0.0,
    "newmint" : 0.0,
    "stake" : 0.0,
    "parked" : 0.0,
    "blocks" : 462080,
    "moneysupply" : 1006767096.028,
    "connections" : 1,
    "proxy" : "",
    "ip" : "censored",
    "difficulty" : 0.00030932,
    "testnet" : false,
    "keypoololdest" : 1410815209,
    "keypoolsize" : 101,
    "paytxfee" : 1.0,
    "unlocked_until" : 0,
    "errors" : ""
}

…it needs some more time to catch up with the blockchain. The USB WAN NIC is crappy. The rpi is rarely over 3 connections…

Ok, strike through and [code] tags don’t work together. And the preview when editing text with strike through tags isn’t working either.
But that is a different topic.

[quote="desrever, post:5, topic:2465"] I compiled with a rpi2 [/quote] It doesn't run on a rpi1. I started it as daemon
nud --daemon
and no error message was shown. nud stays unresponsive to RPC commands. [code] nud getinfo error: couldn't connect to server [/code] The reason is: [code]

ps ax | grep nud
(PID TTY STAT TIME COMMAND)
4834 ? Ds 2:12 nud --daemon
4862 pts/0 S+ 0:00 grep --color=auto nud
[/code]

A status “D” by man page of ps means “D uninterruptible sleep (usually IO)”.

I think it’s necessary to tell people that this only works with ARVv7 devices (e.g. rpi2). It will be hard for beginners to understand why it doesn’t work.

cat /proc/cpuinfo | grep model

can help to determine the model if people are not sure.

My rpi1 shows

cat /proc/cpuinfo | grep model
model name      : ARMv6-compatible processor rev 7 (v6l)
My rpi2 shows [code] cat /proc/cpuinfo | grep model model name : ARMv7 Processor rev 5 (v7l) model name : ARMv7 Processor rev 5 (v7l) model name : ARMv7 Processor rev 5 (v7l) model name : ARMv7 Processor rev 5 (v7l) [/code]

[tl;dr]
Minting on a RaspberryPi is required to increase/keep the level of decentralization!
[/tl;dr]

A RaspberryPi consumes only little energy (typically below 2 Watts), doesn’t heat up your flat and makes no noise. It can be run unattended for months (installation of updates from time to time recommended…).
While the latter arguments are in favour of your comfort (heat, noise), the energy consumption is of economical importance.

There’s a break-even point at which NSR holders have to pay as much money for the electricity to operate a minting device as they earn from minting rewards.
This depends on the price per kWh, the energy consumption of the minting device and the amount of NSR.

Holding a number of NSR at or below that break-even point inhibits minting (bad for the security) and participation (bad for community and development).

While one might be able to change the amount of NSR, the change of price per kWh is limited.
Changing the energy consumption of the minter is an option, though.

A RaspberryPi might change the energy consumption dramatically, because it typically runs at (or below) 2 Watts.
Compare this to a Laptop or a PC.

Arithmetic example:
at 2 Watts a RaspberryPi consumes 17.5 kWh per year. That is a few USD per year even if the electricity is quite expensive (say 0.30 USD/kWh), it’s not much more than 5 USD.
At the current NSR price level you need to mint approximately 60 blocks (at average 5 per month) to cover the electricity costs.

I don’t know how many NSR you need to hold to mint at average 5 blocks per month, but I’m sure it’s way less than you require to cover electricity costs of a PC :smile:

And if you live in an area where electricity is cheaper, you need even less blocks to cover the costs.
In the US prices below 0.10 USD/kWh are no exceptional case.
10 cents per kWh reduces the break-even point (at current NSR price level) to 20 minted blocks per year, or approximately 1.5 per month.
This calculation doesn’t include tha hardare invest of 40 USD for a RaspberryPi.

2 Likes

Tks for sharing your analysis of the energy cost.
I would be more interested in the security advantages that a Pi could bring.
Having a machine dedicated to minting, with which you communicate via command lines makes the user less prone to install dangerous software, I feel.

A RPI brings advantages in several ways if you use it as dedicated minting machine.

  • it runs Linux which is by design quite secure
  • it’s not likely to get tempted to install programs from strange sources (why would you want them on the RPI; it’s only your minter)
  • using it as dedicated minter saves from dangers surfing in websites which distribute malware
  • having only the bare minimum of services (sshd, what else?) running reduces the attack vectors

But the security is only obe important aspect.
If you don’t want to afford doing a part of the job you are responsible for (minting, voting), because your minter consumes so much electricity, produces heat and noise, a RPI is a possible solution.
It’s cheap, secure, silent, reliable and convenient (once the setup is complete).

Having active community members is important for DACs whether they hold shares or don’t. I think of contributions from so many people while I write this.
Thank you for that!
But being an active minter if you hold shares is important as well (at least for Peershares DACs).
A RPI makes the latter quite easy.

1 Like

cant wait for http://nextthing.co/ to become available for 9 bucks

In the guide, why is it necessary to make a swap space for compilation? The default Raspbian image has (on-demand) swap enabled, managed by dphys-swapfile. @desrever

I have had to create a swap file manually when I was creating binaries for the community. I was using the latest raspbian Maybe the default is not enough?

Could be. Only recently I discover that my R-pi B+ has to use swap space when it mints.

Ouch! I bet that’s what killed more than just one SD card: excessive use of swap on the SD card.
I once was playing with several applications in parallel on my RPI1. I had to replace the SD card more than once…
Since I have replaced my RPI1 with an RPI2 (with 1 GB RAM) and don’t have to use swap, the SD card is still fine (for longer than the SD cards lasted in the RPI1).
Swap on SD cards that is used heavily is bad for the life of SD cards; they seem to have limited wear leveling capabilities.
…and it slows down the system to a degree that might produce some more orphan blocks (when minting) than without swap in use.