-
Notifications
You must be signed in to change notification settings - Fork 70
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
Compact filter #26
Compact filter #26
Conversation
Updated with the requested changes. |
This adds a compact filter configuration to connect the wallet with a Bitcoin core node serving compact filters. Esplora and Compact filter configs are first parsed, and fall back to default electrum config if none of them are provided.
Readme updated to include instruction to connect to Bitcoin Core node serving compact filters.
This will append the wallet name provided via configuration flag to bdk-cli into the data directory. So the current structure of datadir is `~/.bdk-bitcoin/compact_filters/<wallet-name>. This will let bdk-cli keep multiple wallet directories simultaneously.
c97eb4d
to
79e4fe1
Compare
Updated the The objective is to keep multiple wallet data directories separate. This PR is ready for a second look. |
src/lib.rs
Outdated
pub passwd: Option<String>, | ||
|
||
/// Sets the light client network address | ||
#[structopt(name = "ADDRESS:PORT", short = "n", long = "node")] |
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.
Similar to ElectrumOpts server, I'd set a default_value
for CompactFiltersOpts address ("node") to "127.0.0.1:18444", hopefully in the future we'll be able to make this optional and find our peers via dns seed discovery if none are given. But for now I think it's ok to just default to what most people will probably be testing with. This also give an example to show users the expected format. I'd also add to the description to make it clear this is peer full node address, something like: "Sets the compact block filter enabled full node address"
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.
Yes agreed. Also enabling conn_count
to start multiple connections to the same node. This parameter is not used right now.
Also thinking about having --node
as a list of ADDRS:PORT
strings. Instead of one address, user can give multiple addresses and wallet will make a total of no. of address * conn_count
connections.
Does that make sense?
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.
Sounds good but I don't think anyone has tested the CBF blockchain code with multiple nodes, just with multiple connections to the same node. But seems like it should work and maybe now is a good time to test it. Worst case we go back to just connecting to a single node multiple times.
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.
Ya. Updated the code. Planning to run that exact test too. Even if a multiple node connection doesn't work, the user can still give a single node address and it will resume standard behavior.
This PR makes the following changes: - Proxy configuration is moved into a separate `ProxyOpt` structure inside `WalletOpts`. `ProxyOpts` are only enabled for `compact_filters` and `electrum` features. - `--node` config can now take `vec<String>` and make `conn_count` number of connections to each node.
Updated with requested changes. Code is ready for further testing and review. |
Update for ReviewersThere is a likely error like this while trying to connect to a full node.
This happens while connecting to fresh instant of Solution is to to delete the datadir, then run. |
Looks like the |
@notmandatory Yes, the doc tests were failing as I forgot to change them to be compatible with the current Note:
It doesn't need docker containers to run the |
08d17a6
to
1dec3c7
Compare
Doc tests were failing due to incompatibility with recent changes made into the `walletOpts` structure.
1dec3c7
to
0fb648c
Compare
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.
ACK f22828d
Will merge tomorrow if no one has any objections.
Description
This PR adds the compact filter configuration to connect bdk-cli with a Bitcoin Core node serving compact filters.
Note to Reviewers
I have updated the Readme doc with new usage instruction. If thats not clear (because github doesn't show .md outputs in PR) below is the instruction:
To sync a wallet to Bitcoin Core node (assuming a regtest node at 127.0.0.1:18444) serving compact filters:
Then run:
cargo run --features compact_filters -- --network regtest wallet --node 127.0.0.1:18444 --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: