compact_filters
only.Expand description
Compact Filters
This module contains a multithreaded implementation of an Blockchain
backend that
uses BIP157 (aka “Neutrino”) to populate the wallet’s database
by downloading compact filters from the P2P network.
Since there are currently very few peers “in the wild” that advertise the required service flag, this implementation requires that one or more known peers are provided by the user. No dns or other kinds of peer discovery are done internally.
Moreover, this module doesn’t currently support detecting and resolving conflicts between messages received by different peers. Thus, it’s recommended to use this module by only connecting to a single peer at a time, optionally by opening multiple connections if it’s desirable to use multiple threads at once to sync in parallel.
This is an EXPERIMENTAL feature, API and other major changes are expected.
§Example
let num_threads = 4;
let mempool = Arc::new(Mempool::default());
let peers = (0..num_threads)
.map(|_| {
Peer::connect(
"btcd-mainnet.lightning.computer:8333",
Arc::clone(&mempool),
Network::Bitcoin,
)
})
.collect::<Result<_, _>>()?;
let blockchain = CompactFiltersBlockchain::new(peers, "./wallet-filters", Some(500_000))?;
Structs§
- Data to connect to a Bitcoin P2P peer
- Structure implementing the required blockchain traits
- Configuration for a
CompactFiltersBlockchain
- Container for unconfirmed, but valid Bitcoin transactions
- A Bitcoin peer
Enums§
- An error that can occur during sync with a
CompactFiltersBlockchain