Beispiel #1
0
 public BlockProgressService(
     IBlockchainProxyService web3,
     ulong defaultStartingBlockNumber,
     IBlockProgressRepository blockProgressRepository,
     uint minimumBlockConfirmations = 0) :
     base(
         defaultStartingBlockNumber,
         blockProgressRepository)
 {
     _web3 = web3;
     MinimumBlockConfirmations = minimumBlockConfirmations;
 }
Beispiel #2
0
 public ElasticEventIndexingProcessor(
     IBlockchainProxyService blockchainProxyService,
     IElasticSearchService searchService,
     IEventFunctionProcessor functionProcessor,
     Func <ulong, ulong?, IBlockProgressService> blockProgressServiceCallBack = null,
     uint maxBlocksPerBatch = 2,
     IEnumerable <NewFilterInput> filters = null,
     uint minimumBlockConfirmations       = 0) :
     base(blockchainProxyService, searchService, functionProcessor, blockProgressServiceCallBack, maxBlocksPerBatch, filters, minimumBlockConfirmations)
 {
     this._elasticSearchService = searchService;
 }
Beispiel #3
0
        public static IBlockProcessor Create(
            IBlockchainProxyService web3, IVmStackErrorChecker vmStackErrorChecker,
            HandlerContainer handlers, FilterContainer filters = null, bool postVm = false, bool processTransactionsInParallel = true)
        {
            var transactionLogProcessor = new TransactionLogProcessor(
                filters?.TransactionLogFilters,
                handlers.TransactionLogHandler);

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

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

            var valueTransactionProcessor = new ValueTransactionProcessor(
                handlers.TransactionHandler);

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

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

            transactionProcessor.ContractTransactionProcessor.EnabledVmProcessing = false;
            return(new BlockProcessor(
                       web3, handlers.BlockHandler, transactionProcessor, filters?.BlockFilters)
            {
                ProcessTransactionsInParallel = processTransactionsInParallel
            });
        }
    }
Beispiel #4
0
 public AzureEventIndexingProcessor(
     IBlockchainProxyService blockchainProxyService,
     IAzureEventSearchService searchService,
     Func <ulong, ulong?, IBlockProgressService> blockProgressServiceCallBack = null,
     uint maxBlocksPerBatch = 2,
     IEnumerable <NewFilterInput> filters = null,
     uint minimumBlockConfirmations       = 0)
 {
     SearchService          = searchService;
     BlockchainProxyService = blockchainProxyService;
     MaxBlocksPerBatch      = maxBlocksPerBatch;
     _filters = filters;
     MinimumBlockConfirmations     = minimumBlockConfirmations;
     _blockProgressServiceCallBack = blockProgressServiceCallBack;
     _logProcessors = new List <ILogProcessor>();
     _indexers      = new List <IEventIndexer>();
 }
Beispiel #5
0
 public EventIndexingProcessor(
     IBlockchainProxyService blockchainProxyService,
     ISearchService searchService,
     IEventFunctionProcessor functionProcessor,
     Func <ulong, ulong?, IBlockProgressService> blockProgressServiceCallBack = null,
     uint maxBlocksPerBatch = 2,
     IEnumerable <NewFilterInput> filters = null,
     uint minimumBlockConfirmations       = 0)
 {
     SearchService          = searchService;
     BlockchainProxyService = blockchainProxyService;
     MaxBlocksPerBatch      = maxBlocksPerBatch;
     Filters = filters;
     MinimumBlockConfirmations    = minimumBlockConfirmations;
     BlockProgressServiceCallBack = blockProgressServiceCallBack;
     LogProcessors     = new List <ILogProcessor>();
     _indexers         = new List <IIndexer>();
     FunctionProcessor = functionProcessor ?? new EventFunctionProcessor(BlockchainProxyService);
 }
Beispiel #6
0
 public EventFunctionProcessor(
     IBlockchainProxyService blockchainProxyService)
 {
     _blockchainProxyService = blockchainProxyService;
     _eventToHandlerMapping  = new Dictionary <Type, List <ITransactionHandler> >();
 }
Beispiel #7
0
 public static IBlockProcessor Create(IBlockchainProxyService web3,
                                      HandlerContainer handlers, FilterContainer filters = null, bool postVm = false, bool processTransactionsInParallel = true)
 {
     return(Create(web3, new VmStackErrorCheckerWrapper(), handlers, filters, postVm, processTransactionsInParallel));
 }