Interface IPeerManager
- Namespace
- NLightning.Domain.Node.Interfaces
- Assembly
- NLightning.Domain.dll
Interface for the peer manager.
public interface IPeerManager
Methods
ConnectToPeerAsync(PeerAddressInfo)
Connects to a peer.
Task<PeerModel> ConnectToPeerAsync(PeerAddressInfo peerAddressInfo)
Parameters
peerAddressInfoPeerAddressInfoThe peer address to connect to.
Returns
DisconnectPeer(CompactPubKey, Exception?)
Disconnects a peer.
void DisconnectPeer(CompactPubKey compactPubKey, Exception? exception = null)
Parameters
compactPubKeyCompactPubKeyCompactPubKey of the peer
exceptionExceptionOptional exception that caused the disconnection
GetPeer(CompactPubKey)
PeerModel? GetPeer(CompactPubKey peerId)
Parameters
peerIdCompactPubKey
Returns
ListPeers()
List<PeerModel> ListPeers()
Returns
StartAsync(CancellationToken)
Starts the peer manager asynchronously.
Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
StopAsync()
Stops the peer manager asynchronously.
Task StopAsync()
Returns
- Task
A task that represents the asynchronous operation.