blockchain-data-indexing
Blockchain indexing covering The Graph subgraphs, Dune Analytics, Goldsky pipelines, ChainIndex custom indexers, and ETL event-warehousing patterns for…
от j4flmao★ 47 звёзд на GitHub
Установить blockchain-data-indexing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Blockchain Data Indexing
Purpose
Guide the selection and implementation of blockchain data indexing solutions. Covers The Graph subgraphs, Dune Analytics queries, Goldsky pipelines, and custom indexer architecture for transforming raw on-chain data into queryable formats.
Agent Protocol
Trigger Keywords
"blockchain indexer", "subgraph", "The Graph", "Dune Analytics", "Dune", "Goldsky", "ChainIndex", "indexer architecture", "event indexing", "event handler", "call handler", "block handler", "data source template", "dynamic data source", "spellbook", "decoded table", "pipeline", "mirror", "ETL blockchain", "reorg handling", "chain reorg", "log polling", "event-driven indexing", "fromBlock", "toBlock", "healing"
Input Context
- Blockchain and chain(s) to index
- Data to extract (events, calls, state, traces)
- Query patterns (analytical, real-time, historical)
- Infrastructure preferences (managed service vs self-hosted)
- Budget constraints (gas costs, infrastructure costs)
- Reorg tolerance (confirmation depth)
Output Artifact
Indexing architecture recommendation with configuration, schema design, and production operational plan.
Response Format
- Recommendation: tool/protocol fitting the use case (The Graph, Dune, Goldsky, ChainIndex, hybrid)
- Architecture: indexing pipeline (source chain → data source → transformation → storage → query layer)
- Configuration snippet: YAML/SQL/AssemblyScript excerpt (subgraph.yaml, Dune query, Goldsky pipeline, event handler)
- Reorg & safety: how design handles reorgs, missing blocks, data consistency
- Alternatives/trade-offs: when another approach is better and why
Completion Criteria
- Indexing tool selected with justification against alternatives
- Event schema designed with all indexed fields for efficient filtering
- Reorg handling modeled with confirmation depth and unwind logic
- Query patterns optimized (time-range filters, pagination, aggregations)
- Monitoring metrics defined (indexing lag, reorgs, error rate)
Max Response Length
4000 tokens
Decision Trees
Indexing Tool Selection
Indexing needs:
├── Standard EVM event/call/block indexing?
│ ├── YES → The Graph (subgraphs)
│ │ ├── Public subgraph → Use hosted service or decentralized network
│ │ └── Private subgraph → Self-hosted graph-node
│ └── NO → Evaluate alternatives
├── SQL-based data exploration?
│ ├── YES → Dune Analytics
│ │ ├── Pre-decoded contracts → Use spellbook / crypto_ tables
│ │ └── Custom contracts → Submit decoded contract request
│ └── NO → Consider other tools
├── Real-time + complex transformations?
│ ├── YES → Goldsky
│ │ ├── Simple pipelines → Goldsky Pipeline (YAML declarative)
│ │ └── Complex joins/aggregation → Goldsky Mirror (SQL)
│ └── NO → The Graph or Dune
├── Full control over schema and storage?
│ ├── YES → ChainIndex or custom indexer
│ │ ├── ChainIndex → Go-based custom indexer framework
│ │ └── Custom → Any stack (Rust, Python, Node) + any DB (Postgres, ClickHouse)
│ └── NO → Managed service (The Graph, Goldsky)
└── Multi-chain aggregation needed?
├── YES → Goldsky Mirror or custom (subgraphs per chain + aggregation layer)
└── NO → Single-chain subgraph or Dune query
Indexing Strategy
Data freshness requirements:
├── Real-time (< 1 min latency) → Event-driven indexing, 1 confirmation
├── Near real-time (< 5 min) → Event-driven, 6 confirmations
├── Batch (hourly) → Block-based polling, full confirmation
└── Historical (one-time) → fromBlock scan with batch processing
Reorg handling:
├── 0-1 confirmation → Unwind + reindex on reorg (high risk)
├── 6 confirmations → Standard safe zone, minimal reorgs
├── 12+ confirmations → Very safe, rare reorgs (Ethereum)
└── Finality gadget → No reorg risk (Cosmos, Solana)
Data volume:
├── < 100 events/day → Subgraph or Dune query (free tier)
├── 100-10K events/day → Subgraph (hosted), Goldsky Pipeline
├── 10K-1M events/day → Goldsky Mirror, self-hosted graph-node
└── 1M+ events/day → Custom indexer (Rust/Python + ClickHouse)
Subgraph Architecture (The Graph)
subgraph.yaml
specVersion: 0.0.5
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum
name: UniswapV3Factory
network: mainnet
source:
address: "0x1F98431c8aD98523631AE4a59f267346ea31F984"
abi: Factory
startBlock: 12369621 # Pin to deployment block
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Pool
- Token
abis:
- name: Factory
file: ./abis/Factory.json
eventHandlers:
- event: PoolCreated(indexed address,indexed address,indexed uint24,int24,address)
handler: handlePoolCreated
file: ./src/mapping.ts
Schema Design (schema.graphql)
type Pool @entity {
id: ID!
token0: Token!
token1: Token!
feeTier: BigInt!
liquidi
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/blockchain-data-indexing-advanced.md
- references/blockchain-data-indexing-fundamentals.md
- references/blockchain-data-query.md
- references/dune-analytics.md
- references/event-processing.md
- references/goldsky-chainindex.md
- references/indexer-architecture.md
- references/subgraph_mapping_handlers.md
- references/the-graph-subgraph.md
- references/the_graph_graphql_schemas.md
FAQ
Что делает скилл blockchain-data-indexing?
Blockchain indexing covering The Graph subgraphs, Dune Analytics, Goldsky pipelines, ChainIndex custom indexers, and ETL event-warehousing patterns for blockchain data. Covers event-driven indexing, reorg handling, data source templates, and multi-chain data aggregation. Do NOT use for: web3 frontend data fetching (use blockchain-web3), smart contract development (use blockchain-application), or general ETL (out of scope).
Как установить скилл blockchain-data-indexing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл blockchain-data-indexing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…