public NetworkRequiredConnection(ILogger <NetworkRequiredConnection> logger, IEventBus eventBus, IOptions <LightningNodeSettings> options, IConnectivityPeerStats serverPeerStats, IForgeClientConnectivity forgeConnectivity, IPeriodicWork connectionLoop) : base(logger, eventBus, serverPeerStats, forgeConnectivity, connectionLoop) { _settings = options.Value !; }
public RequiredConnection(ILogger <RequiredConnection> logger, IEventBus eventBus, IOptions <ForgeConnectivitySettings> options, IConnectivityPeerStats serverPeerStats, IForgeClientConnectivity forgeConnectivity, IPeriodicWork connectionLoop) : base(logger, eventBus, serverPeerStats, forgeConnectivity, connectionLoop) { _settings = options.Value !; connectionsToAttempt.AddRange( from connection in _settings.Connections select new OutgoingConnectionEndPoint(connection.GetIPEndPoint()) ); }
public ConnectorBase(ILogger logger, IEventBus eventBus, IConnectivityPeerStats serverPeerStats, IForgeClientConnectivity forgeConnectivity, IPeriodicWork connectionLoop) { this.logger = logger; this.eventBus = eventBus; peerStats = serverPeerStats; this.forgeConnectivity = forgeConnectivity; this.connectionLoop = connectionLoop; DefaultDelayBetweenAttempts = TimeSpan.FromSeconds(15); this.connectionLoop.Configure(stopOnException: true, exceptionHandler: this); }
public ExampleRequiredConnection(ILogger <ExampleRequiredConnection> logger, IEventBus eventBus, IOptions <ExampleSettings> options, IConnectivityPeerStats serverPeerStats, IForgeClientConnectivity forgeConnectivity, IPeriodicWork connectionLoop) : base(logger, eventBus, serverPeerStats, forgeConnectivity, connectionLoop) { _settings = options.Value !; foreach (ExampleClientPeerBinding peerBinding in _settings.Connections) { if (!peerBinding.TryGetExampleEndPoint(out ExampleEndPoint? endPoint)) { logger.LogWarning("Required connection skipped because of wrong format, check settings file. {Endpoint}", peerBinding.EndPoint); continue; } var remoteEndPoint = new OutgoingConnectionEndPoint(endPoint); remoteEndPoint.Items[nameof(endPoint.MyExtraInformation)] = endPoint.MyExtraInformation; _connectionsToAttempt.Add(remoteEndPoint); } }
public MaxConnectionThresholdGuard(ILogger <MaxConnectionThresholdGuard> logger, IOptions <ForgeConnectivitySettings> settings, IConnectivityPeerStats serverPeerStats) : base(logger, settings) { _peerStats = serverPeerStats; }