Table of Contents

Interface IPeerService

Namespace
NLightning.Domain.Node.Interfaces
Assembly
NLightning.Domain.dll

Interface for the peer application service.

public interface IPeerService

Properties

Features

Gets the feature options for the peer.

FeatureOptions Features { get; }

Property Value

FeatureOptions

PeerPubKey

Gets the peer's public key.

CompactPubKey PeerPubKey { get; }

Property Value

CompactPubKey

PreferredHost

string? PreferredHost { get; }

Property Value

string

PreferredPort

ushort? PreferredPort { get; }

Property Value

ushort?

Methods

Disconnect()

Disconnects from the peer.

void Disconnect()

SendMessageAsync(IChannelMessage)

Sends an asynchronous message to the peer.

Task SendMessageAsync(IChannelMessage replyMessage)

Parameters

replyMessage IChannelMessage

The message to be sent to the peer.

Returns

Task

A task that represents the asynchronous operation.

Events

OnChannelMessageReceived

Occurs when a channel message is received from the connected peer.

event EventHandler<ChannelMessageEventArgs> OnChannelMessageReceived

Event Type

EventHandler<ChannelMessageEventArgs>

OnDisconnect

Event raised when the peer is disconnected.

event EventHandler<PeerDisconnectedEventArgs> OnDisconnect

Event Type

EventHandler<PeerDisconnectedEventArgs>