public ProvenHeadersBlockStoreSignaled(
     Network network,
     IBlockStoreQueue blockStoreQueue,
     StoreSettings storeSettings,
     IChainState chainState,
     IConnectionManager connection,
     INodeLifetime nodeLifetime,
     ILoggerFactory loggerFactory,
     IInitialBlockDownloadState initialBlockDownloadState,
     IProvenBlockHeaderStore provenBlockHeaderStore,
     ISignals signals,
     IAsyncProvider asyncProvider)
     : base(blockStoreQueue, storeSettings, chainState, connection, nodeLifetime, loggerFactory,
            initialBlockDownloadState, signals, asyncProvider)
 {
     this.network = Guard.NotNull(network, nameof(network));
     this.provenBlockHeaderStore = Guard.NotNull(provenBlockHeaderStore, nameof(provenBlockHeaderStore));
 }
示例#2
0
        public BlockStoreQueue(
            ChainIndexer chainIndexer,
            IChainState chainState,
            IBlockStoreQueueFlushCondition blockStoreQueueFlushCondition,
            StoreSettings storeSettings,
            IBlockRepository blockRepository,
            ILoggerFactory loggerFactory,
            INodeStats nodeStats,
            IAsyncProvider asyncProvider)
        {
            Guard.NotNull(blockStoreQueueFlushCondition, nameof(blockStoreQueueFlushCondition));
            Guard.NotNull(chainIndexer, nameof(chainIndexer));
            Guard.NotNull(chainState, nameof(chainState));
            Guard.NotNull(storeSettings, nameof(storeSettings));
            Guard.NotNull(loggerFactory, nameof(loggerFactory));
            Guard.NotNull(blockRepository, nameof(blockRepository));
            Guard.NotNull(nodeStats, nameof(nodeStats));

            this.blockStoreQueueFlushCondition = blockStoreQueueFlushCondition;
            this.chainIndexer           = chainIndexer;
            this.chainState             = chainState;
            this.storeSettings          = storeSettings;
            this.blockRepository        = blockRepository;
            this.asyncProvider          = asyncProvider;
            this.batch                  = new List <ChainedHeaderBlock>();
            this.blocksCacheLock        = new object();
            this.blocksQueue            = asyncProvider.CreateAsyncQueue <ChainedHeaderBlock>();
            this.pendingBlocksCache     = new Dictionary <uint256, ChainedHeaderBlock>();
            this.logger                 = loggerFactory.CreateLogger(GetType().FullName);
            this.cancellation           = new CancellationTokenSource();
            this.saveAsyncLoopException = null;

            this.BatchThresholdSizeBytes = storeSettings.MaxCacheSize * 1024 * 1024;

            nodeStats.RegisterStats(AddComponentStats, StatsType.Component, GetType().Name);
        }
示例#3
0
 /// <summary>
 ///     Get the default configuration. Invoked via reflection.
 /// </summary>
 /// <param name="builder">The string builder to add the settings to.</param>
 /// <param name="network">The network to base the defaults off.</param>
 public static void BuildDefaultConfigurationFile(StringBuilder builder, Network network)
 {
     StoreSettings.BuildDefaultConfigurationFile(builder, network);
 }
示例#4
0
 /// <summary>
 ///     Prints command-line help. Invoked via reflection.
 /// </summary>
 /// <param name="network">The network to extract values from.</param>
 public static void PrintHelp(Network network)
 {
     StoreSettings.PrintHelp(network);
 }