/grants-stack-indexer

Allo Protocol Indexer for Grants Stack

Primary LanguageTypeScript

Grants Stack Indexer

The Grants Stack Indexer is a tool that indexes blockchain events generated by Allo contracts and serves the data over HTTP in JSON format. The data is organized in a specific structure that enables easy access to different parts of the protocol. The indexer is built using Chainsauce and is designed to work with any EVM-compatible chain.

The indexer data is used by Grants Stack to show stats and allocate matching funds.

API

Access indexed data through this URL: https://grants-stack-indexer.gitcoin.co/data/

The indexed data follows this structure:

/{chainId}/rounds.json
/{chainId}/prices.json
/{chainId}/projects.json
/{chainId}/rounds/{roundId}/projects.json
/{chainId}/rounds/{roundId}/projects/{projectId}/votes.json
/{chainId}/rounds/{roundId}/projects/{projectId}/contributors.json
/{chainId}/rounds/{roundId}/applications.json
/{chainId}/rounds/{roundId}/applications/{applicationIndex}/votes.json
/{chainId}/rounds/{roundId}/votes.json
/{chainId}/rounds/{roundId}/contributors.json

Indexed chains are defined in config.ts.

Setup

Copy .env.example to .env, review and optionally customize it.

To pick chains to index, set INDEXED_CHAINS to a comma-separated list of chain identifiers. Chain identifiers can be found in src/config.ts.

Running in development

npm install
npm run dev

Running in production:

npm install
npm run build
npm run start

Or use the provided Dockerfile.

One-shot operation

To only index data without tracking new events nor starting a server, provide the --run-once option:

npm run build
npm run start:run-once