Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Resilience (Multi-Node)

A solo pool is only as available as the Bitcoin Core node behind it. A single bitcoind is a single point of failure: if it crashes, falls behind, or is restarted for an upgrade, the pool can’t build templates — and worst of all, a node that’s down at the exact second you solve a block can cost you the reward. dvb-WarpPool lets you run one or more backup nodes so a primary outage becomes a non-event.

Add a backup node

Backup nodes live in config.toml. The [node] block is your primary; add any number of [[node.backup]] entries below it:

[node]
rpc_url = "http://127.0.0.1:8332"
zmq_hashblock_addr = "tcp://127.0.0.1:28332"

[[node.backup]]
rpc_url = "http://192.168.1.50:8332"
zmq_hashblock_addr = "tcp://192.168.1.50:28332"   # "" = no ZMQ from this node (poll-only)
# rpc_cookie_path = "/mnt/node-b/.bitcoin/.cookie" # optional — see auth below

Authentication is resolved per backup, in this order:

  1. rpc_cookie_path — a local second node with its own data dir.
  2. user:pass embedded in the URL (http://user:pass@host:8332) — a remote node with its own credentials (this lives in config.toml, so mind the file permissions).
  3. Nothing — the global secrets.rpc_user / rpc_pass are reused (handy when the backup is provisioned identically to the primary).

The [node] block is read at startup only — restart the daemon after adding or changing a backup. This briefly interrupts mining; miners reconnect on their own. With [server] reuse_port = true a second daemon can take the ports over first, so there is no listener gap — see Packaging → Zero-downtime restart.

The full field reference is in the Configuration Reference.

How failover behaves

  • Sticky, primary-preferred. Calls run against the last working node. On a transport, auth, or warm-up error they hop to the next node within the same call — the job loop never stalls. While running on a backup, about once a minute one call probes the primary first and switches back the moment it answers.
  • submitblock goes to every node in parallel. The block moment is the one instant a dead node can cost real money, so the solved block is broadcast to all nodes at once; the first Accepted wins.
  • ZMQ subscribes to every node that sets zmq_hashblock_addr. Block events are deduplicated by hash, so whichever node reports first triggers the template refresh — you automatically get the lowest-latency node. (GBT mode only: with the IPC template source, tips come from the single IPC node; RPC failover and the parallel submitblock still apply.)
  • Degraded ≠ down. A pool happily running on a backup is degraded, not down: the health snapshot carries a warning, and rpc-down fires only when no node is reachable at all.

Verified live: primary kill → failover in under a second with the job stream uninterrupted; primary restart → automatic return within ~60 s.

Found block spool (v1.45)

The block moment has a second safety net since v1.45: every found block is written to disk, fsynced, beside the submit — header, coinbase and every transaction as one JSON file under <data_dir>/block-spool/ (/data/block-spool/ on Umbrel, /var/lib/dvb-warppool/block-spool/ on the packages). The file name is <height>-<first 16 hex of the hash>.json; besides block_hex it carries the height, hash, worker, job id, header fields, the blocks_found row id and the attempt counters. The write never delays the submit: the IPC submitSolution is already running when the hex is built, and the GBT path takes the hex from the same cache.

Resubmit until resolved. When the find-time submit gives no final verdict — Core unreachable (rpc-error), restarting, behind (prev-blk-not-found), or answering inconclusive/duplicate without a header verdict — the daemon’s spool loop takes over: it sends submitblock to every configured node with backoff (1 s, 2 s, 3 s, 5 s, 10 s, 20 s, then every 30 s) until

  • a node accepts the block, or the primary reports it in the active chain (getblockheader with confirmations >= 1) → accepted;
  • a node rejects it for real (bad-*, high-hash, duplicate-invalid, time-too-*, …) → rejected:;
  • the chain has moved on: Core holds the block on a side branch and the tip is past its height, or (whatever Core said) the tip is 3 blocks past its height → stale.

The blocks_found row stays pending meanwhile and gets the verdict when the loop decides; the dashboard and /api/blocks show the same. On a daemon start the spool is replayed (a block found seconds before a crash or an update is resubmitted first thing), and on a graceful shutdown every pending block gets one last attempt. Resolved files are never deleted: they move to block-spool/resolved/ with the verdict in the name (….accepted.json, ….rejected-bad-txnmrklroot.json, ….stale.json) so a rejected block can still be analysed.

Where to see it. /api/overview → network.block_spool_pending, block_spool_oldest_at, block_spool_entries (file, height, hash, attempts, last answer); the metric warppool_block_spool_pending; the suppressible health warning block_spool_pending (count, oldest height, attempts, last answer) on the dashboard banner; the dashboard’s network card while a block is pending; the notification block-resolved (sinks that enabled on_block_found) when a pending block is finally accepted or not. GET /api/admin/block-spool lists the pending files.

Recovery by hand. The loop needs nothing from you; these are for a node the pool does not know, or a post-mortem:

# one immediate attempt through the running daemon (admin token)
dvb-warppool-cli block-spool
dvb-warppool-cli block-resubmit 000840000-abababababababab.json

# the same without the daemon, against any Bitcoin Core
bitcoin-cli submitblock "$(jq -r .block_hex /var/lib/dvb-warppool/block-spool/000840000-abababababababab.json)"

submitblock answers null (accepted), duplicate (the node has it) or the reject word. A file copied into block-spool/ by hand is picked up by block-resubmit <name> as well. The format is "format": 1; a file with another format or an unreadable one is skipped and reported, never deleted.

Miners go to their fallback pool while the node is unhealthy (v1.45)

A miner that keeps hashing the last job through a Core restart, a crash into initial block download or a dead RPC wastes its work: shares on that job are worthless once the network moves on, and a block found on it could be stale or lost. Every solo firmware has a fallback pool and switches to it when the primary refuses connections — so since v1.45 the pool refuses: when the node has been unhealthy for longer than the grace, every connected miner (V1, V1-TLS, Sv2) is told (client.show_message on V1, the drop on Sv2) and disconnected, and new connections are closed right after accept() until the node is healthy again. The refusals bypass the connect rate limiter, so a miner retrying every few seconds is never banned for it.

Unhealthy means one thing: the template source (GBT or IPC) has delivered no template for max(node_unhealthy_grace_secs, 3 × job_refresh_secs) (default grace 600 s), counted from the daemon start when nothing has come yet, on a monotonic clock (an NTP step never ages a template). That covers RPC down, Core restarting or in initial block download, a dead IPC socket, a hung long poll — in both template modes. The reason is reported as ibd instead of no-template when the node also says initialblockdownload = true; IBD on its own never closes the gate (regtest, signet and testnet report IBD after a day-old tip while templates keep coming, and closing would stop the very block that ends it), and neither does an RPC outage on its own (in IPC mode mining works without RPC).

Ten minutes is deliberately above a Bitcoin Core update on a Pi or Umbrel (block index, chainstate, mempool.dat, dbcache 3000: often more than three minutes), so an ordinary update never kicks anyone. The cost of waiting is small: until the network finds a block the old job stays valid, and a block found meanwhile is kept by the block spool. A quiet mainnet source still rebuilds every job_refresh_secs, so three missed rebuilds mean “dead”, not “idle”. Miners without a fallback pool sit idle while the gate is closed — give every miner a fallback.

Recovery is automatic. The moment a template arrives, the gate opens; the miners come back on their own — verified in the firmware sources (2026-10-27):

firmwareleaves for the fallbackreturns to the primary
AxeOS (ESP-Miner 0c798de)after 3 failed connects 2 s apart (6–21 s); a dropped session with work received reconnects at oncea heartbeat task probes the primary every 60 s (TCP + mining.subscribe + mining.authorize, must answer within 5 s without an error) and switches back on success
NerdOS (NerdQAxe+ bfd0739)the secondary starts 10–40 s after the primary dropsthe primary task retries every ~10 s regardless; the first job line from the primary ends the secondary
WarpAxe (bcb88f0)3 short sessions in a row, backoff 3–60 sa TCP probe of the primary every 5 min
cgminer / BOSminerfailover strategy, retry every 5 sswitch-back delay 60 s (from memory, not verified)

client.show_message is only logged by AxeOS and WarpAxe and dropped by NerdOS; client.reconnect is ignored or treated as a plain reconnect by all three — the drop and the refusal are the signal that works everywhere. Nothing stays stuck: no firmware sticks to the fallback once the primary accepts again (AxeOS only if use_fallback_stratum was set by hand). The one thing to keep in mind: the pool must answer mining.subscribe / mining.authorize within 5 s once it accepts again, or AxeOS keeps probing.

Where to see it. The dashboard’s network card while the gate is closed; the suppressible health warning node_unhealthy_miners_disconnected (reason, seconds); /api/overview → network.miner_gate_closed, miner_gate_closed_since, miner_gate_reason, miner_gate_enabled, miner_gate_refused_total; the metrics warppool_miner_gate_closed and warppool_miner_gate_refused_total; the SSE event miner_gate; the notification miner-gate (sinks with on_rpc_down or on_miner_disconnect) on close and on open; and the daemon log (node unhealthy beyond the grace — disconnecting all miners, one line per 100 refused connections). The “miner mines elsewhere” notification tells you per device when it left and when it is back.

[server]
node_unhealthy_disconnect = true   # default; false = miners stay on stale jobs as before v1.45
node_unhealthy_grace_secs = 600    # >= 30

Notifications

  • node-failover — the active node changed (failover to a backup, or return to the primary).
  • rpc-down — no node reachable at all.
  • rpc-recovered — RPC is answering again after an rpc-down.
  • block-resolved — a block from the spool got its final verdict (accepted after a resubmit, rejected, or stale). Goes to sinks that enabled on_block_found.
  • miner-gate — the pool closed its doors because the node stayed unhealthy beyond the grace (reason, seconds), or opened them again. Goes to sinks that enabled on_rpc_down.

The first three go to sinks that enabled on_rpc_down.

See Notifications for sink setup.

Tips

  • Put the backup on separate hardware and power — a backup on the same machine only covers bitcoind crashes, not host failures.
  • A node without ZMQ still works as an RPC failover target (poll-only); set zmq_hashblock_addr = "" to skip ZMQ from a node that doesn’t expose it.
  • Order matters only as preference: the primary is always tried first on the periodic probe; backups are tried in the order they appear.

See also