It seems to me eth_getLogs is much simpler than eth_newFilter + eth_getFilterLogs.
eth_getLogs has no need for installation, got same parameters, catches events retrospectively. What are use cases of filters at all?
As in my previous question:
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
idis stored? what if I'm talking to infura which is cluster of nodes and my id could be lost? – rstormsf May 17 '18 at 23:19- eth_coinbas
- eth_sign
- eth_sendTransaction
- eth_newFilter
- eth_newBlockFilter
- eth_newPendingTransactionFilter
- eth_uninstallFilter
- eth_getFilterChanges
- eth_getFilterLogs
- db_putString
- db_getString
- db_putHex
- db_getHex
– Bilgin Ibryam Jun 02 '18 at 18:03