Skip to content

Provide a one liner to sync with electrum #1974

@matthiasdebernardini

Description

@matthiasdebernardini

Describe the enhancement

Currently there is a lot of boilerplate needed to sync a wallet with electrum, it would be great to have one function that lets you pass in a mutable reference to a wallet and then have it update its internals with block data.

It used to be much easier to sync with electrum in the prior versions of bdk, it would be great to have a return to that simplicity.

Use case

load a wallet, then sync it with electrum to get block data with a single line of code

Additional context

I personally think a builder method and some macros/convinience functions built on top of that would work well, I usually just want a full scan no matter what but every once in a while I'll need a fast sync.

  ElectrumBuilder::new(wallet)
          .url("tcp://electrum.blockstream.info:50001")
          .network(NETWORK)
          .stop_gap(25)
          .batch_size(30)
          .fast_sync() 
          .fetch_prev_txouts()
          .request()?;

I'll bring this up in the Thursday meeting with @evanlinjin since I know he is working with electrum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions