#block-header #chain #data-block #lightning #sync #source #fetch

lightning-block-sync

Utilities to fetch the chain data from a block source and feed them into Rust Lightning

41 releases

new 0.1.0 Jan 16, 2025
0.1.0-beta1 Dec 22, 2024
0.0.125 Oct 14, 2024
0.0.123 May 9, 2024
0.0.13 Mar 9, 2021

#7 in #block-header

Download history 779/week @ 2024-09-26 728/week @ 2024-10-03 1381/week @ 2024-10-10 2393/week @ 2024-10-17 1105/week @ 2024-10-24 1394/week @ 2024-10-31 1796/week @ 2024-11-07 1415/week @ 2024-11-14 1265/week @ 2024-11-21 1545/week @ 2024-11-28 1561/week @ 2024-12-05 1339/week @ 2024-12-12 614/week @ 2024-12-19 235/week @ 2024-12-26 983/week @ 2025-01-02 1080/week @ 2025-01-09

3,012 downloads per month
Used in 7 crates (2 directly)

MIT/Apache

7.5MB
124K SLoC

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.

Dependencies

~9–18MB
~186K SLoC