This service contains a set of blockchain indexers that use Subsquid archives and public RPCs to index Synthetix smart contracts. A fully configured docker compose file is provided to run the indexers and a Postgres database.
- Ensure you have installed Docker with Docker Compose. If you have not, follow the instructions here.
- Each network has a directory in the
indexersdirectory (ieoptimism-mainnet). Navigate to each network and copy the.env.examplefile to.env, filling in any additional settings. The example contains defaults which will work for most users, however the optionalRPC_ENDPOINTvalue can be set to a custom RPC endpoint if you would like to index directly from a node. - Run
docker compose upfrom the root directory of this repository. This will start the indexers and a Postgres database. The indexers will begin indexing the specified network and will populate the database with raw event log data.
A Postgres database will be running in a container. You can query the database using any Postgres client. The default credentials are:
Host: localhost
Port: 23798
Username: postgres
Password: $PG_PASSWORD (from .env)
Notes:
- The service will have one database for each network. For example, all Optimism Mainnet events can be found in the
optimism_mainnetdatabase. - Database tables for events follow the format
{contract_name}_event_{event_name}, for example:perps_market_proxy_event_account_created. - By default an
analyticsdatabase exists, but will not be populated with data. To populate this database with transformed data, see the transformers directory.