diff --git a/apps/nextra/pages/zh/build/create-aptos-dapp.mdx b/apps/nextra/pages/zh/build/create-aptos-dapp.mdx new file mode 100644 index 000000000..bb40ad466 --- /dev/null +++ b/apps/nextra/pages/zh/build/create-aptos-dapp.mdx @@ -0,0 +1,94 @@ +--- +title: "create-aptos-dapp" +--- + +import { Tabs, Steps } from 'nextra/components' + +# create-aptos-dapp + +`create-aptos-dapp` 为 dapp 开发者构建了一个模板项目,可以轻松地在 Aptos 网络上创建前端和智能合约。 + +## 为什么使用 create-aptos-dapp? + +- **模板化设置**:`create-aptos-dapp` 为您生成预定义的端到端 dapp 模板和配置文件。它节省了手动设置项目结构的时间,这个过程可能既耗时又容易出错。 +- **合约目录**:`create-aptos-dapp` 生成一个包含 Move 智能合约模块基本结构的 `contract` 目录。 +- **最佳实践**:`create-aptos-dapp` 包含了为 Aptos 网络开发的最佳实践和结构建议。 +- **内置 Move 命令**:`create-aptos-dapp` 包含用于常见任务的内置命令,例如初始化 Move 编译器、编译和在链上发布智能合约。 + +## 前提条件 + +- [node 和 npm](https://nodejs.org/en) (npm ≥ 5.2.0) +- [Python 3.6+](https://www.python.org/) + +## 使用 `create-aptos-dapp` + + +### 导航到您想要工作的目录。 + +```bash filename="Terminal" +cd your/workspace +``` + +### 安装 `create-aptos-dapp`。 + + + + ```bash filename="Terminal" + npx create-aptos-dapp@latest + ``` + + + ```bash filename="Terminal" + pnpx create-aptos-dapp@latest + ``` + + + ```bash filename="Terminal" + yarn create aptos-dapp + ``` + + + ```bash filename="Terminal" + pnpm create create-aptos-dapp@latest + ``` + + + +### 按照 CLI 提示操作。 + +安装后,您需要回答几个关于项目的问题,包括: +1. 项目名称 +2. 使用哪个模板([见下文](#current-templates)) +3. 是使用 Mainnet 还是 Devnet 进行测试 + +![cad](/docs/cad-video.gif) + + + +## 模板 + +`create-aptos-dapp` 为您提供预制的端到端 dapp 模板,即一个配置好的 dapp,包含配置和美观的 UI,让您可以快速开始在 Aptos 上创建 dapp。 + +这些模板的目标是: + +1. 通过提供端到端 dapp 模板示例,让用户熟悉不同的 Aptos 标准。 +2. 教育用户如何从前端层到智能合约层在 Aptos 上构建 dapp,以及中间的所有环节。 +3. 为用户提供预制模板,以快速部署简单的 dapp。 + +### 当前模板 +所有当前模板都可以在 [Aptos Learn](https://learn.aptoslabs.com/en/dapp-templates) 上找到。以下是具体模板的详细信息: + +- [Boilerplate Template](https://learn.aptoslabs.com/en/dapp-templates/boilerplate-template) +- [NFT minting dapp Template](https://learn.aptoslabs.com/en/dapp-templates/nft-minting-template) +- [Token minting dapp Template](https://learn.aptoslabs.com/en/dapp-templates/token-minting-template) +- [Token staking dapp Template](https://learn.aptoslabs.com/en/dapp-templates/token-staking-template) +- [Custom indexer template](https://learn.aptoslabs.com/en/dapp-templates/custom-indexer-template) + +## `create-aptos-dapp` 使用的工具 + +- React 框架 +- Vite 开发工具 +- shadcn/ui + tailwind 用于样式 +- Aptos TS SDK +- Aptos Wallet Adapter +- 基于 Node 的 Move 命令 \ No newline at end of file diff --git a/apps/nextra/pages/zh/build/smart-contracts.mdx b/apps/nextra/pages/zh/build/smart-contracts.mdx new file mode 100644 index 000000000..ecacd8e58 --- /dev/null +++ b/apps/nextra/pages/zh/build/smart-contracts.mdx @@ -0,0 +1,82 @@ +--- +title: "智能合约" +--- + +import { RemoteCodeblock, permalinkFetch, Card, Cards } from '@components/index' +import { Callout } from 'nextra/components' + +export async function getStaticProps() { + return await permalinkFetch([ + 'https://github.com/aptos-labs/aptos-core/blob/77e1d222ebc5e7294e115e0d090c001da1d0e072/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L59' + ]) +} + +# Aptos 上的智能合约 + +Aptos 合约使用 Move 语言编写,这是一种用于安全、沙盒化和形式化验证编程的下一代语言,被多个区块链采用。 +Move 允许开发者编写灵活管理和转移资产的程序,同时为这些资产提供安全性和攻击防护。 + +## 📖 学习 Move + + + + 为什么选择 Move? + 了解 Aptos 为什么使用 Move 语言 + + {/* + Move Prover + Formal specification and verification of Move contracts on Aptos + */} + + 创建包 + 通过学习如何创建 Move 包开始 + + + 对象 + 学习如何在 Aptos 上使用对象标准来创建可组合和灵活的链上原语 + + + +## 👨‍💻 Move 示例 + + + + Aptos Move 示例 + 30+ 个关于如何在 Aptos 上开发 Move 的示例 + + + Move 教程 + 涵盖 Move 编程的基础知识 + + + 你的第一个 Move 模块 + 一个 `hello_blockchain` 示例,展示如何发布你的第一个 move 模块 + + + +这是一个 `hello_blockchain` 的 move 示例 + + + +## ⚒️ 开发者资源 + +### FAQ 和讨论 + +- [Aptos 开发者讨论](https://github.com/aptos-labs/aptos-developer-discussions/discussions) 用于 Move 相关的问答。 + +### Move IDE 插件 + +- [Aptos Move Analyzer](https://marketplace.visualstudio.com/items?itemName=MoveBit.aptos-move-analyzer) 用于 Visual Studio。 +- [JetBrains IDE 的 Move 语言插件](https://plugins.jetbrains.com/plugin/14721-move-language):支持语法高亮、代码导航、重命名、格式化、类型检查和代码生成。 + +### 外部资源 + +- [Aptos Move by Example](https://move-developers-dao.gitbook.io/aptos-move-by-example) +- [在 Aptos 上自学 Move](https://github.com/econia-labs/teach-yourself-move)。 +- [形式化验证、Move 语言和 Move Prover](https://www.certik.com/resources/blog/2wSOZ3mC55AB6CYol6Q2rP-formal-verification-the-move-language-and-the-move-prover) +- [Pontem Move Playground](https://playground.pontem.network/) +- [可嵌套的 Move 资源集合](https://github.com/taoheorg/taohe) + +我们有一个新的支持 Move 2 的 Aptos Move 编译器。查看[此页面](smart-contracts/compiler_v2.mdx)了解更多信息。 \ No newline at end of file