Indexing
Instant Subgraphs
Open Beta
This feature is available as a beta release.
Skip the manual creation and maintenance of subgraphs. Instead, use your contract's ABI and a configuration file to let Goldsky generate a subgraph for you. Indexing of the generated subgraph starts immediately after deployment.
Below is an example of a basic configuration file:
{
"version": "1",
"name": "TokenDeployed",
"abis": {
"TokenRegistry": {
"path": "./abis/token-registry.json"
}
},
"chains": ["mainnet"],
"instances": [
{
"abi": "TokenRegistry",
"address": "0x0A6f564C5c9BeBD66F1595f1B51D1F3de6Ef3b79",
"startBlock": 13983724,
"chain": "mainnet"
}
]
}
For a complete reference of the various properties, please see the Instant Subgraphs references docs
Execute the following command to generate a subgraph, deploy it, and let Goldsky start indexing:
goldsky subgraph deploy <subgraphName>/<subgraphVersion> --from-abi <path-to-above-config-file>
In your terminal, you will see output similar to the following:
❯❯❯ goldsky subgraph deploy goldsky/v1.0.0 --from-abi ./goldsky_config.json
Deploying Subgraph:
✔ Generating subgraph(s) (this may take several minutes)
✔ Deploying goldsky-mainnet/v1.0.0 to Goldsky
Deployed subgraph API: https://api.goldsky.com/api/public/project_cl6whoglq00050iyl9jnqc0o3/subgraphs/goldsky-mainnet/v1.0.0/gn
That's it! You can now query your subgraph at the provided link(s) or watch the indexing progress and other information at app.goldsky.com/dashboard/subgraphs.