Development
Integrating
To integrate the Sablier V2 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.
If you're integrated the Sablier V2 subgraphs, we recommend using request and response wrappers/middleware to format results coming from Envio's indexer in the same shape as those from The Graph. Suggestions:
- Write queries in both systems (based on the querying language specifics) using the
same
operationNameand swap query strings between vendors based on it - Write response middleware that converts results into similar shapes (see these important notes)
Contributing
To contribute to the V2 indexers (Envio x Sablier) or deploy your own, head over to the GitHub
v2-subgraphs repository. Get started by reviewing the
apps/protocol-envio directory.
To bootstrap an indexer project, run the following commands. They will install the requisite dependencies and generate the code for a multi-chain deployment.
cd ./packages/core
pnpm install
pnpm run setup
# OR
pnpm dev
You'll find a local Hasura process at http://localhost:8080 which also includes a GraphQL endpoint to query locally.
To deploy without hosting yourself, have a look at the Envio
Hosted Service docs.
Prior to starting the Envio process (pnpm dev) please make sure your Docker app is running. For installation see the
official docs at https://docs.envio.dev/.