Subgraphs are an open-source tool for building custom GraphQL APIs with blockchain data.
- Write your subgraph code.
- Deploy to Alchemy Subgraphs.
- Query live blockchain data through your GraphQL API.
- Ship in days, not weeks - Spend up to 50% less time on data indexing and dealing with forks / reorgs.
- Simplify your infrastructure - Save hours every week on infra maintenance or downtime.
npm install -g @graphprotocol/graph-cli
Create a new subgraph:
graph init --product hosted-service
Make modifications as necessary to the manifest, schema, and handlers.
See Developing a Subgraph for more details.
Get your deploy key from your Alchemy Dashboard.
Run the following:
cd <SUBGRAPH_DIRECTORY> graph deploy <SUBGRAPH_NAME> \ --version-label <VERSION_NAME> \ --node https://subgraphs.alchemy.com/api/subgraphs/deploy \ --deploy-key <DEPLOY_KEY> --ipfs https://ipfs.satsuma.xyz
See Deploying a Subgraph for more details.
You’ll receive a link to view your newly deployed subgraph. Congrats!