{"id":29177889,"url":"https://github.com/gitcoinco/grants-stack-indexer","last_synced_at":"2025-07-01T18:09:08.235Z","repository":{"id":149473934,"uuid":"614322849","full_name":"gitcoinco/grants-stack-indexer","owner":"gitcoinco","description":"Grants Stack Indexer","archived":false,"fork":false,"pushed_at":"2024-04-12T12:51:06.000Z","size":2692,"stargazers_count":23,"open_issues_count":38,"forks_count":17,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-13T22:04:52.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://grants-stack-indexer.gitcoin.co/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitcoinco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-15T11:03:18.000Z","updated_at":"2024-04-15T13:58:28.921Z","dependencies_parsed_at":"2023-12-20T14:37:51.179Z","dependency_job_id":"1c941dc8-8c58-45a5-8972-b8da0d659bfc","html_url":"https://github.com/gitcoinco/grants-stack-indexer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gitcoinco/grants-stack-indexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcoinco%2Fgrants-stack-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcoinco%2Fgrants-stack-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcoinco%2Fgrants-stack-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcoinco%2Fgrants-stack-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitcoinco","download_url":"https://codeload.github.com/gitcoinco/grants-stack-indexer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitcoinco%2Fgrants-stack-indexer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263013739,"owners_count":23399815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-01T18:09:01.990Z","updated_at":"2025-07-01T18:09:08.221Z","avatar_url":"https://github.com/gitcoinco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grants Stack Indexer\n\nThe Grants Stack Indexer is a tool that indexes blockchain events generated by [Allo contracts](https://github.com/Allo-Protocol/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](https://github.com/boudra/chainsauce) and is designed to work with any EVM-compatible chain.\n\nThe indexer data is used by [Grants Stack](https://github.com/gitcoinco/grants-stack) as a data layer.\n\nIndexer user docs featuring [sample queries](https://docs.allo.gitcoin.co/indexer/application) can be found at [docs.allo.gitcoin.co](https://docs.allo.gitcoin.co/indexer).\n\n## API\n\nAccess indexed data through the GraphQL endpoint at:\n\nhttps://grants-stack-indexer-v2.gitcoin.co/graphql\n\nUse the GraphiQL Playground to inspect the schema:\n\nhttps://grants-stack-indexer-v2.gitcoin.co/graphiql\n\nIndexed chains are defined in [config.ts](src/config.ts).\n\n## Setup\n\n**Requires Node 18 minimum.**\n\nCopy `.env.example` to `.env`, review and optionally customize it.\n\nTo pick chains to index, set `INDEXED_CHAINS` to a comma-separated list of chain identifiers. Available chain identifiers can be found in `src/config.ts`.\n\n## Running in development\n\n```bash\ncp .env.example .env\ndocker-compose up -d\nnpm install\nnpm run build\n\nnpm run dev\n\n# you can also pass arguments to the dev script\n\nnpm run dev -- --drop-db # drop the database before indexing\nnpm run dev -- --from-block=latest # start indexing from the last block\nnpm run dev -- --from-block=12345 # start indexing from the 12345th block\nnpm run dev -- --run-once # index and exit without watching for events\nnpm run dev -- --no-cache # disable cache\nnpm run dev -- --log-level=trace # set log level\nnpm run dev -- --port=8081 # start web service on a given port\n```\n\n## Running in production\n\n```bash\nnpm install\nnpm run build\nnpm run start # this will sync to the last block and then run the http server\n```\n\nOr use the provided `Dockerfile`.\n\n# Deployment\n\nCheck out this guide to [deploy your own indexer on Fly.io](./docs/deploy-to-fly.md).\n\nWe're currently continuously deploying the `main` branch into Fly.\n\nThere are a few things to consider when it comes to deploying your changes:\n\n- Deployments resume indexing from the last indexed block, which means that your changes will only apply to new blocks, and migrations are not applied\n- If you need to change the database schema or change an event handler retroactively, you need to increment the `CHAIN_DATA_VERSION` constant found in [src/config.ts](https://github.com/gitcoinco/grants-stack-indexer/blob/main/src/config.ts), on deployment this will automatically create a new schema in Postgres and reindex all events. Note that deployments that reindex will take longer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitcoinco%2Fgrants-stack-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitcoinco%2Fgrants-stack-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitcoinco%2Fgrants-stack-indexer/lists"}