Esempio n. 1
0
 public BitcoinDWaiter(
     RPCClient rpc,
     ExplorerConfiguration configuration,
     NBXplorerNetwork network,
     SlimChain chain,
     Repository repository,
     AddressPoolService addressPoolService,
     EventAggregator eventAggregator)
 {
     if (addressPoolService == null)
     {
         throw new ArgumentNullException(nameof(addressPoolService));
     }
     _OriginalRPC    = rpc;
     _RPCWithTimeout = rpc.Clone();
     _RPCWithTimeout.RequestTimeout = TimeSpan.FromMinutes(1.0);
     _Configuration      = configuration;
     _Network            = network;
     _Chain              = chain;
     State               = BitcoinDWaiterState.NotStarted;
     _EventAggregator    = eventAggregator;
     _ChainConfiguration = _Configuration.ChainConfigurations.First(c => c.CryptoCode == _Network.CryptoCode);
     _ExplorerPrototype  = new ExplorerBehavior(repository, chain, addressPoolService, eventAggregator)
     {
         StartHeight = _ChainConfiguration.StartHeight
     };
     RPCReadyFile = Path.Combine(configuration.SignalFilesDir, $"{network.CryptoCode.ToLowerInvariant()}_fully_synched");
 }
Esempio n. 2
0
 public BitcoinDWaiters(
     AddressPoolService addressPool,
     NBXplorerNetworkProvider networkProvider,
     ChainProvider chains,
     RepositoryProvider repositoryProvider,
     ExplorerConfiguration config,
     RPCClientProvider rpcProvider,
     EventAggregator eventAggregator)
 {
     this.addressPool        = addressPool;
     this.networkProvider    = networkProvider;
     this.chains             = chains;
     this.repositoryProvider = repositoryProvider;
     this.config             = config;
     this.rpcProvider        = rpcProvider;
     this.eventAggregator    = eventAggregator;
 }
Esempio n. 3
0
 public ExplorerBehavior(Repository repo, SlimChain chain, AddressPoolService addressPoolService, EventAggregator eventAggregator)
 {
     if (repo == null)
     {
         throw new ArgumentNullException(nameof(repo));
     }
     if (chain == null)
     {
         throw new ArgumentNullException(nameof(chain));
     }
     if (addressPoolService == null)
     {
         throw new ArgumentNullException(nameof(addressPoolService));
     }
     _Chain             = chain;
     AddressPoolService = addressPoolService;
     _Repository        = repo;
     _EventAggregator   = eventAggregator;
 }
Esempio n. 4
0
 public BitcoinDWaiter(
     RPCClient rpc,
     ExplorerConfiguration configuration,
     NBXplorerNetwork network,
     SlimChain chain,
     Repository repository,
     AddressPoolService addressPoolService,
     EventAggregator eventAggregator)
 {
     if (addressPoolService == null)
     {
         throw new ArgumentNullException(nameof(addressPoolService));
     }
     _RPC                = rpc;
     _Configuration      = configuration;
     _AddressPoolService = addressPoolService;
     _Network            = network;
     _Chain              = chain;
     _Repository         = repository;
     State               = BitcoinDWaiterState.NotStarted;
     _EventAggregator    = eventAggregator;
     _ChainConfiguration = _Configuration.ChainConfigurations.First(c => c.CryptoCode == _Network.CryptoCode);
 }
Esempio n. 5
0
 public BitcoinDWaiter(
     RPCClient rpc,
     ExplorerConfiguration configuration,
     NBXplorerNetwork network,
     SlimChain chain,
     Repository repository,
     AddressPoolService addressPoolService,
     EventAggregator eventAggregator)
 {
     if (addressPoolService == null)
     {
         throw new ArgumentNullException(nameof(addressPoolService));
     }
     _RPC                = rpc;
     _Configuration      = configuration;
     _AddressPoolService = addressPoolService;
     _Network            = network;
     _Chain              = chain;
     _Repository         = repository;
     State               = BitcoinDWaiterState.NotStarted;
     _EventAggregator    = eventAggregator;
     _ChainConfiguration = _Configuration.ChainConfigurations.First(c => c.CryptoCode == _Network.CryptoCode);
     RPCReadyFile        = Path.Combine(configuration.DataDir, $"{network.CryptoCode.ToLowerInvariant()}_fully_synched");
 }