INFURA / infura

Official Public Repository for INFURA
https://infura.io
381 stars 62 forks source link

eth_getLogs request not returning events #183

Open orbmis opened 5 years ago

orbmis commented 5 years ago

I'm trying to get all 'transfer' events from an erc20 token contract.

I submitted the following request payload to the Infura API:

{
  "jsonrpc": "2.0",
  "method": "eth_getLogs",
  "params": [{
      "address": [ "0xc1230B6E68aBe69ae5492bdF60eAba6Ab2e8049d" ]
  }],
  "id": 1
}

Initially it returned the dozen or so transfer events that had been fired that contract. However, all subsequent requests return an empty set:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": []
}

Why is it that it worked the first few times, and then suddenly ceased to work? Is there something else I need to do? Do I need to throttle my requests to once every minute / ten minutes / hour?

orbmis commented 5 years ago

Update: It seems that for now if I specify the "fromBlock" parameter then it seems to be working.

unboxedtype commented 4 years ago

I observe the same behavior. By specifying the address field alone, I did not receive any log entries, but after adding "fromBlock":"earliest" parameter I receive all expected entries.

Looks like a bug?