[][src]Module magical::blockchain

Blockchain backends

This module provides the implementation of a few commonly-used backends like Electrum, Esplora and Compact Filters/Neutrino, along with two generalized traits Blockchain and OnlineBlockchain that can be implemented to build customized backends.

Types that only implement the Blockchain trait can be used as backends for Wallets, but any action that requires interacting with the blockchain won't be available (Wallet::sync and Wallet::broadcast). This allows the creation of physically air-gapped wallets, that have no ability to contact the outside world. An example of an offline-only client is OfflineBlockchain.

Types that also implement OnlineBlockchain will make the two aforementioned actions available.

Re-exports

pub use self::electrum::ElectrumBlockchain;
pub use self::esplora::EsploraBlockchain;
pub use self::compact_filters::CompactFiltersBlockchain;

Modules

compact_filtersfeature="compact_filters"

Compact Filters

electrumfeature="electrum"

Electrum

esplorafeature="esplora"

Esplora

Structs

LogProgress

Type that implements Progress and logs at level INFO every update received

NoopProgress

Type that implements Progress and drops every update received

OfflineBlockchain

Type that only implements Blockchain and is always offline

Enums

Capability

Capabilities that can be supported by an OnlineBlockchain backend

Traits

Blockchain

Base trait for a blockchain backend

OnlineBlockchain

Trait that defines the actions that must be supported by an online Blockchain

Progress

Trait for types that can receive and process progress updates during OnlineBlockchain::sync and OnlineBlockchain::setup

Functions

log_progress

Create a nwe instance of LogProgress

noop_progress

Create a new instance of NoopProgress

progress

Shortcut to create a channel (pair of Sender and Receiver) that can transport ProgressData

Type Definitions

ProgressData

Data sent with a progress update over a channel