web3j icon indicating copy to clipboard operation
web3j copied to clipboard

The method eth_newBlockFilter does not exist/is not available

Open yang24201 opened this issue 7 years ago • 2 comments

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

yang24201 avatar Feb 04 '19 12:02 yang24201

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.

tjanson avatar Feb 04 '19 18:02 tjanson

我在我的项目中使用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

这个问题解决了吗?后来是怎么解决的呢?

XTAUEMC avatar Jul 23 '19 05:07 XTAUEMC