#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

36 releases

0.0.123 May 9, 2024
0.0.123-beta Apr 19, 2024
0.0.121 Jan 23, 2024
0.0.119 Dec 16, 2023
0.0.13 Mar 9, 2021

#8 in #data-block

Download history 733/week @ 2024-03-14 323/week @ 2024-03-21 1074/week @ 2024-03-28 731/week @ 2024-04-04 465/week @ 2024-04-11 674/week @ 2024-04-18 661/week @ 2024-04-25 695/week @ 2024-05-02 728/week @ 2024-05-09 379/week @ 2024-05-16 395/week @ 2024-05-23 610/week @ 2024-05-30 543/week @ 2024-06-06 624/week @ 2024-06-13 810/week @ 2024-06-20 402/week @ 2024-06-27

2,523 downloads per month
Used in rgb-lightning-sample

MIT/Apache

6.5MB
108K 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–16MB
~149K SLoC