How to run ord on a Raspberry Pi 5
This is a guide on how to build a compatible version of ord for the Raspberry Pi 5
The Raspberry Pi uses an ARM64 processor, but the official ord client does not release builds for this architecture. So, this guide will show you how to build it yourself.
- Note: I built this on Ubuntu, using WSL2 on Windows 11. I suppose a clean Linux Distro will work fine as well.
- Note: If you just want to get ord that runs on ARM64, you can download my pre-built it here. ord-0.16-arm64.zip
Step 1: openssl-sys
Building the ARM64 version of ord will require the openssl-sys crate to be built for ARM64 as well, so we start with that. There is a good guide on how to do it here
- Note 1: Before building you have to run the following in the terminal export CFLAGS="-fPIC" (so run it before the ./Configure part). This flag tells the compiler to generate position-independent code, which is necessary for shared libraries (which the openssl is).
Step 2: Downloading ord and install dependencies
Ok, lets get started with the cool stuff. First download the ord source code and install all dependencies that you need (like Rust and so on). This is well documented on the ord github, go down to the section saying Building
Step 3: Add target ARM64 and install cross compiler
- ARM64 target: rustup target add aarch64-unknown-linux-gnu
- Cross compiler: sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
Step 4: Configure Cargo for Cross-Compilation
From root of the source code of ord, create file: .cargo/config.toml
Then add the following to the file:
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
Step 5: Set the location of the openssl build
We need to inform Cargo of the location of the OpenSSL build we completed in step 1. This is achieved by setting some environment variables, which can be done by executing the following command:
export OPENSSL_DIR=/opt/openssl-1.1.1e
export OPENSSL_LIB_DIR=/opt/openssl-1.1.1e/lib
export OPENSSL_INCLUDE_DIR=/opt/openssl-1.1.1e/include
export PKG_CONFIG_ALLOW_CROSS=1
- Note: The paths are the ones you used when building openssl in step 1. If you followed the guide, the paths should be the same. If you used different paths, adjust the commands accordingly.
Step 6: Build ord for ARM64
cargo build --target aarch64-unknown-linux-gnu --release
Step 7: That´s it
If everything went alright, the ord file should be in ./target/release/ord
Info: Components
In my build, I have used the Raspberry Pi 5 with 8GB RAM and an M.2 disk. I do not know if Bitcoin Core and the ord client will run okay on lower versions like the Pi 4.
- Raspberry Pi 5 8GB
- Active cooler
- Pimoroni M.2 NVMe Base Shield
- 2TB M.2 SSD NVMe – Kioxia EXCERIA
Assembly and installing Raspberry Pi OS
Pimoroni provides excellent documentation for the assembly and installation of the OS on the M.2 disk. The guide is here. I used the 64 bit Lite version
- Note 1: At the end there is a step to enable PCIe 3, this made my Pi crash frequently so consider skipping this part.
- Note 2: I needed to resize the partition to use the full disk. The Raspberry Pi recognized the 2TB, but only part of it was used for the root filesystem.