Add --daemon-rpc-fallback-addr for backup bitcoind RPC#216
Open
EddieHouston wants to merge 1 commit into
Open
Conversation
When the primary bitcoind is unreachable, electrs will immediately attempt the fallback address before backing off. On reconnect the primary is always tried first so electrs migrates back automatically.
5e223d1 to
8f1b604
Compare
DeviaVir
approved these changes
May 20, 2026
Randy808
approved these changes
May 20, 2026
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.
Summary
--daemon-rpc-fallback-addrCLI flag (optional) that specifies a backup bitcoind JSON-RPC endpoint.--daemon-rpc-addris unreachable, electrs immediately tries the fallback before entering the 3-second backoff loop.Motivation
Allows running electrs against a pair of bitcoind nodes (e.g. primary + warm standby) so that transient restarts or maintenance on the primary don't stall indexing.
Changes
config.rs— newdaemon_rpc_fallback_addr: Option<SocketAddr>field and CLI argdaemon.rs—tcp_connecttries primary then fallback;Connectionstores and propagates the fallback throughreconnect()electrs.rs,tx-fingerprint-stats.rs— pass the new field through toDaemon::newTest plan
--daemon-rpc-addr(no fallback) — verify behavior is unchanged--daemon-rpc-fallback-addrpointing to a second bitcoind, stop the primary — verify electrs connects to fallback