#tokio #lightning #connection #tcp-stream #wish #sockets #reference

lightning-net-tokio

Implementation of the rust-lightning network stack using Tokio. For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio

44 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.1 Jun 1, 2019

#909 in Magic Beans

Download history 2441/week @ 2024-07-08 2559/week @ 2024-07-15 3218/week @ 2024-07-22 2184/week @ 2024-07-29 2979/week @ 2024-08-05 2783/week @ 2024-08-12 2612/week @ 2024-08-19 3534/week @ 2024-08-26 2386/week @ 2024-09-02 2441/week @ 2024-09-09 2211/week @ 2024-09-16 2533/week @ 2024-09-23 2256/week @ 2024-09-30 2376/week @ 2024-10-07 3914/week @ 2024-10-14 2846/week @ 2024-10-21

11,547 downloads per month
Used in 5 crates (4 directly)

MIT/Apache

7MB
114K SLoC

A socket handling library for those running in Tokio environments who wish to use rust-lightning with native TcpStreams.

Designed to be as simple as possible, the high-level usage is almost as simple as "hand over a TcpStream and a reference to a PeerManager and the rest is handled".

The PeerManager, due to the fire-and-forget nature of this logic, must be a reference, (e.g. an [Arc]) and must use the SocketDescriptor provided here as the PeerManager's SocketDescriptor implementation.

Three methods are exposed to register a new connection for handling in tokio::spawn calls; see their individual docs for details.

Dependencies

~10–18MB
~184K SLoC