indexing
Querying 0G chain data responsibly (events, subgraphs, analytics).
Works with
--- name: indexing description: Querying 0G chain data responsibly (events, subgraphs, analytics). license: MIT --- # Indexing **Indexing** — Querying 0G chain data responsibly (events, subgraphs, analytics). --- ## Do not scan blocks naively Looping `eth_getLogs` across unbounded ranges from the client will **fail** at scale (timeouts, provider limits). Use: - **Indexer services** (subgraph-style, hosted indexers, or self-hosted). - **Precomputed aggregates** in your backend with checkpointed block cursors. --- ## Event design for indexability - Emit **indexed** fields for filters you need (`indexed` args up to EVM limits). - Prefer **explicit** events over relying on storage reads from offchain jobs. - Version events (`V2` suffix) when changing schemas. --- ## The Graph / Dune equivalents Ecosystem tooling evolves — agents should: 1. Check whether **hosted subgraph** providers support **0G chain IDs** (`16602`, `16661`). 2. If unavailable, run **Graph Node** or custom indexers against your RPC provider. 3. For analytics, replicate patterns: **raw logs → transforms → tables** (Dune-style) with **chain id** partition. --- ## Storage metadata indexing For **0G Storage**, persist: - **Root hash**, **upload tx hash**, **content type**, **uploader**, **timestamp** - Optional **encryption** metadata (never store raw keys onchain) --- ## RPC etiquette - Batch requests where supported. - Backoff on `429` / timeouts. - Use **websocket** subscriptions only if your provider supports them reliably. --- ## How to fetch this skill ```bash curl -sSL https://0gskills.com/indexing/SKILL.md ``` --- ## Related skills - [Tools](../tools/SKILL.md) - [Frontend UX](../frontend-ux/SKILL.md) - [Ship](../ship/SKILL.md) MIT License — contributions welcome.
More Database skills
prisma-mongodb-upgrade
prisma/skills
Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma Next. Triggers on "upgrade prisma mongodb", "prisma 7 mongodb", "mongodb prisma migration", "prisma next mongodb".
azure-upgrade
microsoft/azure-skills
Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed Redis (AMR).
azure-cost-optimization
microsoft/azure-skills
Identify Azure cost savings from usage and spending data. USE FOR: optimize Azure costs, reduce Azure spending/expenses, analyze Azure costs, find cost savings, generate cost optimization report, identify orphaned resources to delete, rightsize VMs, reduce waste, optimize Redis costs, optimize storage costs, AKS cost analysis add-on, namespace cost, cost spike, anomaly, budget alert, AKS cost visibility. DO NOT USE FOR: deploying resources (use azure-deploy), general Azure diagnostics (use azure-diagnostics), security issues (use azure-security)

