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

# Leafage

> Leafage 架构与组件文档：面向开发者和 AI Agent 的项目导航

Leafage 把单体 EVM 全节点拆成一条分布式流水线：**一个**写节点负责 P2P 同步与区块执行，执行数据经 Kafka + S3 分发给**任意数量**的轻量查询节点，同时把结构化的区块数据（交易、调用追踪、事件日志）交付给外部消费者。

查询能力因此可以水平扩展：新增一个查询节点只需要 \~90GB 磁盘和分钟级的快照恢复，而不是 1.3TB+ 磁盘和数小时的全链同步。

## 五个组件

| 组件                                                        | 语言   | 角色                          | 仓库                                                                                  |
| --------------------------------------------------------- | ---- | --------------------------- | ----------------------------------------------------------------------------------- |
| [写节点](/cn/components/go-ethereum-x)                       | Go   | 执行客户端 + pipeline 集成，导出执行数据  | [Chaintable/go-ethereum](https://github.com/Chaintable/go-ethereum)                 |
| [pipeline](/cn/components/pipeline)                       | Go   | 嵌入写节点的追踪与分发库，写 S3 + Kafka   | [Chaintable/pipeline](https://github.com/Chaintable/pipeline)                       |
| [leafage-evm](/cn/components/leafage-evm)                 | Rust | 轻量 EVM 执行器，消费状态变更并提供 RPC 查询 | [Chaintable/leafage-evm](https://github.com/Chaintable/leafage-evm)                 |
| [consistency-checker](/cn/components/consistency-checker) | Go   | 校验副本一致性、标记分叉、维护 etcd 节点状态   | [Chaintable/consistency-checker](https://github.com/Chaintable/consistency-checker) |
| [nodex-proxy](/cn/components/nodex-proxy)                 | Go   | JSON-RPC 网关：服务发现、路由、负载均衡    | [Chaintable/nodex-proxy](https://github.com/Chaintable/nodex-proxy)                 |

## 从哪里开始

<Columns cols={2}>
  <Card title="核心概念" icon="book-open" href="/cn/concepts/overview">
    Leafage 是什么、五个组件的角色、贯穿全站的术语。
  </Card>

  <Card title="架构总览" icon="layers" href="/cn/architecture/overview">
    组件职责、运行拓扑、数据面与控制面的划分。
  </Card>

  <Card title="数据链路" icon="git-branch" href="/cn/architecture/data-flow">
    一个区块从执行到可查询的完整路径，含 reorg 与追赶。
  </Card>

  <Card title="接口契约" icon="plug" href="/cn/architecture/interfaces">
    Kafka topic、S3 键、etcd 键空间和 RPC 约定的精确定义。
  </Card>

  <Card title="发送 RPC 请求" icon="send" href="/cn/guides/rpc-requests">
    端点、请求头，以及 `eth_call`、批量调用、`blockCtx` 的可复制示例。
  </Card>

  <Card title="参与开发" icon="git-pull-request" href="/cn/guides/contributing">
    仓库地图、构建测试命令、提交规范和入手方向。
  </Card>
</Columns>

## 阅读建议

<Steps>
  <Step title="先读核心概念">
    用一页搞清 Leafage 是什么，以及写节点、查询节点、状态差异、区块上下文这些贯穿全站的术语。
  </Step>

  <Step title="再读架构总览">
    了解为什么要拆开全节点，以及五个组件各自负责哪一段。
  </Step>

  <Step title="然后读数据链路">
    跟着一个区块走完全程，这是理解组件间协作的最短路径。
  </Step>

  <Step title="按需读组件文档">
    每个组件页包含目录结构、关键机制、配置和代码入口，可直接定位到源码文件。
  </Step>

  <Step title="动手前读接口契约">
    改动跨组件行为时，Kafka 消息、S3 键和 etcd 键是需要保持兼容的部分。
  </Step>
</Steps>

<Note>
  本站描述的是各仓库当前 `main` 分支的实现。组件仓库内还有更细的设计文档（如 leafage-evm 的 `docs/StateManage.md`、pipeline 的 `docs/protocol.md`），本站在相关章节给出了链接。
</Note>
