> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-zh/jia-gou/catalyst.md).

# Catalyst 网络

Catalyst 网络是 Decentraland 的去中心化内容分发基础设施。多个独立运营者运行 Catalyst 节点，负责存储和提供内容。

## 概览

Catalyst 网络作为一个全互联的分布式系统运行，节点彼此直接通信，以同步内容并维护网络健康。

![Catalyst 网络拓扑](https://2877118160-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6k7p2WCueah7nUnaQYV6%2Fuploads%2Fgit-blob-2292da3f43ef493114d2d1926700386ae161073d%2Fcatalyst.png?alt=media)

## Catalyst 组件

每个 Catalyst 节点由以下部分组成：

### 内容服务器

**目的**：资产存储与检索

存储并提供：

* 场景定义
* 3D 模型和纹理
* 音频文件
* 脚本
* 头像和穿戴物

**API 参考**: [Catalyst API](https://github.com/decentraland/docs/blob/main/contributor/apis/catalyst/README.md)

### Lambda 函数

**目的**：无服务器查询函数

提供可查询端点：

* 实体搜索
* 个人资料查询
* 内容元数据
* 部署历史

Lambda 函数作为独立服务运行，查询内容服务器的数据库。

### Nginx

**目的**：反向代理和负载均衡

将请求路由到相应服务：

* 用于上传的内容服务器
* 用于查询的 Lambda 函数
* 静态资源服务

***

## 内容部署

### 部署流程

```mermaid
sequenceDiagram
    participant CLI
    participant Content as 内容服务器
    participant Queue as 部署队列
    participant Services as 后端服务
    
    CLI->>Content: POST /entities
    Content->>Content: 验证并存储
    Content-->>CLI: 部署已接受
    Content->>Queue: 新部署事件
    Queue->>Services: 触发处理
```

### 部署步骤

1. **编译**：CLI 使用 build-ecs 打包场景
2. **签名**：创建者使用钱包对部署签名
3. **上传**：CLI 上传到任意 Catalyst 节点
4. **验证**：Catalyst 验证签名和内容
5. **存储**：内容保存到存储中
6. **传播**：事件发布到部署队列
7. **处理**：后端服务处理新内容

### 内容验证

Catalyst 验证：

* 数字签名（所有权证明）
* 内容哈希（完整性）
* 地块权限（土地所有权）
* 文件大小限制
* 符合内容政策

***

## 部署流水线

当内容部署后，多个系统会响应：

### 资源处理

```mermaid
flowchart LR
    Deploy[新部署]
    Queue[部署到 SQS]
    AB[资源包转换器]
    Profile[个人资料图片]
    Badges[徽章]
    
    Deploy --> Queue
    Queue -->|3D 资源| AB
    Queue -->|头像变更| Profile
    Queue -->|成就检查| Badges
```

**触发的服务**:

* **资源包转换器** - 创建优化后的资源包
* **个人资料图片生成器** - 生成头像缩略图
* **徽章处理器** - 检查部署成就

### 监听服务

监控部署的服务：

* **世界** - 用于世界部署
* **通信守门人** - 用于世界语音配置
* **Atlas 服务器** - 用于地图更新

***

## 内容复制

Catalyst 节点复制内容以确保可用性：

### 复制策略

* **主动同步**：节点主动同步新部署
* **基于拉取**：节点按需获取缺失内容
* **Gossip 协议**：部署公告会传播

### 内容寻址

所有内容都采用内容寻址：

* 文件通过 IPFS CID（内容标识符）标识
* 部署后即不可变
* 自动去重

***

## Archipelago Workers（通信）

通信基础设施与 Catalyst 并行运行：

### 组件

#### WebSocket 连接器

* 维护客户端连接
* 协议处理
* 连接认证

**API 参考**: [Archipelago Workers API](https://github.com/decentraland/docs/blob/main/contributor/apis/archipelago-workers/README.md)

#### Archipelago 核心

* **岛屿形成** - 将附近玩家分组
* **对等节点限制** - 强制每个岛屿的最大对等节点数（通常为 100）
* **位置更新** - 广播玩家位置
* **消息路由** - 路由聊天和表情动作

#### 统计服务

* 每个场景的活跃用户数
* 连接统计
* 性能指标

***

## 区块链集成

### 子图索引器

Catalyst 使用专用索引器：

```mermaid
flowchart LR
    Blockchain[以太坊/Polygon]
    Subgraph[索引器]
    Catalyst[Catalyst]
    
    Blockchain -->|事件| Subgraph    
    Catalyst -->|查询| Subgraph
```

该 **索引器** 索引：

* 土地所有权（LAND NFT）
* 穿戴物和表情收藏
* 名称注册
* NFT 转移

***

## 下一步

* 复习 [后端服务](/contributor/contributor-zh/jia-gou/services.md) 查看服务详情
* 参见 [基础设施](/contributor/contributor-zh/jia-gou/infrastructure.md) 查看支撑系统
* 查看 [架构概览](/contributor/contributor-zh/jia-gou/architecture.md) 查看完整情况


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/contributor/contributor-zh/jia-gou/catalyst.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
