Module lightning::ln[][src]

Expand description

High level lightning structs and impls live here.

You probably want to create a channelmanager::ChannelManager, and a routing::NetGraphMsgHandler first. Then, you probably want to pass them both on to a peer_handler::PeerManager and use that to create/manage connections and call get_and_clear_pending_events after each action, handling them appropriately.

When you want to open/close a channel or send a payment, call into your ChannelManager and when you want to learn things about the network topology (eg get a route for sending a payment), call into your NetGraphMsgHandler.

Modules

Various utilities for building scripts and deriving keys related to channels. These are largely of interest for those implementing chain::keysinterface::Sign message signing by hand.

The top-level channel management and payment tracking stuff lives here.

Feature flag definitions for the Lightning protocol according to BOLT #9.

Wire messages, traits representing wire message handlers, and a few error types live here.

Top level peer message handling and socket handling logic lives here.

Structs

payment_hash type, use to cross-lock hop (C-not exported) as we just use [u8; 32] directly

payment_preimage type, use to route payment between hop (C-not exported) as we just use [u8; 32] directly

payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together (C-not exported) as we just use [u8; 32] directly

Constants

Maximum Lightning message data length according to BOLT-8 and BOLT-1: