Subgraph Documentation
Endaoment Subgraph
Endaoment has a GraphQL API Endpoint hosted by The Graph called a subgraph for indexing and organizing data from the Endaoment smart contracts.
This subgraph can be used to query Endaoment data.
Subgraph information is serviced by a decentralized group of server operators called Indexers.
To learn more about the Endaoment’s smart contract, please read this documentation.
GraphQL Schema
The schema of GraphQL entities available is defined in /schema.graphql
.
Helpful Links
Getting Started
-
Install dependencies with
yarn install
-
Run tests with
yarn test
Local Development
This section covers how to spin up a local Indexer node with the Endaoment subgraph.
Requirements
-
Docker is installed and running.
-
Docker has at least 10 GB of memory assigned to it.
-
If you are running this repository on a Mac M1, manually build the graph node docker image.
Steps
-
Create a
.env
file at the root of the project using the.env.model
file as a reference and fill in the necessary values. -
Spin up a forked hardhat node with
yarn hardhat
-
Run
yarn docker-up
- This will standup the indexing infrastructure and start indexing the latest blocks of your ethereum node.
-
Run
yarn create-local
to reserve the name for the subgraph on your local node. -
Run
yarn deploy-local
to deploy the subgraph code. -
Once the latest block has been indexed, the URL made available on the deployment step will start serving up-to-date requests.
Redeploying after Changes
If you made changes to the subgraph and wish to see it reflected in the local node, run:
Example Usage
This section covers a few examples of queries that can be run against the Endaoment subgraph.
Return Organization Data Based on EIN
returns
Return Largest Endaoment Grantors
returns
Return Summary of Endaoment Registry
returns
Was this page helpful?