This uses SubQuery to index all transfer events and messages on the Agoric chain.
Explorer URL: https://explorer.subquery.network/subquery/agoric-labs/agoric-mainnet-v2
API Endpoint: https://api.subquery.network/sq/agoric-labs/agoric-mainnet-v2
The indexer query service is used by the inter dashboard and its code includes various examples of query usage.
The indexer uses state change events to index most of the data also available from vstorage:
- Metadata about the indexer. e.g. lastProcessedHeight
- PSM metrics (minted pool balances, governance parameters)
- Active vault data (count, total balance by collateral type)
- Daily metrics (vault metrics, collateral, debt, oracle prices)
- Reserve metrics (shortfall balances, allocation values)
- Wallets
Note: as of June 13th, 2024, this indexer does not include transactions, account balances, or raw block data.
Sources of latency:
- Waiting for new blocks. RPC itself can be delayed.
- Processing time of blocks.
- DB delay. OnFinality has some caching which batches DB operations.
-
Start up an A3P instance
docker run -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:latest
Or with a proposal that you've built in a3p-integration,
docker run -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:use-fast-usdc
-
Confirm the data is visible with vstorage viewer
-
Start up the Indexer After the A3P instance is up and running, initiate the indexer with the following command:
AGORIC_NET=docker yarn dev
-
Access the GraphQL playground Once the indexer is operational, access the GraphQL interface to query indexed data:
- Open a web browser and navigate to http://localhost:3000.
- Use the provided interface to write and execute your GraphQL queries.
Make some transactions.
cd multichain-testing && yarn
make setup # if you've never ran starship
docker pull ghcr.io/agoric/agoric-sdk:dev # to make sure you have the latest IBC hooks changes
make stop
make start FILE=config.fusdc.yaml # wait ~7 mins
yarn test:fast-usdc test/fast-usdc/fast-usdc.test.ts
View published.fastUsdc
Start a fresh indexer:
scripts/restart-dev.sh
Play at http://localhost:3000/
Cleanup…
cd multichain-testing
make stop
If you encounter issues with the indexer:
-
Check the logs of indexer for any errors or warnings that might indicate what is wrong. Use the command:
docker logs -f agoric-subql-subquery-node-1
-
If restarting the indexer is necessary, first delete the
.data
folder in the root directory to avoid conflicts or corruption of data:rm -rf .data
When a PR is created, tests associated with indexing are automatically triggered in the following workflows:
.github/workflows/pr.yaml
.github/workflows/liquidation.yaml
.github/workflows/vaults-and-reserve-metrics-testing.yml
These tests are scheduled to run daily and can also be manually triggered at any time from the GitHub Actions tab on GitHub.