public ConsensusStats(
            CoinViewStack stack,
            CoinView coinView,
            ConsensusLoop consensusLoop,
            ChainState chainState,
            ConcurrentChain chain,
            IConnectionManager connectionManager,
            ILoggerFactory loggerFactory)
        {
            stack        = new CoinViewStack(coinView);
            this.cache   = stack.Find <CachedCoinView>();
            this.dbreeze = stack.Find <DBreezeCoinView>();
            this.bottom  = stack.Bottom;

            this.consensusLoop   = consensusLoop;
            this.lookaheadPuller = this.consensusLoop.Puller as LookaheadBlockPuller;

            this.lastSnapshot      = consensusLoop.Validator.PerformanceCounter.Snapshot();
            this.lastSnapshot2     = this.dbreeze?.PerformanceCounter.Snapshot();
            this.lastSnapshot3     = this.cache?.PerformanceCounter.Snapshot();
            this.chainState        = chainState;
            this.chain             = chain;
            this.connectionManager = connectionManager;
            this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
        }
Exemplo n.º 2
0
        public ConsensusFeature(
            DBreezeCoinView dBreezeCoinView,
            Network network,
            LookaheadBlockPuller blockPuller,
            CoinView coinView,
            ChainState chainState,
            IConnectionManager connectionManager,
            Signals.Signals signals,
            ConsensusLoop consensusLoop,
            NodeDeployments nodeDeployments,
            ILoggerFactory loggerFactory,
            ConsensusStats consensusStats,
            ConsensusSettings consensusSettings,
            IRuleRegistration ruleRegistration,
            IConsensusRules consensusRules,
            StakeChainStore stakeChain = null)
        {
            this.dBreezeCoinView   = dBreezeCoinView;
            this.blockPuller       = blockPuller;
            this.coinView          = coinView;
            this.chainState        = chainState;
            this.connectionManager = connectionManager;
            this.signals           = signals;
            this.network           = network;
            this.consensusLoop     = consensusLoop;
            this.nodeDeployments   = nodeDeployments;
            this.stakeChain        = stakeChain;
            this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory     = loggerFactory;
            this.consensusStats    = consensusStats;
            this.ruleRegistration  = ruleRegistration;
            this.consensusRules    = consensusRules;

            this.chainState.MaxReorgLength = this.network.Consensus.Option <PowConsensusOptions>().MaxReorgLength;
        }
Exemplo n.º 3
0
 public ConsensusController(ILoggerFactory loggerFactory, ChainState chainState = null,
                            ConsensusLoop consensusLoop = null, ConcurrentChain chain = null)
     : base(chainState: chainState, chain: chain)
 {
     this.logger        = loggerFactory.CreateLogger(this.GetType().FullName);
     this.ConsensusLoop = consensusLoop;
 }
 public ConsensusFeature(
     DBreezeCoinView dBreezeCoinView,
     Network network,
     PowConsensusValidator consensusValidator,
     ConcurrentChain chain,
     LookaheadBlockPuller blockPuller,
     CoinView coinView,
     ChainState chainState,
     IConnectionManager connectionManager,
     INodeLifetime nodeLifetime,
     Signals.Signals signals,
     ConsensusLoop consensusLoop,
     NodeSettings nodeSettings,
     NodeDeployments nodeDeployments,
     ILoggerFactory loggerFactory,
     StakeChainStore stakeChain = null)
 {
     this.dBreezeCoinView    = dBreezeCoinView;
     this.consensusValidator = consensusValidator;
     this.chain             = chain;
     this.blockPuller       = blockPuller;
     this.coinView          = coinView;
     this.chainState        = chainState;
     this.connectionManager = connectionManager;
     this.nodeLifetime      = nodeLifetime;
     this.signals           = signals;
     this.network           = network;
     this.consensusLoop     = consensusLoop;
     this.nodeSettings      = nodeSettings;
     this.nodeDeployments   = nodeDeployments;
     this.stakeChain        = stakeChain;
     this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
     this.loggerFactory     = loggerFactory;
 }
 public ConsensusManager(ConsensusLoop consensusLoop = null, IDateTimeProvider dateTimeProvider = null, NodeSettings nodeSettings = null, Network network = null,
                         PowConsensusValidator consensusValidator = null)
 {
     this.ConsensusLoop      = consensusLoop;
     this.DateTimeProvider   = dateTimeProvider;
     this.NodeSettings       = nodeSettings;
     this.Network            = network;
     this.ConsensusValidator = consensusValidator;
 }
Exemplo n.º 6
0
 public ConsensusManager(ICheckpoints checkpoints, ConsensusLoop consensusLoop = null, IDateTimeProvider dateTimeProvider = null, NodeSettings nodeSettings = null, Network network = null,
                         PowConsensusValidator consensusValidator = null, ChainState chainState = null)
 {
     this.ConsensusLoop      = consensusLoop;
     this.DateTimeProvider   = dateTimeProvider;
     this.NodeSettings       = nodeSettings;
     this.Network            = network;
     this.ConsensusValidator = consensusValidator;
     this.ChainState         = chainState;
     this.checkpoints        = checkpoints;
 }
        public ConsensusFeature(
            IAsyncLoopFactory asyncLoopFactory,
            DBreezeCoinView dBreezeCoinView,
            Network network,
            PowConsensusValidator consensusValidator,
            ConcurrentChain chain,
            LookaheadBlockPuller blockPuller,
            CoinView coinView,
            ChainState chainState,
            IConnectionManager connectionManager,
            INodeLifetime nodeLifetime,
            Signals.Signals signals,
            ConsensusLoop consensusLoop,
            NodeSettings nodeSettings,
            NodeDeployments nodeDeployments,
            ILoggerFactory loggerFactory,
            IDateTimeProvider dateTimeProvider,
            ConsensusManager consensusManager,
            ConsensusStats consensusStats,
            ConsensusSettings consensusSettings,
            StakeChainStore stakeChain = null)
        {
            this.dBreezeCoinView    = dBreezeCoinView;
            this.consensusValidator = consensusValidator;
            this.chain             = chain;
            this.blockPuller       = blockPuller;
            this.coinView          = coinView;
            this.chainState        = chainState;
            this.connectionManager = connectionManager;
            this.nodeLifetime      = nodeLifetime;
            this.signals           = signals;
            this.network           = network;
            this.consensusLoop     = consensusLoop;
            this.nodeSettings      = nodeSettings;
            this.nodeDeployments   = nodeDeployments;
            this.stakeChain        = stakeChain;
            this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
            this.loggerFactory     = loggerFactory;
            this.dateTimeProvider  = dateTimeProvider;
            this.consensusManager  = consensusManager;
            this.consensusStats    = consensusStats;
            this.consensusSettings = consensusSettings;

            this.chainState.MaxReorgLength = this.network.Consensus.Option <PowConsensusOptions>().MaxReorgLength;
        }