#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

34 releases

new 0.0.123-beta Apr 19, 2024
0.0.121 Jan 23, 2024
0.0.119 Dec 16, 2023
0.0.118 Oct 24, 2023
0.0.13 Mar 9, 2021

#2683 in Magic Beans

Download history 183/week @ 2023-12-22 245/week @ 2023-12-29 255/week @ 2024-01-05 429/week @ 2024-01-12 524/week @ 2024-01-19 501/week @ 2024-01-26 547/week @ 2024-02-02 256/week @ 2024-02-09 474/week @ 2024-02-16 263/week @ 2024-02-23 669/week @ 2024-03-01 489/week @ 2024-03-08 683/week @ 2024-03-15 524/week @ 2024-03-22 909/week @ 2024-03-29 708/week @ 2024-04-05

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

MIT/Apache

6.5MB
107K 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–17MB
~151K SLoC