예제 #1
0
 public BlockStoreFeature(
     ConcurrentChain chain,
     IConnectionManager connectionManager,
     Signals.Signals signals,
     IBlockRepository blockRepository,
     IBlockStoreCache blockStoreCache,
     StoreBlockPuller blockPuller,
     BlockStoreLoop blockStoreLoop,
     BlockStoreManager blockStoreManager,
     BlockStoreSignaled blockStoreSignaled,
     INodeLifetime nodeLifetime,
     NodeSettings nodeSettings,
     ILoggerFactory loggerFactory,
     StoreSettings storeSettings,
     string name = "BlockStore")
 {
     this.name               = name;
     this.chain              = chain;
     this.signals            = signals;
     this.blockRepository    = blockRepository;
     this.blockStoreCache    = blockStoreCache;
     this.blockPuller        = blockPuller;
     this.blockStoreLoop     = blockStoreLoop;
     this.blockStoreManager  = blockStoreManager;
     this.blockStoreSignaled = blockStoreSignaled;
     this.nodeLifetime       = nodeLifetime;
     this.connectionManager  = connectionManager;
     this.nodeSettings       = nodeSettings;
     this.logger             = loggerFactory.CreateLogger(this.GetType().FullName);
     this.loggerFactory      = loggerFactory;
     storeSettings.Load(nodeSettings);
     this.storeSettings = storeSettings;
 }
        protected BlockStoreLoopStep(BlockStoreLoop blockStoreLoop, ILoggerFactory loggerFactory)
        {
            Guard.NotNull(blockStoreLoop, nameof(blockStoreLoop));

            this.loggerFactory  = loggerFactory;
            this.BlockStoreLoop = blockStoreLoop;
        }
        private readonly ConcurrentDictionary <uint256, uint256> blockHashesToAnnounce; // maybe replace with a task scheduler

        public BlockStoreSignaled(
            BlockStoreLoop storeLoop,
            ConcurrentChain chain,
            NodeSettings nodeArgs,
            ChainState chainState,
            IConnectionManager connection,
            INodeLifetime nodeLifetime,
            IAsyncLoopFactory asyncLoopFactory,
            IBlockRepository blockRepository,
            ILoggerFactory loggerFactory,
            string name = "BlockStore")
        {
            this.storeLoop        = storeLoop;
            this.chain            = chain;
            this.nodeArgs         = nodeArgs;
            this.chainState       = chainState;
            this.connection       = connection;
            this.nodeLifetime     = nodeLifetime;
            this.asyncLoopFactory = asyncLoopFactory;
            this.blockRepository  = blockRepository;
            this.logger           = loggerFactory.CreateLogger(GetType().FullName);
            this.name             = name;

            this.blockHashesToAnnounce = new ConcurrentDictionary <uint256, uint256>();
        }
예제 #4
0
        private readonly ConcurrentDictionary <uint256, uint256> blockHashesToAnnounce;    // maybe replace with a task scheduler

        public BlockStoreSignaled(BlockStoreLoop storeLoop, ConcurrentChain chain, NodeSettings nodeArgs,
                                  ChainState chainState, IConnectionManager connection,
                                  INodeLifetime nodeLifetime, IAsyncLoopFactory asyncLoopFactory)
        {
            this.storeLoop        = storeLoop;
            this.chain            = chain;
            this.nodeArgs         = nodeArgs;
            this.chainState       = chainState;
            this.connection       = connection;
            this.nodeLifetime     = nodeLifetime;
            this.asyncLoopFactory = asyncLoopFactory;

            this.blockHashesToAnnounce = new ConcurrentDictionary <uint256, uint256>();
        }
예제 #5
0
        public BlockStoreSignaled(
            BlockStoreLoop blockStoreLoop,
            ConcurrentChain chain,
            StoreSettings storeSettings,
            IChainState chainState,
            IConnectionManager connection,
            INodeLifetime nodeLifetime,
            ILoggerFactory loggerFactory,
            IBlockStoreCache blockStoreCache)
        {
            this.blockStoreLoop  = blockStoreLoop;
            this.chain           = chain;
            this.chainState      = chainState;
            this.connection      = connection;
            this.nodeLifetime    = nodeLifetime;
            this.logger          = loggerFactory.CreateLogger(this.GetType().FullName);
            this.storeSettings   = storeSettings;
            this.blockStoreCache = blockStoreCache;

            this.blocksToAnnounce = new AsyncQueue <ChainedHeader>();
            this.dequeueLoopTask  = this.DequeueContinuouslyAsync();
        }
 public BlockStoreSignaled(
     BlockStoreLoop blockStoreLoop,
     ConcurrentChain chain,
     StoreSettings storeSettings,
     ChainState chainState,
     IConnectionManager connection,
     INodeLifetime nodeLifetime,
     IAsyncLoopFactory asyncLoopFactory,
     IBlockRepository blockRepository,
     ILoggerFactory loggerFactory,
     string name = "BlockStore")
 {
     this.asyncLoopFactory = asyncLoopFactory;
     this.blocksToAnnounce = new ConcurrentQueue <ChainedBlock>();
     this.blockRepository  = blockRepository;
     this.blockStoreLoop   = blockStoreLoop;
     this.chain            = chain;
     this.chainState       = chainState;
     this.connection       = connection;
     this.name             = name;
     this.nodeLifetime     = nodeLifetime;
     this.logger           = loggerFactory.CreateLogger(this.GetType().FullName);
     this.storeSettings    = storeSettings;
 }
예제 #7
0
 public BlockStoreManager(ConcurrentChain chain, IConnectionManager connection, IBlockRepository blockRepository,
                          IDateTimeProvider dateTimeProvider, NodeSettings nodeArgs, ChainState chainState, BlockStoreLoop blockStoreLoop)
 {
     this.chain            = chain;
     this.connection       = connection;
     this.BlockRepository  = blockRepository;
     this.dateTimeProvider = dateTimeProvider;
     this.nodeArgs         = nodeArgs;
     this.ChainState       = chainState;
     this.BlockStoreLoop   = blockStoreLoop;
 }
예제 #8
0
 public BlockStoreManager(IBlockRepository blockRepository, ChainState chainState, BlockStoreLoop blockStoreLoop)
 {
     this.BlockRepository = blockRepository;
     this.ChainState      = chainState;
     this.BlockStoreLoop  = blockStoreLoop;
 }
예제 #9
0
        protected BlockStoreLoopStep(BlockStoreLoop blockStoreLoop)
        {
            Guard.NotNull(blockStoreLoop, "blockStoreLoop");

            this.BlockStoreLoop = blockStoreLoop;
        }