web3j icon indicating copy to clipboard operation
web3j copied to clipboard

Unable to filter event using web3j

Open Satavim opened this issue 7 years ago • 2 comments

Trying filter the event with observable as below. But getting error:Invalid response received: okhttp3.internal.http.RealResponseBody@fcc04d9.

final Event event = new Event("Notify", 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Bytes32>() {}),
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
		EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST,
		        DefaultBlockParameterName.LATEST, "1349f3e1b8d71effb47b840594ff27da7e603d17");
        filter.addSingleTopic(EventEncoder.encode(event));
        Admin web3j = Admin.build(new HttpService("ws://52.91.134.142:22000"));
       
			web3j.ethLogObservable(filter).subscribe(new Action1<Log>() {
		            @Override    
		            public void call(Log log) {
		                System.out.println("log.toString(): " +  log.toString());
		            }
})

What is the issue and how can I filter the event. ?

Satavim avatar Apr 03 '18 06:04 Satavim

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 19 '19 07:08 stale[bot]

Any updates on this ?

mithuns avatar Sep 16 '19 22:09 mithuns