예제 #1
0
        public EthBlockCrawler(Logger logger, string[] addresses, uint blockConfirmations, EthAPI api)
        {
            this.addressesToWatch = addresses;
            this.web3             = api.GetWeb3Client();
            this.logger           = logger;

            processor = web3.Processing.Blocks.CreateBlockProcessor(steps =>
            {
                steps.TransactionStep.SetMatchCriteria(t => t.Transaction.IsToAny(addressesToWatch));
                steps.TransactionReceiptStep.AddSynchronousProcessorHandler(tx => AddTxrVO(tx));
            },
                                                                    blockConfirmations // block confirmations count
                                                                    );
            cancellationToken = new CancellationToken();
        }
예제 #2
0
 public BlockIterator(EthAPI api)
 {
     this.currentBlock       = api.GetBlockHeight();
     this.currentTransaction = 0;
 }
예제 #3
0
        public EvmBlockCrawler(Logger logger, string[] addresses, uint blockConfirmations, EthAPI api,
                               Func <string, Address> encodeHandler, Func <Nethereum.RPC.Eth.DTOs.Transaction, Address> extractor, string platform)
        {
            this.addressesToWatch = addresses;
            this.web3             = api.GetWeb3Client();
            this.logger           = logger;
            this.encodeHandler    = encodeHandler;
            this.platform         = platform;
            this.addressExtractor = extractor;

            processor = web3.Processing.Blocks.CreateBlockProcessor(steps =>
            {
                steps.TransactionStep.SetMatchCriteria(t => t.Transaction.IsToAny(addressesToWatch));
                steps.TransactionReceiptStep.AddSynchronousProcessorHandler(tx => AddTxrVO(tx));
            },
                                                                    blockConfirmations // block confirmations count
                                                                    );
            cancellationToken = new CancellationToken();
        }