Source bitcoin-node from the bitcoind-gunix flake instead of hand-pinned downloads #4
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vnprc/hashpool#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story: As the operator maintaining the hashpool template-provider stack, I want the Bitcoin Core node binary to come from a single verified flake input instead of a hand-pinned tarball download duplicated across three files — so that bumping the node version is one
nix flake updatewith build-time byte-parity verification, not a manual sha256 recompute in three places that can silently ship a stale or mismatched binary.Context
The template provider runs multiprocess Bitcoin Core (
bitcoin -m node) withsv2-tpconnected over a unix IPC socket. The node binary is packaged by hand and pinned in three independent places, each carrying its own version string:bitcoin-node.nixversion+ per-platform sha256fetchurlthe bitcoincore.org tarball +autoPatchelfHookscripts/build.shBITCOIN_VERSIONcurlthe tarball on the VPS, cache in/tmpscripts/ship.shBITCOIN_VERSIONcurlthe tarball locally, cache in/tmpThe
.nixfile feeds dev (devenv+.#bitcoin-node); the two scripts feed production (testnet4). They are not derived from each other — a version bump must be applied to all three by hand, and the deploy scripts reuse a cached/tmpbinary even when the version string changes. Issue #2's plan review surfaced this duplication as a correctness hazard: a half-applied bump ships a mismatched node/tp pair (a hardInit.makeMiningoutage).bitcoind-gunixbuilds the official Bitcoin Core GUIX release and gates the build on byte-for-byte sha256 parity — a successfulnix buildis the verification. Consumed as a flake input, it makes the flake lock the single source of truth for the node version and replaces all three hand-maintained pins.Scope (the ask)
Replace the hand-pinned node packaging with a
bitcoind-gunixflake input:bitcoind-gunixas a flake input and expose the multiprocess node binary (bin/bitcoin+libexec/bitcoin-node) from it, in place ofbitcoin-node.nix.BITCOIN_VERSIONpin +curl//tmpdownload inscripts/build.shandscripts/ship.sh, sourcing the flake-built binary instead (built from the store, or whatever deploy path the spike settles).bitcoin-node.nixonce nothing imports it.This is version-neutral: it changes how the node is sourced, not which version runs.
Spike first (exploratory — resolve before the implementation shape is fixed)
Three unknowns gate the design. Run a spike and record the answers before writing the dev plan:
libexec/bitcoin-node(the multiprocess layout), or onlybitcoind?bitcoind, the default (swap the input) fails — fall back to consuming itstarballoutput or adding a package.nix build+ copy-from-store, or keep a download?Default path if the spike is clean: swap
bitcoin-node.nix→ gunix input, deploy from the store. Alternatives (extract from gunix'starball, add a package, or defer) are follow-ups only if the default fails.Boundaries (out of scope)
sv2-tppackaging stays as-is (sv2-tp.nix). gunix covers only the Bitcoin node;stratum-mining/sv2-tpis a separate upstream with no gunix equivalent.bitcoin-nodeservice VM (notes/allod/bitcoin-node-vm.md) is a different machine and repo; it already plans gunix for a Tor-only wallet node. Shared dependency, separate deliverable.Validation
nix build .#bitcoin-node(or the gunix-derived attr) yieldsbin/bitcoin+bin/bitcoin-cli+libexec/bitcoin-node, and gunix's sha256 gate passes.devenv upbrings up the node +sv2-tpover IPC with noInit.makeMining/interfaces.cpperrors (the same regtest smoke test as issue #2).git grep BITCOIN_VERSIONplus a scan for any remaining node version pin returns only intended results — the three-way duplication is gone.Sequencing
Follows issue #2 (which ships 31.1 on the existing mechanism, reviewed and near-converged). Refs #2. The dev plan will live at
notes/hashpool/dev-plans/<slug>.mdper the plan-review process; this is its tracking issue.vnprc-agent referenced this issue2026-08-12 18:07:45 +01:00