예제 #1
0
 public MinerCoordinator(ILoggerFactory loggerFactory, IAppConfiguration appConfiguration, BlockTemplateCache blockTemplateCache, DeviceController deviceController, RPCClient rpcClient)
 {
     this.logger             = loggerFactory.CreateLogger <MinerCoordinator>();
     this.appConfiguration   = appConfiguration;
     this.rpcClient          = rpcClient;
     this.blockTemplateCache = blockTemplateCache;
     this.deviceController   = deviceController;
 }
예제 #2
0
 public WorkPuller(IAppConfiguration appConfiguration, BlockTemplateCache blockTemplateCache, StakingService stakingService, MinerCoordinator minerCoordinator, DeviceController deviceController, RPCClient rpcClient, ILoggerFactory loggerFactory)
 {
     this.appConfiguration   = appConfiguration;
     this.blockTemplateCache = blockTemplateCache;
     this.stakingService     = stakingService;
     this.minerCoordinator   = minerCoordinator;
     this.deviceController   = deviceController;
     this.rpcClient          = rpcClient;
     this.logger             = loggerFactory.CreateLogger <WorkPuller>();
     this.stopwatch          = new Stopwatch();
 }
예제 #3
0
 public StakingService(ILoggerFactory loggerFactory, IAppConfiguration appConfiguration, BlockTemplateCache blockTemplateCache, RPCClient rpcClient)
 {
     this.logger             = loggerFactory.CreateLogger <StakingService>();
     this.appConfiguration   = appConfiguration;
     this.blockTemplateCache = blockTemplateCache;
     this.rpcClient          = rpcClient;
     this.stakingTask        = new Task(StakingLoop, appConfiguration.Cts.Token);
     this.stopwatch          = Stopwatch.StartNew();
     this.Status             = new StakingStatus {
         StartedUtc = DateTimeOffset.UtcNow.ToUnixTimeSeconds()
     };
     this.PosV3 = new PosV3 {
         SearchInterval = 64, BlockInterval = 4 * 64
     };
 }