Ejemplo n.º 1
0
        public BlockchainProcessor(
            IBlockTree blockTree,
            IBlockProcessor blockProcessor,
            IBlockDataRecoveryStep recoveryStep,
            ILogManager logManager,
            bool storeReceiptsByDefault,
            bool storeTracesByDefault)
        {
            _logger                 = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _blockTree              = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockProcessor         = blockProcessor ?? throw new ArgumentNullException(nameof(blockProcessor));
            _recoveryStep           = recoveryStep ?? throw new ArgumentNullException(nameof(recoveryStep));
            _storeReceiptsByDefault = storeReceiptsByDefault;
            _storeTracesByDefault   = storeTracesByDefault;

            _blockTree.NewBestSuggestedBlock += OnNewBestBlock;
            _stats = new ProcessingStats(_logger);
        }
Ejemplo n.º 2
0
        public BlockchainProcessor(
            IBlockTree blockTree,
            ISealEngine sealEngine,
            ITransactionStore transactionStore,
            IDifficultyCalculator difficultyCalculator,
            IBlockProcessor blockProcessor,
            IEthereumSigner signer,
            ILogManager logManager, IPerfService perfService)
        {
            _logger    = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _blockTree = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockTree.NewBestSuggestedBlock += OnNewBestBlock;

            _transactionStore     = transactionStore ?? throw new ArgumentNullException(nameof(transactionStore));
            _difficultyCalculator = difficultyCalculator ?? throw new ArgumentNullException(nameof(difficultyCalculator));
            _sealEngine           = sealEngine ?? throw new ArgumentNullException(nameof(sealEngine));
            _blockProcessor       = blockProcessor ?? throw new ArgumentNullException(nameof(blockProcessor));
            _signer      = signer ?? throw new ArgumentNullException(nameof(signer));
            _perfService = perfService;
            _stats       = new ProcessingStats(_logger);
        }