Development
Integrating
To integrate the Sablier V2 subgraph into your own product, start from the official subgraph repository. We recommend using:
- GraphQL Code Generator to create types from your GraphQL fragments and queries
- TanStack Query to fetch results from the exposed endpoints.
Github - sablier-labs/v2-subgraphs: Sablier V2 SubgraphsGitHub
Contributing
To contribute to the V2 subgraphs or deploy your own, head over to the GitHub
v2-subgraphs
repository. Get started by reviewing the packages/core
directory.
To bootstrap a subgraph project, run the following commands. These will install all the necessary dependencies and
generate the code for a possible goerli
deployment.
cd ./packages/core
yarn install
yarn setup:goerli
To deploy a new subgraph (e.g. on Goerli):
- make sure to create a new item (e.g. using The Graph's hosted network)
- add its name/endpoint under the
deploy:goerli
script inpackage.json
- add your own Sablier V2 contract addresses in
./constants/chains/goerli.ts
- make sure you're authenticated in the terminal
- run
yarn deploy:goerli
Read more about the way The Graph works in their official docs.