SpringBoot区块链之以太坊区块高度扫描(简洁版)
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;
}
```
效果图

码云地址: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
评论