Table of Contents

Class PeerServiceFactory

Namespace
NLightning.Infrastructure.Node.Factories
Assembly
NLightning.Infrastructure.dll

Factory for creating peer services.

public class PeerServiceFactory : IPeerServiceFactory
Inheritance
PeerServiceFactory
Implements
Inherited Members

Constructors

PeerServiceFactory(ILoggerFactory, IMessageFactory, IMessageServiceFactory, ISecureKeyManager, ITransportServiceFactory, IOptions<NodeOptions>, IServiceProvider)

public PeerServiceFactory(ILoggerFactory loggerFactory, IMessageFactory messageFactory, IMessageServiceFactory messageServiceFactory, ISecureKeyManager secureKeyManager, ITransportServiceFactory transportServiceFactory, IOptions<NodeOptions> nodeOptions, IServiceProvider serviceProvider)

Parameters

loggerFactory ILoggerFactory
messageFactory IMessageFactory
messageServiceFactory IMessageServiceFactory
secureKeyManager ISecureKeyManager
transportServiceFactory ITransportServiceFactory
nodeOptions IOptions<NodeOptions>
serviceProvider IServiceProvider

Methods

CreateConnectedPeerAsync(CompactPubKey, TcpClient)

Creates a peer we're connecting to.

public Task<IPeerService> CreateConnectedPeerAsync(CompactPubKey peerPubKey, TcpClient tcpClient)

Parameters

peerPubKey CompactPubKey

Peer public key

tcpClient TcpClient

TCP client

Returns

Task<IPeerService>

A task that represents the asynchronous operation. The task result contains the created peer.

Exceptions

ConnectionException

Thrown when the connection to the peer fails.

CreateConnectingPeerAsync(TcpClient)

Creates a peer connecting to us.

public Task<IPeerService> CreateConnectingPeerAsync(TcpClient tcpClient)

Parameters

tcpClient TcpClient

TCP client

Returns

Task<IPeerService>

A task that represents the asynchronous operation. The task result contains the created peer.

Exceptions

ConnectionException

Thrown when the connection to the peer fails.