SpringBoot区块链之以太坊区块高度扫描(简洁版)

2020-12-13 15:28

阅读:383

list = new ArrayList(); EthBlockNumber blockNumber = web3j.ethBlockNumber().send(); long blockHeight = blockNumber.getBlockNumber().longValue(); EthBlock block = web3j.ethGetBlockByNumber(new DefaultBlockParameterNumber(blockHeight), true).send(); block.getBlock().getTransactions().stream().forEach(transactionResult -> { EthBlock.TransactionObject transactionObject = (EthBlock.TransactionObject) transactionResult; Transaction transaction = transactionObject.get(); list.add(transaction); }); return list; } ``` 效果图 ![file](https://img2018.cnblogs.com/blog/1602984/201909/1602984-20190924234222330-1285726201.jpg) 码云地址:https://gitee.com/MyXiaoXiaoBin/learning-to-share/tree/master/eth-demo ###### 码农自学交流小群:260532022,欢迎大家的加入,分享学习是一件开心事

SpringBoot区块链之以太坊区块高度扫描(简洁版)

标签:mil   math   start   class   response   override   current   inter   pac   

原文地址:https://www.cnblogs.com/hy-xiaobin/p/11581946.html


评论


亲,登录后才可以留言!