예제 #1
0
        public BlockStoreFeature(
            Network network,
            ConcurrentChain chain,
            IConnectionManager connectionManager,
            Signals.Signals signals,
            BlockStoreSignaled blockStoreSignaled,
            ILoggerFactory loggerFactory,
            StoreSettings storeSettings,
            IChainState chainState,
            IBlockStoreQueue blockStoreQueue,
            INodeStats nodeStats,
            IConsensusManager consensusManager,
            ICheckpoints checkpoints)
        {
            this.network            = network;
            this.chain              = chain;
            this.blockStoreQueue    = blockStoreQueue;
            this.signals            = signals;
            this.blockStoreSignaled = blockStoreSignaled;
            this.connectionManager  = connectionManager;
            this.logger             = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory      = loggerFactory;
            this.storeSettings      = storeSettings;
            this.chainState         = chainState;
            this.consensusManager   = consensusManager;
            this.checkpoints        = checkpoints;

            nodeStats.RegisterStats(this.AddInlineStats, StatsType.Inline, 900);
        }
        public BlockStoreFeature(
            Network network,
            ChainIndexer chainIndexer,
            IConnectionManager connectionManager,
            BlockStoreSignaled blockStoreSignaled,
            ILoggerFactory loggerFactory,
            StoreSettings storeSettings,
            IChainState chainState,
            IBlockStoreQueue blockStoreQueue,
            INodeStats nodeStats,
            IConsensusManager consensusManager,
            ICheckpoints checkpoints,
            IPrunedBlockRepository prunedBlockRepository,
            AddressIndexer addressIndexer)
        {
            this.network               = network;
            this.chainIndexer          = chainIndexer;
            this.blockStoreQueue       = blockStoreQueue;
            this.blockStoreSignaled    = blockStoreSignaled;
            this.connectionManager     = connectionManager;
            this.logger                = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory         = loggerFactory;
            this.storeSettings         = storeSettings;
            this.chainState            = chainState;
            this.consensusManager      = consensusManager;
            this.checkpoints           = checkpoints;
            this.prunedBlockRepository = prunedBlockRepository;
            this.addressIndexer        = addressIndexer;

            nodeStats.RegisterStats(this.AddInlineStats, StatsType.Inline, 900);
        }
예제 #3
0
        public BlockExplorerFeature(
            ChainIndexer chain,
            IConnectionManager connectionManager,
            //Signals signals,
            BlockStoreSignaled blockStoreSignaled,
            ILoggerFactory loggerFactory,
            StoreSettings storeSettings,
            IChainState chainState,
            IBlockStoreQueue blockStoreQueue,
            INodeStats nodeStats,
            IConsensusManager consensusManager)
        {
            this.chain           = chain;
            this.blockStoreQueue = blockStoreQueue;
            //this.signals = signals;
            this.blockStoreSignaled = blockStoreSignaled;
            this.connectionManager  = connectionManager;
            this.logger             = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory      = loggerFactory;
            this.storeSettings      = storeSettings;
            this.chainState         = chainState;
            this.consensusManager   = consensusManager;

            //nodeStats.RegisterStats(this.AddInlineStats, StatsType.Inline, 900);
        }
예제 #4
0
        public BlockStoreSignaled(
            IBlockStoreQueue blockStoreQueue,
            StoreSettings storeSettings,
            IChainState chainState,
            IConnectionManager connection,
            INodeLifetime nodeLifetime,
            ILoggerFactory loggerFactory,
            IInitialBlockDownloadState initialBlockDownloadState,
            ISignals signals,
            IAsyncProvider asyncProvider)
        {
            this.blockStoreQueue           = blockStoreQueue;
            this.chainState                = chainState;
            this.connection                = connection;
            this.nodeLifetime              = nodeLifetime;
            this.logger                    = loggerFactory.CreateLogger(GetType().FullName);
            this.storeSettings             = storeSettings;
            this.initialBlockDownloadState = initialBlockDownloadState;
            this.signals                   = signals;
            this.asyncProvider             = asyncProvider;

            this.blocksToAnnounce = asyncProvider.CreateAsyncQueue <ChainedHeader>();
            this.dequeueLoopTask  = DequeueContinuouslyAsync();

            this.asyncProvider.RegisterTask($"{nameof(BlockStoreSignaled)}.{nameof(this.dequeueLoopTask)}",
                                            this.dequeueLoopTask);
        }
 public ProvenHeadersBlockStoreBehavior(Network network, ChainIndexer chainIndexer, IChainState chainState,
                                        ILoggerFactory loggerFactory, IConsensusManager consensusManager, ICheckpoints checkpoints,
                                        IBlockStoreQueue blockStoreQueue)
     : base(chainIndexer, chainState, loggerFactory, consensusManager, blockStoreQueue)
 {
     this.network     = Guard.NotNull(network, nameof(network));
     this.checkpoints = Guard.NotNull(checkpoints, nameof(checkpoints));
 }
예제 #6
0
 public ProvenHeadersBlockStoreSignaled(
     Network network,
     IBlockStoreQueue blockStoreQueue,
     StoreSettings storeSettings,
     IChainState chainState,
     IConnectionManager connection,
     INodeLifetime nodeLifetime,
     ILoggerFactory loggerFactory,
     IInitialBlockDownloadState initialBlockDownloadState,
     IProvenBlockHeaderStore provenBlockHeaderStore)
     : base(blockStoreQueue, storeSettings, chainState, connection, nodeLifetime, loggerFactory, initialBlockDownloadState)
 {
     this.network = Guard.NotNull(network, nameof(network));
     this.provenBlockHeaderStore = Guard.NotNull(provenBlockHeaderStore, nameof(provenBlockHeaderStore));
 }
        public BlockStoreBehavior(ChainIndexer chainIndexer, IChainState chainState, ILoggerFactory loggerFactory, IConsensusManager consensusManager, IBlockStoreQueue blockStoreQueue)
        {
            Guard.NotNull(chainIndexer, nameof(chainIndexer));
            Guard.NotNull(loggerFactory, nameof(loggerFactory));
            Guard.NotNull(consensusManager, nameof(consensusManager));
            Guard.NotNull(blockStoreQueue, nameof(blockStoreQueue));

            this.ChainIndexer     = chainIndexer;
            this.chainState       = chainState;
            this.logger           = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory    = loggerFactory;
            this.consensusManager = consensusManager;
            this.blockStoreQueue  = blockStoreQueue;

            this.CanRespondToGetDataPayload = true;

            this.PreferHeaders      = false;
            this.preferHeaderAndIDs = false;
        }
예제 #8
0
        public BlockStoreSignaled(
            IBlockStoreQueue blockStoreQueue,
            StoreSettings storeSettings,
            IChainState chainState,
            IConnectionManager connection,
            INodeLifetime nodeLifetime,
            ILoggerFactory loggerFactory,
            IInitialBlockDownloadState initialBlockDownloadState)
        {
            this.blockStoreQueue           = blockStoreQueue;
            this.chainState                = chainState;
            this.connection                = connection;
            this.nodeLifetime              = nodeLifetime;
            this.logger                    = loggerFactory.CreateLogger(this.GetType().FullName);
            this.storeSettings             = storeSettings;
            this.initialBlockDownloadState = initialBlockDownloadState;

            this.blocksToAnnounce = new AsyncQueue <ChainedHeader>();
            this.dequeueLoopTask  = this.DequeueContinuouslyAsync();
        }
예제 #9
0
        public PoAFeature(
            IFederationManager federationManager,
            PayloadProvider payloadProvider,
            IConnectionManager connectionManager,
            ChainIndexer chainIndexer,
            IInitialBlockDownloadState initialBlockDownloadState,
            IConsensusManager consensusManager,
            IPeerBanning peerBanning,
            ILoggerFactory loggerFactory,
            VotingManager votingManager,
            IFederationHistory federationHistory,
            Network network,
            IWhitelistedHashesRepository whitelistedHashesRepository,
            IIdleFederationMembersKicker idleFederationMembersKicker,
            IChainState chainState,
            IBlockStoreQueue blockStoreQueue,
            NodeSettings nodeSettings,
            ReconstructFederationService reconstructFederationService,
            IPoAMiner miner = null
            )
        {
            this.federationManager         = federationManager;
            this.connectionManager         = connectionManager;
            this.chainIndexer              = chainIndexer;
            this.initialBlockDownloadState = initialBlockDownloadState;
            this.consensusManager          = consensusManager;
            this.peerBanning                  = peerBanning;
            this.loggerFactory                = loggerFactory;
            this.miner                        = miner;
            this.votingManager                = votingManager;
            this.federationHistory            = federationHistory;
            this.whitelistedHashesRepository  = whitelistedHashesRepository;
            this.network                      = network;
            this.idleFederationMembersKicker  = idleFederationMembersKicker;
            this.chainState                   = chainState;
            this.blockStoreQueue              = blockStoreQueue;
            this.nodeSettings                 = nodeSettings;
            this.reconstructFederationService = reconstructFederationService;

            payloadProvider.DiscoverPayloads(this.GetType().Assembly);
        }
예제 #10
0
 public PoABlockStoreBehavior(ChainIndexer chainIndexer, IChainState chainState, ILoggerFactory loggerFactory, IConsensusManager consensusManager, IBlockStoreQueue blockStoreQueue)
     : base(chainIndexer, chainState, loggerFactory, consensusManager, blockStoreQueue)
 {
 }