Development
Integrating
To integrate the Sablier V2 subgraph or indexers into your own product, start from the official @sablier/v2-subgraphs
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.
Contributing
To contribute to the V2 subgraphs or deploy your own, head over to the GitHub
v2-subgraphs
repository. Get started by reviewing the apps/protocol
directory.
To bootstrap a subgraph project, run the following commands. They will install the requisite dependencies and generate the code for a Sepolia deployment.
cd ./packages/core
yarn install
yarn setup:sepolia
To deploy a new subgraph on Sepolia:
- Create a new item using The Graph's hosted network
- Add its name/endpoint under the
deploy:sepolia
script inpackage.json
- Add your own Sablier V2 contract addresses in
../constants/chains/sepolia.ts
- Make sure you're authenticated on your local machine
- Run
yarn deploy:sepolia
You can read more about how the The Graph works in their official docs.
To publish on the hosted service:
-
Authenticate with the hosted service credentials
graph auth --product hosted-service <ACCESS_TOKEN>
-
Generate configuration
Run
yarn deploy:<chain_name>
to generate imports, configurations and deploy in the same script.