This extension adds automatic Envio indexer generation to your Scaffold-ETH 2 project, allowing you to index all your deployed smart contracts and query their data through a GraphQL API.
- π Generates boilerplate Envio indexer from your deployed Scaffold-ETH contracts
- π Status dashboard with links to Envio metrics and database
- π One-click regeneration to update the indexer when you deploy new contracts
- π― Automatic event detection from your contract ABIs
- π GraphQL API for querying your indexed blockchain data
cd packages/envio
pnpm update # Generate indexer from deployed contracts
pnpm codegen # Generate TypeScript types
pnpm dev # Start indexer in development mode
pnpm start # Start indexer in production mode
pnpm test # Run indexer tests
- Node.js v20 (required)
- pnpm (for Envio indexer)
- Docker (for running the indexer)
- Yarn (for Scaffold-ETH)
- Deploy your contracts:
yarn deploy
- Generate the indexer:
cd packages/envio && pnpm install && pnpm update && pnpm codegen
- Start the indexer:
pnpm dev
- Access the dashboard at
http://localhost:3000/envio
Via Frontend: Go to http://localhost:3000/envio
and click "Regenerate Boilerplate Indexer"
Via Command Line: cd packages/envio && pnpm update && pnpm codegen
The extension generates these files in packages/envio/
:
config.yaml
- Indexer configuration with your contracts and eventsschema.graphql
- GraphQL schema based on your contract eventssrc/EventHandlers.ts
- TypeScript event handlers
Indexer not starting: Check Docker is running, then cd packages/envio && pnpm dev
Contract not indexed: cd packages/envio && pnpm update && pnpm codegen && pnpm dev
Dashboard not loading: Ensure indexer (pnpm dev
) and frontend (yarn start
) are running
- Deploy contracts:
yarn deploy
- Update indexer:
cd packages/envio && pnpm update
- Start indexer:
pnpm start
- All contract events from your deployed contracts
- Event parameters with proper type mapping
- Block and transaction data for each event
- Timestamps and block numbers for historical queries
Happy Indexing! π
For more information about Envio, visit the official documentation.