This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
[i18n] add zh smart-contracts / create-aptos-dapp #951
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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` | ||
|
|
||
| <Steps> | ||
| ### 导航到您想要工作的目录。 | ||
|
|
||
| ```bash filename="Terminal" | ||
| cd your/workspace | ||
| ``` | ||
|
|
||
| ### 安装 `create-aptos-dapp`。 | ||
|
|
||
| <Tabs items={['npx', 'pnpx', 'yarn', 'pnpm']}> | ||
| <Tabs.Tab> | ||
| ```bash filename="Terminal" | ||
| npx create-aptos-dapp@latest | ||
| ``` | ||
| </Tabs.Tab> | ||
| <Tabs.Tab> | ||
| ```bash filename="Terminal" | ||
| pnpx create-aptos-dapp@latest | ||
| ``` | ||
| </Tabs.Tab> | ||
| <Tabs.Tab> | ||
| ```bash filename="Terminal" | ||
| yarn create aptos-dapp | ||
| ``` | ||
| </Tabs.Tab> | ||
| <Tabs.Tab> | ||
| ```bash filename="Terminal" | ||
| pnpm create create-aptos-dapp@latest | ||
| ``` | ||
| </Tabs.Tab> | ||
| </Tabs> | ||
|
|
||
| ### 按照 CLI 提示操作。 | ||
|
|
||
| 安装后,您需要回答几个关于项目的问题,包括: | ||
| 1. 项目名称 | ||
| 2. 使用哪个模板([见下文](#current-templates)) | ||
| 3. 是使用 Mainnet 还是 Devnet 进行测试 | ||
|
|
||
|  | ||
|
|
||
| </Steps> | ||
|
|
||
| ## 模板 | ||
|
|
||
| `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 命令 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
|
||
| <Cards> | ||
| <Card href="smart-contracts/why-move"> | ||
| <Card.Title>为什么选择 Move?</Card.Title> | ||
| <Card.Description>了解 Aptos 为什么使用 Move 语言</Card.Description> | ||
| </Card> | ||
| {/* <Card href="smart-contracts/prover"> | ||
| <Card.Title>Move Prover</Card.Title> | ||
| <Card.Description>Formal specification and verification of Move contracts on Aptos</Card.Description> | ||
| </Card> */} | ||
| <Card href="smart-contracts/create-package"> | ||
| <Card.Title>创建包</Card.Title> | ||
| <Card.Description>通过学习如何创建 Move 包开始</Card.Description> | ||
| </Card> | ||
| <Card href="smart-contracts/objects"> | ||
| <Card.Title>对象</Card.Title> | ||
| <Card.Description>学习如何在 Aptos 上使用对象标准来创建可组合和灵活的链上原语</Card.Description> | ||
| </Card> | ||
| </Cards> | ||
|
|
||
| ## 👨💻 Move 示例 | ||
|
|
||
| <Cards> | ||
| <Card href="https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples"> | ||
| <Card.Title linkType="external">Aptos Move 示例</Card.Title> | ||
| <Card.Description>30+ 个关于如何在 Aptos 上开发 Move 的示例</Card.Description> | ||
| </Card> | ||
| <Card href="https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples/move-tutorial"> | ||
| <Card.Title linkType="external">Move 教程</Card.Title> | ||
| <Card.Description>涵盖 Move 编程的基础知识</Card.Description> | ||
| </Card> | ||
| <Card href="guides/first-move-module"> | ||
| <Card.Title>你的第一个 Move 模块</Card.Title> | ||
| <Card.Description>一个 `hello_blockchain` 示例,展示如何发布你的第一个 move 模块</Card.Description> | ||
| </Card> | ||
| </Cards> | ||
|
|
||
| 这是一个 `hello_blockchain` 的 move 示例 | ||
|
|
||
| <RemoteCodeblock | ||
| permalink="https://github.com/aptos-labs/aptos-core/blob/77e1d222ebc5e7294e115e0d090c001da1d0e072/aptos-move/move-examples/hello_blockchain/sources/hello_blockchain.move#L1-L59" | ||
| /> | ||
|
|
||
| ## ⚒️ 开发者资源 | ||
|
|
||
| ### 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)了解更多信息。 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing the commented-out 'Move Prover' Card block if it's not intended for future use to reduce clutter.