Repository navigation
bitcoind: remove Knots and package selection - #145
Merged
Merged
Conversation
Drop bitcoind-knots from the pinned packages and remove services.bitcoind.package. Use nix-bitcoin.pkgs.bitcoind for the daemon, bitcoin-cli and Core Lightning's bitcoin-cli dependency. Add config version 0.1.3 migration guidance and a removed-option diagnostic. Validated flake checks for both supported systems, shellcheck, mdBook, package wiring, migration diagnostics and primary scenario evaluation. VM runtime tests were not run on macOS. Assisted-by: OpenAI Codex (GPT-6)
seberm
approved these changes
Oct 24, 2026
prusnak
added a commit
that referenced
this pull request
Oct 24, 2026
Blocked by: - [x] bitcoin-knots removal - ~#143 - #145 - [x] Release of [v0.1.2](https://github.com/bitcoinix/bitcoinix/releases/tag/v0.1.2) --- Two commits: `electrs: 0.11.0 -> 0.12.0` and `electrs: refuse to start on an index of electrs < 0.12`. ## What changes electrs 0.12.0 switched to [bindex](https://github.com/romanz/bindex-rs): - **Reindex required**: a few hours up to about a day, depending on the hardware. The final index is ~7% of `blocks/*.dat`, up to ~14% during the sync. Meanwhile electrs, and mempool if it uses electrs, answers with incomplete history and balances. See "Old index" below. - **Bitcoin Core 31+ required**: bindex uses the `/rest/blockpart` endpoint. An eval-time assertion on `nix-bitcoin.pkgs.bitcoind` fails evaluation for an older Core ("electrs requires Bitcoin Core 31 or later."), e.g. with `useVersionLockedPkgs = false`. - **Reads blocks through bitcoind's REST interface**: the module enables `services.bitcoind.rest.enable`. REST is unauthenticated: if `rpc.allowip` has non-local sources, evaluation fails unless `rest.allowNonLocal` is set, which means accepting unauthenticated REST for those sources. Raw `rpcallowip`/`includeconf` in `extraConfig` need `rest.allowUncheckedConfig`. The versioning entry and docs say so. - `--daemon-p2p-addr` was removed upstream, so electrs no longer enables bitcoind's whitelisted p2p listener (btcpayserver still enables it for itself). - `pkgs/pinned.nix` is regenerated by `helper/update-flake.sh`, which moves electrs to unstable (the pin update held it on stable by hand until this lands). - Docs: "Upgrading to config version 0.1.3" (steps, disk, downtime, REST) and `rest=1` on the other node when using a remote bitcoind. ## Old index: manual reindex, no crash loop electrs 0.12.0 doesn't convert or delete the old index, which uses the same path (`<dataDir>/bitcoin`, or `regtest`). On it, bindex panics with `Unsupported DB format (0 < 1) - please reindex!`, and with `Restart=on-failure` the unit would restart every 10 s. The reindex stays **manual**: it takes up to a day on a big node, so the operator picks the moment, and nothing deletes user data from a start script. A 0.1.3 versioning entry gives the steps: `systemctl stop electrs`, `rm -r <dataDir>/<network>`, then deploy. If the old index is still there, the unit fails once with a clear message instead of crash-looping: - A marker `<dataDir>/<network>.bindex` identifies a 0.12 index. It is written when electrs starts and no index directory exists yet (fresh install, or after the `rm -r`). - If the index directory exists without the marker, the start wrapper prints the reindex steps and exits with status 78, which `RestartPreventExitStatus` excludes from restarts. Nothing is deleted. - The check runs in the main process (a wrapper that `exec`s electrs), not in `preStart`: a failing ExecStartPre still triggers `Restart=on-failure`, and `RestartPreventExitStatus` only applies to the main process. ## Tests - The `regtest` test now waits until electrs has indexed all blocks (0.12 serves requests while it is still indexing) and queries the history of the address that mined the regtest blocks over the Electrum protocol. That exercises bindex's REST block fetches end to end. - The `electrs` test removes the marker and checks that the unit ends `failed` (not auto-restarting) with exit status 78 and the reindex message, then restores the marker and checks that electrs starts again. - electrs now enables REST in all CI scenarios, so the "REST disabled ⇒ 404" path of the `bitcoind-rest` test only runs in scenarios without electrs (e.g. `lndPruned`). On the current head: `-s electrs` and `netnsRegtest` passed locally, `nix flake check` passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop bitcoind-knots from the pinned packages and remove services.bitcoind.package. Use nix-bitcoin.pkgs.bitcoind for the daemon, bitcoin-cli and Core Lightning's bitcoin-cli dependency.
Add config version 0.1.3 migration guidance and a removed-option diagnostic.
Validated flake checks for both supported systems, shellcheck, mdBook, package wiring, migration diagnostics and primary scenario evaluation. VM runtime tests were not run on macOS.