I can´t find where is the Web3j ethLogObservable method. I can´t find in GitHub repo
Asked
Active
Viewed 972 times
2 Answers
4
From its version 4.0, web3j started using RxJava 2.0 FLowable instead of RxJava 2.0 Obsersable to handle events processing, notably because Flowable are much more efficient during high load using a backpressure mechanism.
The new function to catch events is now the following:
EthFilter filter = new EthFilter(
DefaultBlockParameterName.EARLIEST,
DefaultBlockParameterName.LATEST,
contractAddress);
web3.ethLogFlowable(filter).subscribe(event -> {
log.info("event = {}", event);
});
You can find more info here
EDIT: fixed URL
Greg Jeanmart
- 7,207
- 2
- 19
- 35
0
I can't run ethLogFlowable...
The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling
ronaldoguedess
- 11
- 4
subscribemethod, there's an overload for it that plus theonNextblock, acceptsonErrorblock too. You should pass a function to this argument so further errors will be handled. – Ahmad Reza Enshaee Apr 02 '23 at 05:23