> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monad.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 索引框架

## 背景

**智能合约索引器**是链下计算器,用于计算特定于某个智能合约的额外指标。计算器可以被视为智能合约的扩展,执行额外的链下计算并维护额外的链下状态。

*简单示例:* [UniswapV2Pair 合约](https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol) 为池子维护最少的状态,并发出 `Mint`、`Burn` 和 `Swap` 事件。如果我们想知道该交易对上 swap 的累计数量和交易量,我们可以编写并部署自定义索引器,而不必向合约添加额外的状态变量和计算。

智能合约索引器通常使用 [GraphQL](https://graphql.org/) schema 语言生成对象 schema。

智能合约索引服务通常提供托管服务,以便用户无需运行自己的基础设施即可部署索引器。

## 提供商概览

<Tabs>
  <Tab title="主网">
    <div class="mintlify-table-wrapper">
      <table class="mintlify-table">
        <thead>
          <tr>
            <th>提供商</th>
            <th>状态</th>
            <th>文档</th>
            <th>语言</th>
            <th>框架</th>
            <th>特色</th>
            <th>托管服务</th>
            <th>去中心化托管服务</th>
            <th>链上与链下数据</th>
            <th>WebSocket 订阅</th>
            <th>查询层</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>[Envio](https://envio.dev/)</td>
            <td>✅</td>
            <td>[文档](https://docs.envio.dev/docs/HyperIndex/overview)</td>
            <td>JavaScript、TypeScript、Rescript</td>
            <td>[HyperIndex](https://github.com/enviodev/hyperindex)</td>
            <td>性能与规模</td>
            <td>✅</td>
            <td>❌</td>
            <td>✅</td>
            <td>✅</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[Ghost](https://tryghost.xyz/)</td>
            <td>✅</td>
            <td>[文档](https://docs.tryghost.xyz/ghostgraph/overview)</td>
            <td>Solidity</td>
            <td>GhostGraph</td>
            <td>Solidity 开发</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>❌</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[Goldsky](https://goldsky.com/)</td>
            <td>✅</td>
            <td>[文档](https://docs.goldsky.com/)</td>
            <td>AssemblyScript、SQL、TypeScript</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)、[Turbo Pipelines](https://docs.goldsky.com/turbo-pipelines/introduction)</td>
            <td>实时数据流</td>
            <td>✅</td>
            <td>❌</td>
            <td>✅(通过 [Compose](https://docs.goldsky.com/compose/introduction))</td>
            <td>❌</td>
            <td>GraphQL 与 SQL([在您的数据库中](https://docs.goldsky.com/turbo-pipelines/introduction))</td>
          </tr>

          <tr>
            <td>[Ormi](https://ormilabs.com/)</td>
            <td>✅</td>
            <td>[文档](https://docs.ormilabs.com/)</td>
            <td>Assembly- Script</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)</td>
            <td>高性能和自定义环境</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>❌</td>
            <td>自定义 GraphQL</td>
          </tr>

          <tr>
            <td>[Sentio](https://www.sentio.xyz/)</td>
            <td>✅</td>
            <td>[文档](https://docs.sentio.xyz/docs/quickstart)</td>
            <td>JavaScript、TypeScript</td>
            <td>[sentio-sdk](https://github.com/sentioxyz/sentio-sdk)</td>
            <td>性能;集成告警与可视化</td>
            <td>✅</td>
            <td>❌</td>
            <td>✅</td>
            <td>❌</td>
            <td>GraphQL 与 SQL</td>
          </tr>

          <tr>
            <td>[SQD](https://sqd.ai/)</td>
            <td>✅</td>
            <td>[文档](https://docs.sqd.ai)</td>
            <td>TypeScript</td>
            <td>[squid-sdk](https://github.com/subsquid/squid-sdk)</td>
            <td>性能、去中心化</td>
            <td>✅</td>
            <td>部分[^1]</td>
            <td>✅</td>
            <td>✅</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[Streamingfast](https://thegraph.market/)</td>
            <td>✅</td>
            <td>[文档](https://docs.substreams.dev/tutorials/intro-to-tutorials/monad)</td>
            <td>Rust</td>
            <td>[Substreams](https://substreams.dev)</td>
            <td>性能、低延迟和自定义 sink</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>✅(gRPC 订阅)</td>
            <td>gRPC,支持 20+ 数据库类型</td>
          </tr>

          <tr>
            <td>[SubQuery](https://subquery.network/)</td>
            <td>✅</td>
            <td>[文档](https://academy.subquery.network/)</td>
            <td>TypeScript</td>
            <td>[subql](https://github.com/subquery/subql)</td>
            <td>去中心化</td>
            <td>✅</td>
            <td>✅</td>
            <td>✅</td>
            <td>❌</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[The Graph](https://thegraph.com/)</td>
            <td>✅</td>
            <td>[文档](https://thegraph.com/docs/en/subgraphs/quick-start/)</td>
            <td>Assembly- Script</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)</td>
            <td>原始的索引器</td>
            <td>✅</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>自定义 GraphQL</td>
          </tr>
        </tbody>
      </table>
    </div>

    *✅ = 已支持,⌛️ = 进行中,❓ = 未知,❌ = 不支持*

    [^1]: SQD 托管服务是半去中心化的:数据湖是去中心化的,但索引器在专有基础设施上运行。
  </Tab>

  <Tab title="测试网">
    <div class="mintlify-table-wrapper">
      <table class="mintlify-table">
        <thead>
          <tr>
            <th>提供商</th>
            <th>状态</th>
            <th>文档</th>
            <th>语言</th>
            <th>框架</th>
            <th>特色</th>
            <th>托管服务</th>
            <th>去中心化托管服务</th>
            <th>链上与链下数据</th>
            <th>WebSocket 订阅</th>
            <th>查询层</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>[Envio](https://envio.dev/)</td>
            <td>✅</td>
            <td>[文档](https://docs.envio.dev/docs/HyperIndex/overview)</td>
            <td>JavaScript、TypeScript、Rescript</td>
            <td>[HyperIndex](https://github.com/enviodev/hyperindex)</td>
            <td>性能与规模</td>
            <td>✅</td>
            <td>❌</td>
            <td>✅</td>
            <td>✅</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[Ghost](https://tryghost.xyz/)</td>
            <td>✅</td>
            <td>[文档](https://docs.tryghost.xyz/ghostgraph/overview)</td>
            <td>Solidity</td>
            <td>GhostGraph</td>
            <td>Solidity 开发</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>❌</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[Goldsky](https://goldsky.com/)</td>
            <td>✅</td>
            <td>[文档](https://docs.goldsky.com/)</td>
            <td>AssemblyScript、SQL、TypeScript</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)、[Turbo Pipelines](https://docs.goldsky.com/turbo-pipelines/introduction)</td>
            <td>实时数据流</td>
            <td>✅</td>
            <td>❌</td>
            <td>✅(通过 [Compose](https://docs.goldsky.com/compose/introduction))</td>
            <td>❌</td>
            <td>GraphQL 与 SQL([在您的数据库中](https://docs.goldsky.com/turbo-pipelines/introduction))</td>
          </tr>

          <tr>
            <td>[Ormi](https://ormilabs.com/)</td>
            <td>✅</td>
            <td>[文档](https://docs.ormilabs.com/)</td>
            <td>Assembly- Script</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)</td>
            <td>高性能和自定义环境</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>❌</td>
            <td>自定义 GraphQL</td>
          </tr>

          <tr>
            <td>[SQD](https://sqd.ai/)</td>
            <td>✅</td>
            <td>[文档](https://docs.sqd.ai)</td>
            <td>TypeScript</td>
            <td>[squid-sdk](https://github.com/subsquid/squid-sdk)</td>
            <td>性能、去中心化</td>
            <td>✅</td>
            <td>部分[^1]</td>
            <td>✅</td>
            <td>✅</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[SubQuery](https://subquery.network/)</td>
            <td>✅</td>
            <td>[文档](https://academy.subquery.network/)</td>
            <td>TypeScript</td>
            <td>[subql](https://github.com/subquery/subql)</td>
            <td>去中心化</td>
            <td>✅</td>
            <td>✅</td>
            <td>✅</td>
            <td>❌</td>
            <td>GraphQL</td>
          </tr>

          <tr>
            <td>[The Graph](https://thegraph.com/)</td>
            <td>✅</td>
            <td>[文档](https://thegraph.com/docs/en/subgraphs/quick-start/)</td>
            <td>Assembly- Script</td>
            <td>[subgraph](https://github.com/graphprotocol/graph-node)</td>
            <td>原始的索引器</td>
            <td>✅</td>
            <td>✅</td>
            <td>❌</td>
            <td>❌</td>
            <td>自定义 GraphQL</td>
          </tr>
        </tbody>
      </table>
    </div>

    *✅ = 已支持,⌛️ = 进行中,❓ = 未知,❌ = 不支持*

    [^1]: SQD 托管服务是半去中心化的:数据湖是去中心化的,但索引器在专有基础设施上运行。
  </Tab>
</Tabs>

## 提供商详情

### Envio

[Envio](https://envio.dev/) 是一个功能完备的数据索引解决方案,为应用开发者提供无缝、高效地索引和聚合 Monad Testnet 实时和历史区块链数据的方式。索引后的数据可通过自定义 GraphQL 查询轻松访问,为开发者提供检索特定信息的灵活性和强大功能。

[Envio HyperSync](https://docs.envio.dev/docs/HyperIndex/hypersync) 是 Monad Testnet 区块链的索引层,用于超高速同步历史数据(绕过 JSON-RPC)。通常需要数小时同步约 10 万个事件,现在可以在不到一分钟的时间内完成。

Envio 旨在优化用户体验,提供自动代码生成、灵活的语言支持、多链数据聚合以及可靠、经济的托管服务。

要开始使用,请访问 [文档](https://docs.envio.dev/docs/HyperIndex/overview) 或按照 [快速开始](https://docs.envio.dev/docs/HyperIndex/contract-import) 指南操作。

### Ghost

使用 [GhostGraph](https://docs.tryghost.xyz/ghostgraph/overview/),您可以用与合约相同的语言(Solidity)编写索引器。这意味着更少的上下文切换和更快的上市时间。

要开始使用,请访问 [文档](https://docs.tryghost.xyz/ghostgraph/overview/) 或查看 [教程](/zh/guides/indexers/ghost)。

支持的服务:

* GhostGraph

### Goldsky

[Goldsky](https://goldsky.com/) 处理在加密基础设施上构建的困难部分:实时数据和可靠连接,让您可以更快地推出更好的产品。

Goldsky 提供两款核心自助产品,可独立使用或结合使用以驱动您的数据栈。

* [**Subgraphs**](https://docs.goldsky.com/subgraphs/deploying-subgraphs):Monad 数据的即时 GraphQL API,零维护。
* [**Turbo Pipelines**](https://docs.goldsky.com/turbo-pipelines/introduction):将实时 Monad 数据直接流式传输到您的数据库,具备非常快速的解码、无限过滤器、动态表和实时数据检视。

要开始使用,请访问 [文档](https://docs.goldsky.com/introduction) 获取引导演示。

### Ormi

[Ormi](https://ormilabs.com/) 提供快速、准确且可用于生产的实时区块链数据。

它使数据与链的最新状态保持同步,并通过 Subgraph 和 API 立即访问,无需管理索引基础设施。

Ormi 提供两款核心产品:

* **Subgraphs**:亚秒级延迟的智能合约数据,零节流。
* **Data API**:通过灵活、高速的 API 端点提供实时和历史区块链数据。

Ormi 支持共享、专用和完全自定义的环境,为高负载工作负载提供隔离的性能。

通过浏览 [文档](https://docs.ormilabs.com/) 或按照 [快速开始指南](https://docs.ormilabs.com/subgraphs/quickstart) 开始构建。

### Sentio

[Sentio](https://www.sentio.xyz/) 在 Monad 上提供极速原生处理器和无缝 subgraph 托管。凭借强大的数据库能力、直观的 dashboard 和全面的 API 功能,Sentio 旨在提供卓越的开发者体验。

要开始使用,请查看 [文档](https://docs.sentio.xyz/docs/readme) 或访问 [快速开始](https://docs.sentio.xyz/docs/quickstart) 指南。

### SQD

[SQD](https://sqd.ai/) 提供无许可、低成本的 PB 级高价值 Web3 数据访问。

SQD 是一个去中心化的超大规模数据平台,针对高效、无许可地访问大量数据进行了优化。它目前提供历史链上数据,包括事件日志、交易回执、trace 以及每笔交易的 state diff。

要开始使用,请访问 [文档](https://docs.sqd.ai) 或查看这个 [快速开始](https://docs.sqd.ai/sdk/quickstart/) 和 [示例](https://docs.sqd.ai/sdk/examples),了解如何通过 Subsquid 轻松创建 subgraph。

### Streamingfast

[Streamingfast](https://thegraph.market/) 构建大规模可扩展的软件用于处理和索引区块链数据。StreamingFast 构建了两项基础技术:

* [Firehose](https://firehose.streamingfast.io/):一个区块链数据提取层,采用基于文件和流式优先的方法处理完整的区块链历史。
* [Substreams](https://docs.substreams.dev/):一个数据转换层,允许开发者编写可以像积木一样组合的 Rust 模块,基于社区开发的模块进行构建。Substreams 可以将数据输出到各种目的地,包括 PostgreSQL、MongoDB、Kafka 和 flat 文件。

要开始使用,请查看 [文档](https://docs.substreams.dev/),或访问 [教程](https://docs.substreams.dev/tutorials/intro-to-tutorials/monad) 来在 Monad 上生成您的第一个 substream。

### SubQuery

[SubQuery](https://subquery.network/) 是领先的区块链数据索引器,为开发者提供快速、灵活、通用、开源且去中心化的 Web3 项目 API。SubQuery SDK 允许开发者获取丰富的索引数据,以更快、更高效的方式构建直观且沉浸式的去中心化应用。SubQuery 支持包括 Monad、Ethereum、Cosmos、Near、Polygon、Polkadot、Algorand 在内的多个生态系统。

SubQuery 的优势之一是,能够不仅在单条链内聚合数据,还能在单个项目中跨多条区块链聚合数据。这允许创建功能丰富的 dashboard 分析和多链区块扫描器。

#### 有用的资源:

* [SubQuery Academy(文档)](https://academy.subquery.network/)
* [Monad Testnet Starter](https://github.com/subquery/ethereum-subql-starter/tree/main/Monad/monad-testnet-starter)
* [Monad Testnet 快速开始指南](https://academy.subquery.network/indexer/quickstart/quickstart_chains/monad.html)

如有技术问题和支持,请联系我们 `start@subquery.network`

### The Graph

[The Graph](https://thegraph.com/) 是一种索引协议,通过称为 subgraph 的 API 提供了一种简便的查询区块链数据的方式。

使用 The Graph,您可以从中受益:

* **去中心化索引**:通过多个索引器索引区块链数据,消除任何单点故障
* **GraphQL 查询**:提供强大的 GraphQL 接口用于查询已索引的数据,使数据检索变得非常简单。
* **可定制**:定义您自己转换和存储区块链数据的逻辑。复用其他开发者在 The Graph Network 上发布的 subgraph。

按照此 [快速开始](https://thegraph.com/docs/en/subgraphs/quick-start/) 指南,在 5 分钟内创建、部署和查询 subgraph。
