#tokio #lightning #connection #wish #sockets #tcp-stream #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

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

#2799 in Magic Beans

Download history 2187/week @ 2024-03-14 1407/week @ 2024-03-21 2056/week @ 2024-03-28 2390/week @ 2024-04-04 1917/week @ 2024-04-11 2636/week @ 2024-04-18 2145/week @ 2024-04-25 2081/week @ 2024-05-02 2801/week @ 2024-05-09 2063/week @ 2024-05-16 2844/week @ 2024-05-23 2229/week @ 2024-05-30 2889/week @ 2024-06-06 2586/week @ 2024-06-13 2712/week @ 2024-06-20 1590/week @ 2024-06-27

10,142 downloads per month
Used in 4 crates

MIT/Apache

6.5MB
105K 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

~9–18MB
~176K SLoC