> 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/creator/content-creator-zh/chang-jing-sdk7/qu-kuai-lian/create-a-dapp.md).

# 创建 dApp

创建你自己的去中心化应用的参考资料

你可以创建自己的去中心化应用（dApp），与 Decentraland 的智能合约交互，并以更完善、更友好的方式呈现其功能。

## 什么是 dApp

去中心化应用（简称 dApp）运行在分布式点对点网络上，而不是由中央服务器提供服务。

在区块链语境中，dApp 使用智能合约（也可能使用 P2P 网络），而不是 Web API 服务。dApp 也可以提供前端，并临时缓存区块链中的信息，但其输出最终会反映在链上。

有关 dApp 的更全面介绍，请参阅 [此网站](https://blockchainhub.net/decentralized-applications-dapps/) 。

## Decentraland 智能合约

Decentraland 编写并维护了多个与 LAND 和 MANA 代币交互的智能合约。

LAND 和 MANA 代币本身分别由 *LANDregistry* 和 *MANAtoken* 合约定义。合约列表还包括一些用途更具体的合约，例如将多个地块合并为一处地产，或抵押地块。

* [Decentraland 智能合约](https://contracts.decentraland.org/addresses.json)：你可以在此查看所有合约及其地址的完整列表。

请注意，每个合约都有一个部署在 *主网* 上的生产版本，以及一个部署在 *sepolia* 上的测试版本，两者的地址各不相同。

你可以查看每个合约的完整代码，因为这些信息都公开在区块链上。例如，你可以在 [Etherscan](https://etherscan.io/contractsVerified) 上按名称查找合约并阅读其内容。

## dApp 样板代码

* [样板代码](https://github.com/decentraland/dapp-boilerplate)：这份样板代码可以作为构建你自己的 dApp 的起点。请注意，该代码库已归档且不再维护，因此应将其作为参考，而非最新的模板。

## 辅助库

在内部构建 dApp 的过程中，我们整理了一些辅助库，你或许也会觉得有用。

* [Decentraland-dapps](https://github.com/decentraland/decentraland-dapps)：这是一个更高层级的库，包含 dApp 常用模块，并由 Decentraland 自己的应用积极使用。
* [Decentraland UI](https://ui.decentraland.org/)：此库包含一系列可复用的 UI 元素，这些元素也用于 Decentraland 的各个项目。
* [Decentraland-eth](https://github.com/decentraland/decentraland-eth)：这是一个底层库，提供用于与以太坊区块链交互的实用函数。请注意，该代码库已归档且不再维护。

## 示例 dApp

以下是我们围绕 Decentraland 构建的若干 dApp 的完整代码链接，或许能帮助你构建自己的应用：

* [Gate](https://github.com/decentraland/gate)：这个基础 dApp 会创建一种邀请 NFT，Decentraland 处于封闭测试阶段时曾使用它。在早期，只有列入白名单且持有此 NFT 的玩家才能进入元宇宙。
* [Marketplace](https://github.com/decentraland/marketplace)：这是运行 Decentraland [Marketplace](https://market.decentraland.org/)的完整应用。为了快速运行，它需要一个数据库和一台连接到以太坊网络的后端服务器，以创建包含 LAND 信息的索引。

## dApp 测试框架

在将 dApp 部署到生产环境之前，我们建议先对其进行测试。

* [dAppeteer](https://github.com/decentraland/dappeteer)：我们整合了这个框架，帮助你对自己的 dApp 运行测试。请注意，该代码库已归档且不再维护。

## Decentraland 智能合约

以下链接列出了与 Decentraland 生态系统相关的以太坊智能合约。该列表包含主网上以及其他以太坊测试网络上的合约。

[contracts.decentraland.org](https://contracts.decentraland.org/links)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-zh/chang-jing-sdk7/qu-kuai-lian/create-a-dapp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
