#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

40 releases

0.0.125 Oct 14, 2024
0.0.124-rc1 Aug 29, 2024
0.0.123 May 9, 2024
0.0.121 Jan 23, 2024
0.0.13 Mar 9, 2021

#7 in #block-header

Download history 1147/week @ 2024-08-03 735/week @ 2024-08-10 898/week @ 2024-08-17 997/week @ 2024-08-24 690/week @ 2024-08-31 656/week @ 2024-09-07 539/week @ 2024-09-14 681/week @ 2024-09-21 755/week @ 2024-09-28 728/week @ 2024-10-05 2158/week @ 2024-10-12 1848/week @ 2024-10-19 1033/week @ 2024-10-26 1684/week @ 2024-11-02 1557/week @ 2024-11-09 1241/week @ 2024-11-16

5,640 downloads per month
Used in 2 crates

MIT/Apache

7MB
117K 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

~7–15MB
~157K SLoC