Peerbox, redesigned

[size=10pt]The redesign.[/size]

When project was first started Raspberry Pi looked different, it used obsolete Debian based OS which did not support a lot of features I have needed to properly implement secure and reliable OS for minting. So I was forced to use ArchLinux ARM (ALARM) as base for Peerbox, which was only alternative OS for Raspberry at the time. However ALARM is inherently non stable due to design philosophy behind it and very time consuming to maintain. After a while I ended up maintaining whole repository on my own, with hundreds of packages, it was endless cycle of compile-test-deploy. Numerous SD cards have been fried and one old Raspberry as well. That was going well actually, however my spare time became more scarce and far more valuable and thus project suffered.

Now, almost two years after I have started working on a little side-project that was about to become Peerbox the scene looks totally different. Raspberry Pi is no longer something known to only handful of tweakers and Linux enthusiast but global phenomena and has spawned a multitude of nice projects covering all aspects of life. Raspberry Pi foundation has grown so much, and has released a new version of Raspberry Pi and third one is expected to release tomorrow. Raspbian, the foundations fork of Debian is now a complete OS, maintained by dozens of professionals. Today, it makes no sense to dabble with ALARM.

[size=10pt]Enter Debian.[/size]

To make this project possible and usable in long term with my limited time it makes sens to move to Debian. Which is known for not changing too much over time and is quite suitable for fire and forget scenario. New Peerbox will be a Debian repository, which will contain pretty much everything the old Peerbox has contained but minus annoyance of special install procedures. Now, all users will do as they would normally do with their Rasperry Pi, that is install official OS from Rasberrypi.org and later just add a repository and install a package which setup Peerbox automatically. After that, user is left with functional Rasperry Pi for other uses and with functional Peerbox.
I hope this will enable far bigger number of people to use Peerbox as it is quite trivial to setup, even for non technical users.

So far my packages for Debian are not perfect, but are quite usable. I still have much to learn about Debian packaging process but this is just fine for now.
I have already implemented a lot of Peerbox security features like systemd services to make sure wallet software (and node) is always running as well as elementary namespace isolation via cgroups and systemd. This is quite secure already. Also, these are first Debian packages for Peercoin - ever.

Peercoin-qt running @ fresh Raspbian install.

[size=10pt][Roadmap][/size]

[done] Create .deb packages for Peercoin wallet software [done] Elementary security features for Peercoin packages [compile time hardening of binaries, elementary cgroups isolation via systemd] [done] Process monitoring for Peercoin wallet via systemd [done] Port of peerbox-info to new architecture [soon] Debian repository @ peerbox.me [soon] GPG signed packages @ peerbox.me [soon] Apparmour profile for wallet software [done] Tor integration via systemd (with proper isolation)

Awesome! Thanks for the hard work and dedication, peerchemist. :slight_smile:

Yay! Can’t wait to see it! I presume it will contain v0.5, right?

Fantastic news :slight_smile:

That is right, it uses v0.5.

testing now on one of my raspberries :slight_smile:

:pbjt: [size=24pt][font=andale mono][b]Yay! :pbjt:

Good going, Peerchemist![/b][/font][/size] ;D

Well done Peerchemist. Your experience with ALARM reminds me of why I stopped using ArchLinux. Maintaining my OS seemed to be taking as much time as simply using it. Upgrades invariably led to something breaking and then having to invest time on the forums trying to fix everything. Debian-based Linux may not be bleeding edge, but it’s reliable and that matters more to most of us.

So happy to hear about the move to debian. :stuck_out_tongue:

While porting peerbox-info to new architecture I have expanded it’s functionality. Now it is far more than simple monitoring script, it is a only tool anyone will need to run Peercoin in headless environment and will hopefully enable non-technical users to get their nodes running even faster.

[code]
peerbox -h
usage: peerbox.py [-h] [-info] [-public] [-stdout] [-health] [-rates] [-start]
[-stop] [-restart]

Show information on Peerbox.

optional arguments:
-h, --help show this help message and exit
-info equal to “ppcoind getinfo” with some extras
-public show info with omitted private data
-stdout dump data to stdout, use to pipe to some other program
-health compare local blockchain data with ppc.blockr.io as reference
-rates current average PPC exchange rates in USD and BTC
-start start Peerbox
-stop stop Peerbox
-restart restart Peerbox[/code]

This is what I have implemented so far, I will include some wallet like functions like “send” and “list all associated addresses” as well as wallet lock/unlock and backup solution.

Let’s walk through…

peerbox -info
Will show standard set of data, as expected.

{ "ppc_version": "v0.5.2-g2308455-Peerbox", "os": "debian 8.0", "hardware": "Raspberry Pi_2", "serial": "0000000024163519", "macc addr": "B8:27:EB:17:35:A4", "uptime": "5 days, 0:12:39.920000", "balance": 0.0, "stake": 0.0, "newmint": 0.0, "ip": "197.231.221.211", "connections": 8, "blocks": 226267, "moneysupply": 23043033.166307, "pos_difficulty": 11.49135184, "pow_difficulty": 474337891.4004621, "protocolversion": 60006, "walletversion": 60000 }

However, if you want to brag with your Peerbox on forum you might want to omit some private data:

peerbox -public

{ "ppc_version": "v0.5.2-g2308455-Peerbox", "os": "debian 8.0", "hardware": "Raspberry Pi_2", "uptime": "5 days, 0:17:03.890000", "connections": 8, "blocks": 226268, "moneysupply": 23043100.826307, "pos_difficulty": 11.49135184, "pow_difficulty": 475940408.66379553, "protocolversion": 60006, "walletversion": 60000 }

peerbox -health
Will try to check if your node is on wrong fork. This is done by comparing some block data with ppc.blockr.io.

peerbox [-start | -stop | -restart]

New features are -start, -stop and -restart. Which will obviously start, stop or restart your local node. No more remembering dreaded “sudo systemctl start ppcoind@pi.service”!.

peerbox -rates

{ "usd": "0.49298609", "btc": "0.00116748" }
Which will check current average Peercoin prices for you.

Thanks to this new feature, -info will automatically show you how much are your precious coins worth if you have more than 0 of them and if you are not on testnet.

peerbox -info
However my example is on testnet and on VM rather than Raspberry.

{ "ppc_version": "v0.5.2-g2308455-Peerbox", "os": "debian 8.3", "hardware": "Unknown", "uptime": "45 days, 20:42:32.320000", "balance": 26941.69, "value": { "USD": 13281, "BTC": 31 }, "stake": 19932.48, "newmint": 0.0, "ip": "62.163.212.157", "connections": 5, "blocks": 198690, "moneysupply": 219329161.190402, "pos_difficulty": 1.1051247, "pow_difficulty": 0.06294663, "testnet": true, "protocolversion": 60006, "walletversion": 60000 }

I have to run few more test and some more polishing and I will provide binaries for easy installation.

Works like a charm! It was an easy install, and the node has been running (headless) for almost two weeks now, with short interruptions for system updates and reboots.

Thanks [member=30983]peerchemist[/member] for your work. Without these new deb packages I would not have run Peerbox, as I had trouble installing packages for other applications I want my Pi to run.

Cheers!

I have almost completed what I had in mind for this development cycle. I will release final Peerbox-0.5 within next 48h.
Apparmour profiles will have to wait for the next cycle.

[done] Create .deb packages for Peercoin wallet software [done] Elementary security features for Peercoin packages [compile time hardening of binaries, elementary cgroups isolation via systemd] [done] Process monitoring for Peercoin wallet via systemd [done] Port of peerbox-info to new architecture [done] Debian repository @ peerbox.me [done] GPG signed packages @ peerbox.me [soon] Apparmour profile for wallet software [done] Tor integration via systemd (with proper isolation)

I am looking forward to hear your suggestions for next version.