Automated P2Pool Deployment
We are currently working on P2Pool Anywhere a project for automated deployment to (bare-metal) severs, VMs, and systemd containers.
This installation is working on an internal network and will be publicly released and fully documented soon.
Currently testing on Pi 5
Although we intend to extend this installation to other x86_64 and aarch64-based systems, our initial focus is on the Raspberry Pi 5 and Raspberry Pi Compute Module 5. One reason for this choice is the 256 Foundation's Libre Board (Open-source Bitcoin miner control board) is nearly identical to the Raspberry Pi Compute Module 5 IO Board.
Configuration Notes
The current configuration is optimized for software development and testing and runs the P2Poolv2 Stack in a guest NixOS VM on a NixOS host. This results in a few extra installation steps but allows for faster rebuilds and running multiple P2Poolv2 Stack instances on the same device. We use [extra-container] to separate the guest and host configurations.
Tested Hardware
We have been testing a Raspberry Pi Development Kit for Compute Module 5 which includes a CM5 with 4 GB RAM. Although CM5s can be hard to find, the Development Kit seems to be in-stock at many distributors.
Preview Instructions
Get the P2Poolv2 Deployment Flake and set your configuration
-
git clone <TBD> -
cd <dir> -
vi local.config
You’ll need to set your hostname, network information, SSH keys, etc.
Format the NVMe and install NixOS
-
Write the installer SD card image from nvmd/nixos-raspberrypi to a USB stick and boot the Pi 5 with it.
-
Format the NVMe and Install NixOS
-
nix develop -
nixos-anywhere --flake .#<hostname> root@<address>- NOTE
-
Using nixos-anywhere and Disko will wipe the NVMe drive, so should only be used for an initial installation.
Deploy the P2Poolv2 container
-
Build the container closure
-
nix build .#packages.default.aarch64-linux -
Note that the package path is reversed (it should be
aarch64-linux.default, TBD)
-
-
Copy the configuration + updated binaries to the Pi
-
nix copy --to ssh://nixos@<address> ./result
-
-
Build/rebuild the container
-
ssh -t nixos@<address> "$(readlink ./result)/bin/container" create --update-changed
- NOTE
-
These commands can easily be combined into a simple shell script.
-