-
Notifications
You must be signed in to change notification settings - Fork 103
feat: chain source rest sync #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds: - Sync client configuration with RPC (default) and REST variants - Extend the ChainSource::Bitcoind configuration options - Preliminary implementation for BitcoindSyncClient in RPC mode
Additionally adds the BlockSource implementation for BitcoindSyncClient
👋 Thanks for assigning @tnull as a reviewer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this! Before I get into more detailed review, I want to note two things on the chosen approach that stood out to me from a first look:
- I'm not quite convinced we should rename the
BitcoindRpc
client. Wouldn't it be cleaner to just add a (granted, rather duplicative)BitcoindRest
variant side-by-side, and then in a second step maybe see how we can DRY up the code. Mushing both variants together seems to result in a rather confusing API and code structure. - I'm a bit confused why we'd now still have RPC credentials on
set_chain_source_bitcoind
(and elsewhere in downstream from that), even if we want to use the REST backend? Is there any operation that still requires RPC access? Can't we just rely on REST alone?
Thanks for the early feedback.
I understand your concerns about the name and API changes I have introduced but here is a bit of context. Adding a
|
Aaah, okay, then the proposed approach makes more sense. I think it's still a bit awkward to have the mandatory RPC credentials on the While it then makes sense to reuse the client internally, it might be simpler to just keep the original |
What this PR does
This PR introduces chain source synchronization with Bitcoin Core's REST API. To do so, it explicitly distinguishes between the
bitcoind_rpc_client
and the newly introducedbitcoind_sync_client
that can sync either via the RPC or REST APIs.BitcoindRpcClient
is maintained and the distinction created because the REST interface exposed by Bitcoin Core is not as robust as the RPC interface. This makes it impossible to send POST request to broadcast a transaction for example.Related Issues
Fixes #496
cc @tnull @joostjager