I've put the same filter with eth_newFilter
before and after a set of transactions. The one which is installed after transactions catched 0 events. Is it how events work? Is there any other way to catch events retrospectively except eth_getLogs
?
from ethjsonrpc import EthJsonRpc
c = EthJsonRpc('127.0.0.1', 8545)
ADDRESS = "0xdb1154368ba2645e6c090f3d1f3ddd5c8c1f8008"
params = {
"fromBlock": "0x01",
"address": ADDRESS
}
before = c.eth_newFilter(params)
for i in range(100):
tx = c.call_with_transaction(c.eth_coinbase(), ADDRESS, 'setValue(uint32)', [i])
receipt = c.eth_getTransactionReceipt(tx)
after = c.eth_newFilter(params)
print len(c.eth_getFilterLogs(before)) // 100
print len(c.eth_getFilterLogs(after)) // 0
print len(c.eth_getLogs(params)) // 100
I'm using testrpc as blockchain client.
eth_getLogs()
cannot be used? It has almost the same call signature aseth_newFilter
. – Mikko Ohtamaa Aug 16 '16 at 11:51