Appearance
Peer Management
One of the first things you'll need to do when building your own Lightning node is connect to a peer. In LDK this is handled by the PeerManager.
The PeerManager has two dependencies:
- A
ChannelManagerthat enables it to notify peers when it wants to do things such as open channels. - A
P2PGossipSyncthat understands when peers you are connected to send you gossip messages, enables you to forward messages, announce channel opens and more.
Since LDK knows nothing about your networking stack, you'll need to implement your own networking logic in order to connect to peers on the network. Provide LDK with raw TCP/IP socket data and the library will handle the rest for you.
LDK also handles a number of background tasks that need to happen periodically via BackgroundProcessor