示例#1
0
 public ChannelController(IPeerManagerProvider peerManagerProvider, NRustLightningNetworkProvider networkProvider, ILogger <ChannelController> logger)
 {
     _peerManagerProvider = peerManagerProvider;
     _networkProvider     = networkProvider;
     _logger = logger;
     _pool   = MemoryPool <byte> .Shared;
 }
示例#2
0
 public InvoiceService(IInvoiceRepository invoiceRepository, EventAggregator eventAggregator, IPeerManagerProvider peerManagerProvider, NRustLightningNetworkProvider networkProvider, ILogger <InvoiceService> logger, IOptions <Config> config)
 {
     _invoiceRepository   = invoiceRepository;
     _eventAggregator     = eventAggregator;
     _peerManagerProvider = peerManagerProvider;
     _networkProvider     = networkProvider;
     _logger = logger;
     _config = config;
 }
 public WalletController(NRustLightningNetworkProvider networkProvider,
                         IWalletService walletService,
                         IPeerManagerProvider peerManagerProvider,
                         RepositoryProvider repositoryProvider)
 {
     _networkProvider     = networkProvider;
     _walletService       = walletService;
     _peerManagerProvider = peerManagerProvider;
     _repositoryProvider  = repositoryProvider;
     _pool = MemoryPool <byte> .Shared;
 }
        public P2PConnectionHandler(ISocketDescriptorFactory descriptorFactory, IPeerManagerProvider peerManager,
                                    ILoggerFactory loggerFactory, IConnectionFactory connectionFactory)
        {
            // TODO: Support other chains
            this.descriptorFactory = descriptorFactory ?? throw new ArgumentNullException(nameof(descriptorFactory));
            _loggerFactory         = loggerFactory;
            _connectionFactory     = connectionFactory;
            _logger = _loggerFactory.CreateLogger <P2PConnectionHandler>();
            var pmProvider = peerManager ?? throw new ArgumentNullException(nameof(peerManager));

            PeerManager = pmProvider.TryGetPeerManager("BTC");
            _logger.LogWarning("WARNING: it only supports BTC");
            _pool       = MemoryPool <byte> .Shared;
            EventNotify = Channel.CreateBounded <byte>(new BoundedChannelOptions(100));
        }
示例#5
0
 public RustLightningEventReactor(
     P2PConnectionHandler connectionHandler,
     IPeerManagerProvider peerManagerProvider,
     IWalletService walletService,
     NRustLightningNetwork network,
     EventAggregator eventAggregator,
     ILogger logger,
     IInvoiceRepository invoiceRepository)
 {
     _pool = MemoryPool <byte> .Shared;
     _connectionHandler   = connectionHandler;
     _peerManagerProvider = peerManagerProvider;
     _walletService       = walletService;
     _network             = network;
     _eventAggregator     = eventAggregator;
     _logger            = logger;
     _invoiceRepository = invoiceRepository;
     _peerManager       = peerManagerProvider.TryGetPeerManager(network.CryptoCode);
 }
示例#6
0
 public NBXplorerListeners(NRustLightningNetworkProvider networkProvider, INBXplorerClientProvider clientProvider, IPeerManagerProvider peerManagerProvider, ILoggerFactory loggerFactory,
                           ChannelProvider channelProvider)
 {
     foreach (var n in networkProvider.GetAll())
     {
         var cli     = clientProvider.TryGetClient(n);
         var peerMan = peerManagerProvider.TryGetPeerManager(n);
         if (cli != null && peerMan != null)
         {
             var listener = new NBXplorerListener(cli, peerMan, loggerFactory.CreateLogger <NBXplorerListener>(), channelProvider.GetFeeRateChannel(n).Writer);
             _listeners.TryAdd(n.CryptoCode, listener);
         }
     }
 }
示例#7
0
 public PeerController(IPeerManagerProvider peerManagerProvider, ISocketDescriptorFactory socketDescriptorFactory, P2PConnectionHandler connectionHandler)
 {
     _connectionHandler      = connectionHandler;
     PeerManagerProvider     = peerManagerProvider;
     SocketDescriptorFactory = socketDescriptorFactory;
 }