🛠 The Parallel Wiki is Under Construction: This is a test site that will be launched on Logos.co in the coming weeks.

Parallel Wiki
Current version from 26 Nov 2026, 10:57 UTC by bristinWild · Created pageHistory

Running a Logos Node on a Raspberry Pi with automated recovery

A Raspberry Pi can run a Logos Blockchain testnet node around the clock, mine rewards, and bring itself back up after a crash or reboot. Mine has run for over a week without me touching it, earning about 23 million testnet units an hour.

This guide shows how my setup works, how to build the same thing, and how the automatic recovery is wired up.

What the node earns

  • Tickets. The node solves a small puzzle and wins tickets, then claims each one for about 1.7 million units. Almost all rewards come from here.
  • Stake. Every reward lands in your wallet as a note. After it ages through an epoch boundary (about 3.5 days as of now), it counts as stake in the block-producer lottery.
  • Leader vouchers. When your stake wins a slot and your node produces a block, you get a voucher worth about 15,000 units. With a small stake this is rare.

These are testnet tokens. Logos states they have no value and confer no rights to future benefits, so run a node to learn and to help test the network, not for profit.

What you need

A Raspberry Pi 5 with 8 GB of RAM is plenty. Mine runs the node, mining and the recovery services with about 5 GB of memory to spare.requirementsIf your node stays at only a handful of peers, forward UDP port 3000 on your router to the Pi.

Install the node

These steps follow the official Run a Logos node guide for testnet v0.3, adapted to a Pi and your own user account. Version numbers change with each release, so check that page for the current blockchain_module version and root hash.

  1. Install the tools and logosctl. The official install script supports Linux aarch64, which is what 64-bit Pi OS runs. Read the script first if you prefer before piping it to sudo:

sudo apt update && sudo apt install -y curl jq tar

curl -fsSL https://raw.githubusercontent.com/logos-co/logos-docs/main/resources/scripts/install-logosctl.sh | sudo sh

logosctl --version

  1. Start the daemon by hand for setup, and refresh the module catalogue:

cd ~

logosctl daemon start --detach

logosctl daemon status

logosctl catalog refresh

  1. Install and load the blockchain module. Installing doesn't load it, so both steps are needed:

logosctl package install blockchain_module \

--version 0.3.4 \

--root-hash 911a849083727457c25df4c29b2f2efd7c5b2906cd8f45eaa7f0cd89178aa08e \

--yes

logosctl module load blockchain_module

  1. Create your config. Put the bootstrap peers in peers.json. These are the ones listed in the official guide at the time of writing:

cat > ~/peers.json <<'EOF'

{

"initial_peers": [

`"/ip4/65.109.51.37/udp/3000/quic-v1/p2p/12D3KooWFrouXfmrR4nsLMtE7wu15DoMJ6VtoUtHinREZCvbWHar",`

`"/ip4/65.109.51.37/udp/3001/quic-v1/p2p/12D3KooWJRGau8M1rjT7R5e4YYsgdFhsMX35nRDtMwCDjxQkXAHz",`

`"/ip4/65.109.51.37/udp/3002/quic-v1/p2p/12D3KooWQXJavMDTRscjauFSgVAB1VLB6Rzpy2uY5SU9Tk7927tb",`

`"/ip4/65.109.51.37/udp/50001/quic-v1/p2p/12D3KooWSQc7CcGtvWDPF1yCbBthFnQjprfCVHmfmNDUrSmqQsU1"`

]

}

EOF

Then generate the config. It writes user_config.yaml and keystore.yaml to your home folder:

cd ~

logosctl call blockchain_module generate_user_config @peers.json

chmod 600 ~/user_config.yaml ~/keystore.yaml

"keystore.yaml" holds your node's secret keys. Never share it, and back it up somewhere safe.

  1. Start the node and wait for it to sync:

logosctl call blockchain_module start ~/user_config.yaml "" logosctl call blockchain_module get_cryptarchia_info | jq -r '.result.value // .value' | jq '{mode, height}'

The empty "" is intentional. Bootstrapping can take about an hour; wait until mode shows Online.

  1. Hand over to systemd. Once it works, stop the hand-started daemon with logosctl daemon stop. The services in the boot section below will run it from now on.

Don't call pow_status or other PoW commands until the node is Online. The official guide warns they hang while bootstrapping, and every later call then fails with RPC call failed until you restart the daemon.

Turn on PoW mining and auto-claim

Mining is off by default, and it does not switch itself back on after a restart. Auto-claim needs a target: the wallet key to pay rewards into, and a threshold.

The threshold is a stop point, not a payout trigger. Once the target's balance reaches it, the node turns mining and auto-claim off on its own. Mine stopped at 2 billion the first time, so set it high.

  1. Find your wallet key:

logosctl call blockchain_module wallet_get_known_addresses

  1. Set the auto-claim target and threshold. pow_configure writes to your config file:

K=<your public key> logosctl call blockchain_module pow_configure ~/user_config.yaml \ "{\"auto_claim_targets\":[{\"public_key\":\"$K\",\"threshold\":\"100000000000\"}]}"

  1. The running node only reads the config at startup, so restart it (see the next section). Once the node is Online, start mining and auto-claim:

logosctl call blockchain_module pow_start_mining logosctl call blockchain_module pow_start_auto_claim

  1. Check that both are on and the threshold took:

logosctl call blockchain_module pow_status \ | jq -r '.result.value // .value' \ | jq '{is_mining, armed: .auto_claim.is_armed, threshold: .auto_claim.targets[0].threshold}'

When its output goes to a pipe, logosctl wraps the answer in a result object. The .result.value // .value filter handles both shapes, so use it in every command.

Start everything on boot

Two systemd services bring the node up after every boot: one runs the Logos daemon, the other starts the blockchain module once the daemon is ready. A third small step turns mining back on. Replace piuser with your username throughout.

  1. The daemon service. It runs logosctl -D, which hosts the modules, and restarts it 10 seconds after any crash. Save as /etc/systemd/system/logos-daemon.service:

daemon service2. The start script. It loads the blockchain module, starts the node with your config, then waits up to 10 minutes for it to answer. If the node is already running, it exits straight away. Save as /usr/local/bin/start-logos-blockchain.sh and run sudo chmod +x on it:

#!/bin/bash

set -euo pipefail

CTL=/usr/local/bin/logosctl

CONFIG=/home/piuser/user_config.yaml

echo "Waiting for blockchain module..."

for i in $(seq 1 10); do

`if "$CTL" module show blockchain_module 2>/dev/null | grep -qE '^Status:[[:space:]]+loaded'; then`

    `break`

`fi`

`"$CTL" module load blockchain_module >/dev/null 2>&1 || true`

`sleep 3`

done

echo "Checking blockchain status..."

if "$CTL" call blockchain_module get_cryptarchia_info 2>/dev/null | grep -qE '"success"[[:space:]]*:[[:space:]]*true'; then

`echo "Blockchain already running."`

`exit 0`

fi

echo "Starting blockchain..."

"$CTL" call blockchain_module start "$CONFIG" "" || true

for i in $(seq 1 120); do

`if "$CTL" call blockchain_module get_cryptarchia_info 2>/dev/null | grep -qE '"success"[[:space:]]*:[[:space:]]*true'; then`

    `echo "Blockchain started successfully."`

    `exit 0`

`fi`

`sleep 5`

done

echo "ERROR: Blockchain startup timed out."

exit 1

  1. The blockchain service. It runs the script once the daemon is up, and stays marked active afterwards. Save as /etc/systemd/system/logos-blockchain.service:

    Blockchain service setup

  2. Mining autostart. Mining stays off after every restart, and the official guide says to start it only once the node is Online. A small script waits for that, then turns mining and auto-claim on. Save as /usr/local/bin/logos-pow-autostart.sh and run sudo chmod +x on it:

#!/bin/bash

CTL=/usr/local/bin/logosctl

# Check every 20 seconds, for up to 2 hours

for i in $(seq 1 360); do

`MODE=$("$CTL" call blockchain_module get_cryptarchia_info 2>/dev/null \`

    `| jq -r '.result.value // .value' 2>/dev/null | jq -r '.mode' 2>/dev/null || true)`

`if [ "$MODE" = "Online" ]; then`

    `"$CTL" call blockchain_module pow_start_mining`

    `"$CTL" call blockchain_module pow_start_auto_claim`

    `echo "Node Online: mining and auto-claim started"`

    `exit 0`

`fi`

`sleep 20`

done

echo "Node not Online after 2 hours: mining not started"

exit 1

Give it its own service, saved as /etc/systemd/system/logos-pow-autostart.service:

own-seviceThen have the blockchain service start it every time the node comes up. --no-block means the blockchain service doesn't sit waiting the hour a sync can take, and the + runs the command as root, which starting another service needs:

sudo mkdir -p /etc/systemd/system/logos-blockchain.service.d

sudo tee /etc/systemd/system/logos-blockchain.service.d/pow-autostart.conf >/dev/null <<'EOF'

[Service]

ExecStartPost=+/usr/bin/systemctl start --no-block logos-pow-autostart.service

EOF

  1. Turn it all on:

sudo systemctl daemon-reload

sudo systemctl enable --now logos-daemon.service logos-blockchain.service

The first start can take several minutes while the node syncs. Follow it with journalctl -u logos-blockchain.service -f until you see "Blockchain started successfully."

Automatic crash recovery

Three pieces bring the node back after a crash with nobody at the keyboard: systemd restarts the daemon, a recovery hook restarts the node on top of it, and the mining autostart from the last section turns mining back on.

recovery architecture setupThe hook is the part people miss. The node runs inside the daemon, so when the daemon restarts, the node is gone. The blockchain service already ran once and finished, so systemd won't run it again by itself. The hook tells it to.

  1. Tie the node service to the daemon. With PartOf, stopping or restarting the daemon also stops or restarts the node service:

sudo tee /etc/systemd/system/logos-blockchain.service.d/recovery.conf >/dev/null <<'EOF'

[Unit]

PartOf=logos-daemon.service

EOF

  1. Let the hook do the restarting. Remove the start timeout, since the script has its own 10-minute limit, and turn off the service's own retries so they don't fight the hook:

sudo tee /etc/systemd/system/logos-blockchain.service.d/override.conf >/dev/null <<'EOF'

[Service]

TimeoutStartSec=0

Restart=no

EOF

  1. The recovery hook. Save as /usr/local/bin/logos-recovery-hook.sh and run sudo chmod +x on it:

#!/bin/bash

set -euo pipefail

/usr/bin/systemd-run \

--unit="logos-blockchain-recovery-$(date +%s%N)" \

--on-active=15s \

--collect \

/usr/bin/systemctl restart --no-block logos-blockchain.service

It doesn't restart the node directly. The hook runs while the daemon is still starting, and the node service waits for the daemon to finish starting, so a direct restart would deadlock. Instead, systemd-run queues the restart as its own short-lived job 15 seconds later.

  1. Run the hook every time the daemon starts. The + runs it as root, which it needs to restart another service:

sudo mkdir -p /etc/systemd/system/logos-daemon.service.d

sudo tee /etc/systemd/system/logos-daemon.service.d/recovery.conf >/dev/null <<'EOF'

[Service]

ExecStartPost=+/usr/local/bin/logos-recovery-hook.sh

EOF

  1. A healthcheck every 5 minutes. This logs whether the node is healthy. A busy Pi sometimes answers RPC calls slowly, so recent incoming blocks also count as healthy. Save as /usr/local/bin/logos-healthcheck.sh and run sudo chmod +x on it:

#!/bin/bash

set -euo pipefail

CTL=/usr/local/bin/logosctl

if ! systemctl is-active --quiet logos-daemon.service; then

`echo "UNHEALTHY: Logos daemon is inactive"`

`exit 1`

fi

if timeout 25 "$CTL" call blockchain_module get_cryptarchia_info 2>/dev/null \

`| grep -Eq '"success"[[:space:]]*:[[:space:]]*true'; then`

`echo "HEALTHY: Blockchain RPC responding"`

`exit 0`

fi

BLOCKS=$(journalctl -u logos-daemon.service \

`--since "5 minutes ago" --no-pager \`

`| grep -c 'Received new block' || true)`

if [ "$BLOCKS" -gt 0 ]; then

`echo "WARNING: RPC timeout, but $BLOCKS blocks received recently"`

`exit 0`

fi

echo "UNHEALTHY: RPC unavailable and no recent block activity"

exit 1

Then its service and timer:setting service and timerAs set up here, the healthcheck only reports; it doesn't restart anything. You could add an OnFailure= action that restarts the daemon, but the first sync after a restart can fail the check too, so test that carefully before relying on it.

  1. Turn it on and test it:

sudo systemctl daemon-reload

sudo systemctl enable --now logos-healthcheck.timer

# Simulate a crash, then watch the node come back

sudo systemctl kill -s SIGKILL logos-daemon.service

journalctl -u logos-blockchain.service -f

Within a few minutes you should see "Blockchain started successfully." Once the node is back Online, pow_status should show is_mining: true again. Check the healthcheck's latest verdicts with journalctl -u logos-healthcheck.service -n 5.

On my Pi, a simulated crash was back to mining in about 3.5 minutes with no manual steps: the daemon restarted after about 20 seconds, the node answered about 3 minutes later, and mining started 1 second after that.

Check rewards, stake and blocks

One script shows everything worth watching. Save it as ~/node-status.sh, put your key in K, and run chmod +x ~/node-status.sh.

#!/bin/bash

K=<your public key>

v() { jq -r '.result.value // .value'; }

echo "== Uptime =="; uptime -p

echo "== Mining =="

logosctl call blockchain_module pow_status | v | jq '{is_mining, armed: .auto_claim.is_armed, threshold: .auto_claim.targets[0].threshold}'

echo "== Rewards =="

logosctl call blockchain_module wallet_get_notes $K '' | v | jq '{notes: (.notes|length), total_reward: ([.notes[].value|tonumber]|add)}'

echo "== Stake in lottery =="

logosctl call blockchain_module wallet_get_leader_aged_notes '' | v | jq '{aged_notes: (.notes|length), stake: ([.notes[].value|tonumber]|add)}'

echo "== Epoch =="

logosctl call blockchain_module get_time_info | v | jq '{current_epoch, current_slot}'

echo "== Blocks won (vouchers) =="

logosctl call blockchain_module wallet_get_claimable_vouchers | v | jq '{vouchers: (.vouchers|length), total_claimable}'

result readsStake moves in steps, not continuously. Each epoch counts the notes your key held when the previous epoch began. On my node, stake stayed flat for days, then jumped from 0.7 billion to 2.2 billion at one boundary.

Troubleshooting and lessons learned

Most scary-looking errors in the log are normal. These are the ones I hit, and what they meant.troubleshoots and findingsOn a Pi, roughly 1 in 4 mined tickets ends up as a reward. Changing max_tickets_per_block made no difference on my node, so you can leave it unset.