eth_getLogs
Returns an array of all logs matching a given filter object.
Parameters
Filter Object
blockhash
[optional] With the addition of EIP-234,blockHash
restricts the logs returned to the single block with the 32-byte hashblockHash
. UsingblockHash
is equivalent tofromBlock
=toBlock
= the block number with hashblockHash
. IfblockHash
is present in in the filter criteria, then neitherfromBlock
nortoBlock
are allowed.topics
[optional] Array of 32 Bytes DATA topics. Topics are order-dependent.fromBlock
[optional, default:latest
] a hexadecimal block number, or the stringlatest
,earliest
orpending
, See the default block parameter.toBlock
[optional, default:latest
] a hexadecimal block number, or the stringlatest
,earliest
orpending
, See the default block parameter.address
[optional] a string representing the address (20 bytes) to check for balance
Request
Response
In order to prevent the query from consuming too much resources, the eth_getLogs query single result set is limited to 10,000, and the query duration should not exceed 10s.
If the above abnormal situation occurs, it is recommended to do the following:
Use fromBlock and toBlock to limit your query to a smaller range of blocks.
If querying for commonly used
topics
, consider limiting to a single Smart Contractaddress
as well.For frequent pulls, the best practice is to use the Event Hook provided by SolarPath to receive logs.
Last updated