The method eth_newBlockFilter does not exist/is not available
I'm using infura with web3j in my project. I want to subscribe the transaction and my code like this:
web3j.transactionFlowable().subscribe(tx -> {
log.info("receive new transaction: " + tx.getTo());
}, e -> {
log.error("monitor eth transaction error: " + e.getMessage());
});
An error occurs saying
Invalid request: The method eth_newBlockFilter does not exist/is not available
How can I subscribe the transaction? Anything wrong with my code ?
My web3j version is 4.1.1
The docs say “filters are not supported on Infura”, but it’s not Web3J specific — Infura just doesn’t provide the filter methods. See issue in Infura repo, and generally look up “Infura filter”. Not sure if there’s good ways around it.
我在我的项目中使用infura和web3j。我想订阅事务和我的代码,如下所示:
web3j.transactionFlowable().subscribe(tx -> { log.info("receive new transaction: " + tx.getTo()); }, e -> { log.error("monitor eth transaction error: " + e.getMessage()); });发生错误说
Invalid request: The method eth_newBlockFilter does not exist/is not available我该如何订阅交易?我的代码有什么问题吗?
我的web3j版本是4.1.1
这个问题解决了吗?后来是怎么解决的呢?