Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 9197b9c

Browse files
authored
[i18n] add zh smart-contracts / create-aptos-dapp (#951)
[i18n] zh smart-contracts / create-aptos-dapp
1 parent 72e87ec commit 9197b9c

File tree

2 files changed

+176
-0
lines changed

2 files changed

+176
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: "create-aptos-dapp"
3+
---
4+
5+
import { Tabs, Steps } from 'nextra/components'
6+
7+
# create-aptos-dapp
8+
9+
`create-aptos-dapp` 为 dapp 开发者构建了一个模板项目,可以轻松地在 Aptos 网络上创建前端和智能合约。
10+
11+
## 为什么使用 create-aptos-dapp?
12+
13+
- **模板化设置**`create-aptos-dapp` 为您生成预定义的端到端 dapp 模板和配置文件。它节省了手动设置项目结构的时间,这个过程可能既耗时又容易出错。
14+
- **合约目录**`create-aptos-dapp` 生成一个包含 Move 智能合约模块基本结构的 `contract` 目录。
15+
- **最佳实践**`create-aptos-dapp` 包含了为 Aptos 网络开发的最佳实践和结构建议。
16+
- **内置 Move 命令**`create-aptos-dapp` 包含用于常见任务的内置命令,例如初始化 Move 编译器、编译和在链上发布智能合约。
17+
18+
## 前提条件
19+
20+
- [node 和 npm](https://nodejs.org/en) (npm ≥ 5.2.0)
21+
- [Python 3.6+](https://www.python.org/)
22+
23+
## 使用 `create-aptos-dapp`
24+
25+
<Steps>
26+
### 导航到您想要工作的目录。
27+
28+
```bash filename="Terminal"
29+
cd your/workspace
30+
```
31+
32+
### 安装 `create-aptos-dapp`
33+
34+
<Tabs items={['npx', 'pnpx', 'yarn', 'pnpm']}>
35+
<Tabs.Tab>
36+
```bash filename="Terminal"
37+
npx create-aptos-dapp@latest
38+
```
39+
</Tabs.Tab>
40+
<Tabs.Tab>
41+
```bash filename="Terminal"
42+
pnpx create-aptos-dapp@latest
43+
```
44+
</Tabs.Tab>
45+
<Tabs.Tab>
46+
```bash filename="Terminal"
47+
yarn create aptos-dapp
48+
```
49+
</Tabs.Tab>
50+
<Tabs.Tab>
51+
```bash filename="Terminal"
52+
pnpm create create-aptos-dapp@latest
53+
```
54+
</Tabs.Tab>
55+
</Tabs>
56+
57+
### 按照 CLI 提示操作。
58+
59+
安装后,您需要回答几个关于项目的问题,包括:
60+
1. 项目名称
61+
2. 使用哪个模板([见下文](#current-templates)
62+
3. 是使用 Mainnet 还是 Devnet 进行测试
63+
64+
![cad](/docs/cad-video.gif)
65+
66+
</Steps>
67+
68+
## 模板
69+
70+
`create-aptos-dapp` 为您提供预制的端到端 dapp 模板,即一个配置好的 dapp,包含配置和美观的 UI,让您可以快速开始在 Aptos 上创建 dapp。
71+
72+
这些模板的目标是:
73+
74+
1. 通过提供端到端 dapp 模板示例,让用户熟悉不同的 Aptos 标准。
75+
2. 教育用户如何从前端层到智能合约层在 Aptos 上构建 dapp,以及中间的所有环节。
76+
3. 为用户提供预制模板,以快速部署简单的 dapp。
77+
78+
### 当前模板
79+
所有当前模板都可以在 [Aptos Learn](https://learn.aptoslabs.com/en/dapp-templates) 上找到。以下是具体模板的详细信息:
80+
81+
- [Boilerplate Template](https://learn.aptoslabs.com/en/dapp-templates/boilerplate-template)
82+
- [NFT minting dapp Template](https://learn.aptoslabs.com/en/dapp-templates/nft-minting-template)
83+
- [Token minting dapp Template](https://learn.aptoslabs.com/en/dapp-templates/token-minting-template)
84+
- [Token staking dapp Template](https://learn.aptoslabs.com/en/dapp-templates/token-staking-template)
85+
- [Custom indexer template](https://learn.aptoslabs.com/en/dapp-templates/custom-indexer-template)
86+
87+
## `create-aptos-dapp` 使用的工具
88+
89+
- React 框架
90+
- Vite 开发工具
91+
- shadcn/ui + tailwind 用于样式
92+
- Aptos TS SDK
93+
- Aptos Wallet Adapter
94+
- 基于 Node 的 Move 命令
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "智能合约"
3+
---
4+
5+
import { RemoteCodeblock, permalinkFetch, Card, Cards } from '@components/index'
6+
import { Callout } from 'nextra/components'
7+
8+
export async function getStaticProps() {
9+
return await permalinkFetch([
10+
'https://github.com/aptos-labs/aptos-core/blob/77e1d222ebc5e7294e115e0d090c001da1d0e072/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L59'
11+
])
12+
}
13+
14+
# Aptos 上的智能合约
15+
16+
Aptos 合约使用 Move 语言编写,这是一种用于安全、沙盒化和形式化验证编程的下一代语言,被多个区块链采用。
17+
Move 允许开发者编写灵活管理和转移资产的程序,同时为这些资产提供安全性和攻击防护。
18+
19+
## 📖 学习 Move
20+
21+
<Cards>
22+
<Card href="smart-contracts/why-move">
23+
<Card.Title>为什么选择 Move?</Card.Title>
24+
<Card.Description>了解 Aptos 为什么使用 Move 语言</Card.Description>
25+
</Card>
26+
{/* <Card href="smart-contracts/prover">
27+
<Card.Title>Move Prover</Card.Title>
28+
<Card.Description>Formal specification and verification of Move contracts on Aptos</Card.Description>
29+
</Card> */}
30+
<Card href="smart-contracts/create-package">
31+
<Card.Title>创建包</Card.Title>
32+
<Card.Description>通过学习如何创建 Move 包开始</Card.Description>
33+
</Card>
34+
<Card href="smart-contracts/objects">
35+
<Card.Title>对象</Card.Title>
36+
<Card.Description>学习如何在 Aptos 上使用对象标准来创建可组合和灵活的链上原语</Card.Description>
37+
</Card>
38+
</Cards>
39+
40+
## 👨‍💻 Move 示例
41+
42+
<Cards>
43+
<Card href="https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples">
44+
<Card.Title linkType="external">Aptos Move 示例</Card.Title>
45+
<Card.Description>30+ 个关于如何在 Aptos 上开发 Move 的示例</Card.Description>
46+
</Card>
47+
<Card href="https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples/move-tutorial">
48+
<Card.Title linkType="external">Move 教程</Card.Title>
49+
<Card.Description>涵盖 Move 编程的基础知识</Card.Description>
50+
</Card>
51+
<Card href="guides/first-move-module">
52+
<Card.Title>你的第一个 Move 模块</Card.Title>
53+
<Card.Description>一个 `hello_blockchain` 示例,展示如何发布你的第一个 move 模块</Card.Description>
54+
</Card>
55+
</Cards>
56+
57+
这是一个 `hello_blockchain` 的 move 示例
58+
59+
<RemoteCodeblock
60+
permalink="https://github.com/aptos-labs/aptos-core/blob/77e1d222ebc5e7294e115e0d090c001da1d0e072/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L59"
61+
/>
62+
63+
## ⚒️ 开发者资源
64+
65+
### FAQ 和讨论
66+
67+
- [Aptos 开发者讨论](https://github.com/aptos-labs/aptos-developer-discussions/discussions) 用于 Move 相关的问答。
68+
69+
### Move IDE 插件
70+
71+
- [Aptos Move Analyzer](https://marketplace.visualstudio.com/items?itemName=MoveBit.aptos-move-analyzer) 用于 Visual Studio。
72+
- [JetBrains IDE 的 Move 语言插件](https://plugins.jetbrains.com/plugin/14721-move-language):支持语法高亮、代码导航、重命名、格式化、类型检查和代码生成。
73+
74+
### 外部资源
75+
76+
- [Aptos Move by Example](https://move-developers-dao.gitbook.io/aptos-move-by-example)
77+
- [在 Aptos 上自学 Move](https://github.com/econia-labs/teach-yourself-move)
78+
- [形式化验证、Move 语言和 Move Prover](https://www.certik.com/resources/blog/2wSOZ3mC55AB6CYol6Q2rP-formal-verification-the-move-language-and-the-move-prover)
79+
- [Pontem Move Playground](https://playground.pontem.network/)
80+
- [可嵌套的 Move 资源集合](https://github.com/taoheorg/taohe)
81+
82+
我们有一个新的支持 Move 2 的 Aptos Move 编译器。查看[此页面](smart-contracts/compiler_v2.mdx)了解更多信息。

0 commit comments

Comments
 (0)