Пример #1
0
 public BlockchainProcessor(
     IBlockchainProcessingStrategy strategy,
     ILog log = null)
 {
     this._strategy = strategy;
     _log           = new BlockchainProcessorInstrumentation(log);
 }
Пример #2
0
 public BlockchainProcessor(
     IBlockchainProcessingStrategy strategy,
     IBlockProcessor blockProcessor
     )
 {
     this._strategy       = strategy;
     this._blockProcessor = blockProcessor;
 }
        public IBlockProcessor Create(
            IWeb3Wrapper web3, IVmStackErrorChecker vmStackErrorChecker,
            IBlockchainProcessingStrategy strategy, bool postVm = false, bool processTransactionsInParallel = true)
        {
            var transactionLogProcessor = new TransactionLogProcessor(
                strategy.Filters?.TransactionLogFilters,
                strategy.TransactionLogHandler);

            var contractTransactionProcessor = new ContractTransactionProcessor(
                web3, vmStackErrorChecker, strategy.ContractHandler,
                strategy.TransactionHandler, strategy.TransactionVmStackHandler);

            var contractCreationTransactionProcessor = new ContractCreationTransactionProcessor(
                web3, strategy.ContractHandler,
                strategy.TransactionHandler);

            var valueTransactionProcessor = new ValueTransactionProcessor(
                strategy.TransactionHandler);

            var transactionProcessor = new TransactionProcessor(
                web3,
                contractTransactionProcessor,
                valueTransactionProcessor,
                contractCreationTransactionProcessor,
                transactionLogProcessor,
                strategy.Filters?.TransactionFilters,
                strategy.Filters?.TransactionReceiptFilters,
                strategy.Filters?.TransactionAndReceiptFilters);

            if (postVm)
            {
                return new BlockVmPostProcessor(
                    web3, strategy.BlockHandler, transactionProcessor)
                       {
                           ProcessTransactionsInParallel = processTransactionsInParallel
                       }
            }
            ;

            transactionProcessor.ContractTransactionProcessor.EnabledVmProcessing = false;
            return(new BlockProcessor(
                       web3, strategy.BlockHandler, transactionProcessor, strategy.Filters?.BlockFilters)
            {
                ProcessTransactionsInParallel = processTransactionsInParallel
            });
        }
    }
 public BlockchainProcessor(
     IBlockchainProcessingStrategy strategy)
 {
     this._strategy = strategy;
 }
 public IBlockProcessor Create(IWeb3Wrapper web3,
                               IBlockchainProcessingStrategy strategy, bool postVm = false, bool processTransactionsInParallel = true)
 {
     return(Create(web3, new VmStackErrorCheckerWrapper(), strategy, postVm, processTransactionsInParallel));
 }