๐Ÿš€Quickstart

Learn how to deploy your subgraph using Airstack Managed Graph Node to the DEGEN L3 chain.

Airstack enables Degenchain developers to deploy subgraphs to Airstack's Managed Graph Node.

  • This is currently offered for free during an initial learning period

  • An Airstack API key is required but usage of your Degenchain subgraph will not be rated towards Airstack API credits

  • Following the learning period there may be some charges to cover our costs of providing this service and for especially high volume usage.

Prerequisites

git clone https://github.com/Airstack-xyz/Subgraphs.git && \
 cd Subgraphs/user-contract-interactions/

Step 1: Create Subgraph

First, create the subgraph that you want to deploy in the Airstack Graph Node indexer by providing your Airstack API key and the name for your subgraph:

graph create \
  --node https://subgraph.airstack.xyz/indexer/ \
  --access-token <AIRSTACK_API_KEY> <SUBGRAPH_NAME>

Step 2: Deploy Subgraph

Once the subgraph is successfully created, deploy the subgraph by using the following command:

graph deploy \
  --node https://subgraph.airstack.xyz/indexer/ \
  --access-token <AIRSTACK_API_KEY> \
  --ipfs https://ipfs.airstack.xyz/ipfs/api/v0 \
  --headers '{"Authorization": "<AIRSTACK_API_KEY>"}' <SUBGRAPH_NAME>

Once you subgraph is deployed, you can check on the Subgraph Dashboard to confirm if the deployment is successful.

Step 3: Query The Deployed Subgraph

And when it is successfully deployed you can try to query data from the GraphQL API from the deployed subgraph:

If you are using Airstack subgraph repository, you can test the GraphQL API by setting the query field to: --data '{"query":"{\n _meta {\n block {\n number\n }\n }\n}"}'

curl --location 'https://subgraph.airstack.xyz/query/subgraphs/name/<SUBGRAPH_NAME>' \
  --header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
  --header 'Connection: keep-alive' \
  --header 'accept: application/json, multipart/mixed' \
  --header 'content-type: application/json' \
  --header 'Authorization: Bearer <AIRSTACK_API_KEY>' \
  --data '{"query":"STRINGIFIED_GRAPHQL_QUERIES"}'

Alternatively, you can also test your subgraph by making GraphQL queries from platforms such as Postman by using the following API information:

DataValue

Endpoint

https://subgraph.airstack.xyz/query/subgraphs/name/<SUBGRAPH_NAME>

Headers

  • Key: Authorization

  • Value: Bearer <AIRSTACK_API_KEY>

๐ŸŽ‰ ๐Ÿฅณ Congratulations you've just deployed your 1st subgraph to index the DEGEN L3 chain!

Developer Support

If you have any questions or need help regarding deploying your subgraph to the Airstack Graph Node, please join our Airstack's Telegram group.

More Resources

Last updated