subsquid / ape-subsquid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick Start

This plugin allows to use subsquid data lake as a backend for ApeWorX query engine. Full documentation

Dependencies

Installation

via ape plugins

ape plugins install "ape-subsquid@git+https://github.com/subsquid/ape-subsquid.git@main"

via pip locally

You can clone the repository and install the plugin locally:

git clone https://github.com/subsquid/ape-subsquid.git
pip install ./ape-subsquid

Quick Usage

If we want to be sure that subsquid engine is used then we have to specify it explicitly. Otherwise other query engines might be preferred depending on their estimated time.

The following queries can be executed via ApeWorX interactive console. Use ape console --network ethereum:mainnet:geth to run a console session.

# BlockQuery
chain.blocks.query("*", start_block=18_000_000, stop_block=18_000_010, engine_to_use='subsquid')

# ContractEventQuery
contract = Contract('0xdac17f958d2ee523a2206206994597c13d831ec7', abi='<USDT_ABI>')
contract.Transfer.query('*', start_block=18_000_000, stop_block=18_000_100, engine_to_use='subsquid')

Supported queries are: BlockQuery, AccountTransactionQuery, ContractCreationQuery, ContractEventQuery. More info about querying data can be found in the corresponding guide.

Development

Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.

About

License:Apache License 2.0


Languages

Language:Python 100.0%