# Peer Management

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 (opens new window).

The PeerManager has two dependencies:

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 (opens new window)

Default Implementation

If you are developing in a Rust Tokio (opens new window) environment, LDK ships with a socket handling crate (opens new window) that let's you easily create new connections with peers.

Last Updated: 11/23/2022, 3:45:10 PM