joe
December 9, 2020, 12:16am
1
Hi,
I can’t seem to get any event logs from the testnet. Here’s my command:
curl https://ropsten.infura.io/v3/<projID> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"address": "0x3b994b48922450e6cf0f415bdf337d1df7183ffa"}],"id":1}'
That address clearly has generated events, e.g. here: https://ropsten.etherscan.io/tx/0x7a7e61aa2d924dd9475795db530810cec1a1aba4f9fa24965eb745977529242c#eventlog
But the above call returns empty. Please help.
Lily
December 9, 2020, 3:39pm
2
Hi there, Joe.
Does your projID hold a value right now?
Can you help to share the full response snippet with us?
joe
December 9, 2020, 4:02pm
3
Hi, yes, the projID is my ProjectID. Here’s the full response:
{"jsonrpc":"2.0","id":1,"result":[]}
Lily
December 9, 2020, 5:06pm
4
Hi Joe.
Would you try using different params, such as fromBlock and toBlock ?
Or using topic with address ?
[https://infura.io/docs/ethereum/json-rpc/eth-getLogs ](http://Check out the documentations for getLogs)
joe
December 10, 2020, 2:27pm
5
Thanks. It looks like the “fromBlock” and “toBlock” are needed, as opposed to optional like stated in the doc.
Lily
December 10, 2020, 3:56pm
6
Hi Joe. I’m glad you got it to work.
These params acts as filter objects to help narrow down the response.
Different combinations of them can bring different results.