{"library":"ponder","title":"Ponder: EVM Data Indexing Framework","description":"Ponder is an open-source TypeScript framework designed for indexing data from EVM-compatible blockchains. It provides tools to define a database schema, write indexing functions to process on-chain events, and then query the indexed data via automatically generated GraphQL or SQL APIs. The current stable version is 0.16.6, with frequent patch releases indicating active development. Ponder differentiates itself by offering a powerful local development server with hot reloading, end-to-end type safety, support for Postgres, and the ability to index data from multiple chains within a single application. It aims to provide a robust, performant alternative to traditional subgraph indexing solutions, optimized for application developers who require custom backend logic and greater control over their data infrastructure.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install ponder"],"cli":{"name":"ponder","version":null}},"imports":["import { createConfig } from 'ponder'","import { onchainTable } from 'ponder'","import { ponder } from 'ponder:registry'","import schema from 'ponder:schema'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createConfig } from \"ponder\";\nimport { BaseRegistrarAbi } from \"./abis/BaseRegistrar\"; // Assuming ABI is local\nimport { ponder } from \"ponder:registry\";\nimport schema from \"ponder:schema\";\n\n// 1. Initialize a new Ponder project (run in terminal):\n// npm init ponder@latest\n// cd my-ponder-project\n\n// 2. Start the development server (run in project directory):\n// npm run dev\n\n// 3. Define Ponder configuration in ponder.config.ts\nexport default createConfig({\n  chains: {\n    mainnet: {\n      id: 1,\n      rpc: process.env.MAINNET_RPC_URL ?? \"https://eth-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY\", // Replace with your actual RPC URL\n    },\n  },\n  contracts: {\n    BaseRegistrar: {\n      abi: BaseRegistrarAbi,\n      chain: \"mainnet\",\n      address: \"0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85\",\n      startBlock: 9380410,\n    },\n  },\n});\n\n// 4. Define your schema in ponder.schema.ts\nexport const ensName = schema.onchainTable(\"ens_name\", (t) => ({\n  name: t.string().primaryKey(),\n  owner: t.string().notNull(),\n  registeredAt: t.int().notNull(),\n}));\n\n// 5. Write indexing functions in src/BaseRegistrar.ts\nponder.on(\"BaseRegistrar:NameRegistered\", async ({ event, context }) => {\n  const { name, owner } = event.params;\n\n  await context.db.insert(schema.ensName).values({\n    name: name,\n    owner: owner,\n    registeredAt: Number(event.block.timestamp),\n  });\n});\n","lang":"typescript","description":"This quickstart demonstrates how to set up a Ponder project, configure chains and contracts, define a database schema, and write an indexing function to process Ethereum events and persist them to a database.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}