Expand description
A lightweight client for keeping in sync with chain activity.
Defines an SpvClient utility for polling one or more block sources for the best chain tip.
It is used to notify listeners of blocks connected or disconnected since the last poll. Useful
for keeping a Lightning node in sync with the chain.
Defines a BlockSource trait, which is an asynchronous interface for retrieving block headers
and data.
Enabling feature rest-client or rpc-client allows configuring the client to fetch blocks
using Bitcoin Core’s REST or RPC interface, respectively.
Both features support either blocking I/O using std::net::TcpStream or, with feature tokio,
non-blocking I/O using tokio::net::TcpStream from inside a Tokio runtime.
Modules§
- gossip
- When fetching gossip from peers, lightning nodes need to validate that gossip against the
current UTXO set. This module defines an implementation of the LDK API required to do so
against a
BlockSourcewhich implements a few additional methods for accessing the UTXO set. - http
rest-clientorrpc-client - Simple HTTP implementation which supports both async and traditional execution environments with minimal dependencies. This is used as the basis for REST and RPC clients.
- init
- Utilities to assist in the initial sync required to initialize or reload Rust-Lightning objects from disk.
- poll
- Adapters that make one or more
BlockSources simpler to poll for new chain tip transitions. - rest
rest-client - Simple REST client implementation which implements
BlockSourceagainst a Bitcoin Core REST endpoint. - rpc
rpc-client - Simple RPC client implementation which implements
BlockSourceagainst a Bitcoin Core RPC endpoint.
Structs§
- Block
Header Data - A block header and some associated data. This information should be available from most block sources (and, notably, is available in Bitcoin Core’s RPC and REST interfaces).
- Block
Source Error - Error type for
BlockSourcerequests. - Chain
Notifier - Notifies listeners of blocks that have been connected or disconnected from the chain.
- SpvClient
- A lightweight client for keeping a listener in sync with the chain, allowing for Simplified Payment Verification (SPV).
Enums§
- Block
Data - A block including either all its transactions or only the block header.
- Block
Source Error Kind - The kind of
BlockSourceError, either persistent or transient.
Traits§
- Block
Source - Abstract type for retrieving block headers and data.
- Cache
- The
Cachetrait defines behavior for managing a block header cache, where block headers are keyed by block hash.
Type Aliases§
- Async
Block Source Result - Result type for asynchronous
BlockSourcerequests. - Block
Source Result - Result type for
BlockSourcerequests. - Unbounded
Cache - Unbounded cache of block headers keyed by block hash.