ApeWorx SQD plugin
ApeWorx is a modular Web3 development framework for Python programmers. Among other things, it is capable of retrieving blockchain data in bulk. The data can come from various sources, including SQD Network. The network provides free access to blocks and event logs data. On long block ranges (>1k blocks) data retrieval is orders of magnitude (>10x) faster compared to RPC-based data sources.Basic usage
In an existing ApeWorx installation, run the following to install thesubsquid plugin:
ape console as usual, e.g. with
-
Bulk block data retrieval with
chain.blocks.query:This query retrieves data on 1M blocks in about 11 minutes. -
Contract events retrieval:
This query retrieves 1.6M events emitted over 100k block in about 17 minutes.
When working with block ranges much longer than 1M blocks, the plugin may occasionally fail due to HTTP 503 errors rarely returned by the network. If you encounter this issue, split your block range into sub-1M blocks intervals and retrieve the data for each interval separately, retrying when the queries throw exceptions.
Networks support
The following networks available via plugins fromape plugins list --all are supported:
arbitrumavalanchebasebscethereumfantomoptimismpolygonpolygon-zkevm
Extra functionality
Low-level queries
The plugin supports the following low-level queries:BlockQueryContractEventQueryContractCreationQuery(only for networks with traces support)AccountTransactionQuery
BlockTransactionQuery: uses hashes instead of numbers to identify blocks. This is not supported by SQD Network.ContractMethodQuery: not used by any high-level methods at the moment. If you need it, let us know at the Squid Devs channel.