Skip to content

Add rpc wallet example crates #928

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

Closed

Conversation

rajarshimaitra
Copy link
Contributor

Description

This PR adds the RPC wallet syncing codes. This includes the rpcwallet library, keychain_tracker_rpc command line app, and wallet_rpc BDK wallet example.

This works on the existing structure of bdk_chain and might require update after #895.

Notes to the reviewers

This still has many rough ages.

  • The RpcClient currently initiates a legacy wallet, into which we import all the tracker addresses. This still causes the problem reported in RPC sync failure  #859. The work-around for now added in the code is to ignore the resource unavailable error and carry on. Looking for more suggestions. One future hope is, using the core's descriptor wallet and work with descriptor imports. But still might not fix this RPC issue.

  • I added a new Wallet API dump_spks which is useful for getting all the existing spks from the tracker without rederiving them.

  • Basic docs are added. If you see anything missing or inappropriate let me know.

  • What should be the approach of testing? Should we think of recreating the previous blockchian tests?

Changelog notice

  • Add the new rpc-wallet syncing examples.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

This commit adds the respective entries in project's cargo.toml
workspace.

This adds one new wallet api `dump_spks` which is useful for dumping all
the existing wallet spks without the need of deriving new ones.
@notmandatory
Copy link
Member

I seem to recall a discussion about syncing a new 1.0 wallet with RPC using full blocks, or I could be conflating with a different discussion. Either way.. in theory would it be possible to sync a bdk 1.0 wallet by scanning all the blocks from the birth date of the wallet, and then updating with new blocks every time the chain tip changes? This question came up in a discussion I was having with @bodymindarts about improving sync performance for very large (200K+) address wallets.

@evanlinjin
Copy link
Member

@notmandatory That would be a separate example!

@evanlinjin
Copy link
Member

Closing as it is stale and is based on codebase from a while back. In the future we may want this, however we had no requests so far, and I would assume block-by-block would be the way to go.

@evanlinjin evanlinjin closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants