Aerograph is a subgraph built for indexing and querying data from a specific smart contract or protocol using The Graph. It provides a GraphQL API to fetch structured, real-time data efficiently.
The Graph is a decentralized protocol for indexing and querying blockchain data using GraphQL. Subgraphs define how data is ingested, stored, and served from Ethereum and other networks.
aerograph/
βββ abis/ # Contract ABIs
βββ build/ # Build output (generated by Graph CLI)
βββ generated/ # Auto-generated Graph code
βββ node_modules/ # Node.js dependencies
βββ src/ # Mapping logic in TypeScript
βββ tests/ # Unit tests for mappings
βββ networks.json # Network and contract config
βββ package.json # NPM dependencies and scripts
βββ schema.graphql # GraphQL schema definition
βββ subgraph.yaml # Subgraph manifest
βββ tsconfig.json # TypeScript configuration
βββ yarn.lock # Yarn lock file
yarn installGenerates types from the GraphQL schema and ABIs:
yarn codegenyarn buildUpdate subgraph.yaml with your contract address and start block, then:
graph auth --product hosted-service <YOUR_DEPLOY_KEY>
graph deploy --product hosted-service <GITHUB_USERNAME>/<SUBGRAPH_NAME>π You can get a deploy key from https://thegraph.com/hosted-service/dashboard
| File | Description |
|---|---|
subgraph.yaml |
Manifest file defining data sources, schema, and mappings |
schema.graphql |
GraphQL schema for your subgraph |
src/ |
Contains mapping handlers (e.g., handleTransfer, handleMint, etc.) |
abis/ |
Contract ABIs used by the subgraph |
To run mapping logic tests:
yarn testMaintained: 0xgordian