Пример #1
0
 public Mapi(IRpcMultiClient rpcMultiClient, IFeeQuoteRepository feeQuoteRepository, IBlockChainInfo blockChainInfo, IMinerId minerId, ITxRepository txRepository, ILogger <Mapi> logger, IClock clock)
 {
     this.rpcMultiClient     = rpcMultiClient ?? throw new ArgumentNullException(nameof(rpcMultiClient));
     this.feeQuoteRepository = feeQuoteRepository ?? throw new ArgumentNullException(nameof(feeQuoteRepository));
     this.blockChainInfo     = blockChainInfo ?? throw new ArgumentNullException(nameof(blockChainInfo));
     this.minerId            = minerId ?? throw new ArgumentException(nameof(minerId));
     this.txRepository       = txRepository ?? throw new ArgumentException(nameof(txRepository));
     this.logger             = logger ?? throw new ArgumentException(nameof(logger));
     this.clock = clock ?? throw new ArgumentNullException(nameof(clock));
 }
Пример #2
0
 public MapiController(IOptions <AppSettings> options, IFeeQuoteRepository feeQuoteRepository, IMapi mapi, ILogger <MapiController> logger, IBlockChainInfo blockChainInfo, IMinerId minerId, IClock clock)
 {
     this.feeQuoteRepository = feeQuoteRepository ?? throw new ArgumentNullException(nameof(feeQuoteRepository));
     this.logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     this.mapi           = mapi ?? throw new ArgumentNullException(nameof(mapi));
     this.blockChainInfo = blockChainInfo ?? throw new ArgumentNullException(nameof(blockChainInfo));
     this.minerId        = minerId ?? throw new ArgumentNullException(nameof(minerId));
     this.clock          = clock ?? throw new ArgumentNullException(nameof(clock));
     quoteExpiryMinutes  = options.Value.QuoteExpiryMinutes;
 }
Пример #3
0
        public NotificationsHandler(ILogger <NotificationsHandler> logger, INotificationServiceHttpClientFactory httpClientFactory, IOptions <AppSettings> options,
                                    ITxRepository txRepository, IRpcMultiClient rpcMultiClient, IMinerId minerId, IClock clock)
        {
            this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
            this.httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
            this.txRepository      = txRepository ?? throw new ArgumentNullException(nameof(txRepository));
            this.rpcMultiClient    = rpcMultiClient ?? throw new ArgumentNullException(nameof(rpcMultiClient));
            this.minerId           = minerId ?? throw new ArgumentNullException(nameof(minerId));
            notificationSettings   = options.Value.Notification;
            var maxNumberOfSlowNotifications = notificationSettings.InstantNotificationsQueueSize.Value * notificationSettings.InstantNotificationsSlowTaskPercentage / 100;

            notificationScheduler = new NotificationScheduler(logger, maxNumberOfSlowNotifications, notificationSettings.InstantNotificationsQueueSize.Value,
                                                              notificationSettings.MaxNotificationsInBatch.Value, notificationSettings.NoOfSavedExecutionTimes.Value,
                                                              notificationSettings.SlowHostThresholdInMs.Value);
            this.clock = clock ?? throw new ArgumentNullException(nameof(clock));
        }
Пример #4
0
 public StartupChecker(INodeRepository nodeRepository,
                       INodes nodes,
                       IRpcClientFactory rpcClientFactory,
                       IMinerId minerId,
                       IBlockParser blockParser,
                       IDbManager dbManager,
                       INotificationsHandler notificationsHandler,
                       ILogger <StartupChecker> logger)
 {
     this.rpcClientFactory     = rpcClientFactory ?? throw new ArgumentNullException(nameof(rpcClientFactory));
     this.nodeRepository       = nodeRepository ?? throw new ArgumentNullException(nameof(nodeRepository));
     this.nodes                = nodes ?? throw new ArgumentNullException(nameof(nodes));
     this.logger               = logger ?? throw new ArgumentNullException(nameof(logger));
     this.blockParser          = blockParser ?? throw new ArgumentNullException(nameof(blockParser));
     this.dbManager            = dbManager ?? throw new ArgumentNullException(nameof(dbManager));
     this.minerId              = minerId ?? throw new ArgumentNullException(nameof(nodeRepository));
     this.notificationsHandler = notificationsHandler ?? throw new ArgumentNullException(nameof(notificationsHandler));
 }
Пример #5
0
 public StartupChecker(INodeRepository nodeRepository,
                       IRpcClientFactory rpcClientFactory,
                       IMinerId minerId,
                       IBlockParser blockParser,
                       ICreateDB createDB,
                       INotificationsHandler notificationsHandler,
                       ILogger <StartupChecker> logger,
                       IConfiguration configuration)
 {
     this.rpcClientFactory     = rpcClientFactory ?? throw new ArgumentNullException(nameof(rpcClientFactory));
     this.nodeRepository       = nodeRepository ?? throw new ArgumentNullException(nameof(nodeRepository));
     this.logger               = logger ?? throw new ArgumentException(nameof(logger));
     this.blockParser          = blockParser ?? throw new ArgumentException(nameof(blockParser));
     this.createDB             = createDB ?? throw new ArgumentException(nameof(createDB));
     this.minerId              = minerId ?? throw new ArgumentException(nameof(nodeRepository));
     this.notificationsHandler = notificationsHandler ?? throw new ArgumentException(nameof(notificationsHandler));
     rdbms = RDBMS.Postgres;
 }