Aptos Move Getting Started Tutorial

In this tutorial, you will learn how to build a dapp on the Aptos blockchain. dapps usually consist of a graphical user interface and one or more Move modules. This tutorial will use the Move module described in Your First Move Modulehello_blockchain, and focus on building the user interface around the module. We will use the following tools and resources:

  • TypeScript SDK
  • Petra Wallet
  • Aptos CLI
  • Full source code

Before you begin, you will need a Chrome extension wallet that interacts with the dapp, such as the Petra wallet extension. If you haven't installed the Petra wallet extension before, follow these steps:

  1. Open your wallet and click "Create a new wallet".
  2. Click "Create account" to create an Aptos account.
  3. Copy the private key, which you will use in the next step to set up the Aptos CLI.
  4. Refer to the user guide on petra.app for help.
  5. In the wallet, switch to Devnet network, click "Settings", "Network", and then select "devnet".
  6. Click on the "faucet" button to make sure you can receive the test tokens.

If you already have a Petra wallet installed, create a new one for this tutorial. In the extension, click on "Settings", "Switch account", "Add account", "Create new account" to create a new account. Then switch to the Devnet network and click the "faucet" button to make sure you can receive test tokens.

Next, we will install the Aptos CLI in order to publish and interact with the Move module. Please follow the steps below:

  1. Install the Aptos CLI.
  2. (of a computer) runaptos init --profile my-first-nftThe
  3. Select NetworkdevnetThe
  4. When prompted for a private key, paste the private key from the Petra wallet and press Enter.

This will initialize the Aptos CLI to use the same accounts as the Aptos wallet. Run theaptos account list --profile my-first-nftTo verify that the setup was successful, you should add the following to all events of theaddrfield to see your account land.

Next, we will set up the front-end user interface of dapp. In this tutorial, we will use thecreate-react-appto set up the application. Please follow the steps below:

  1. Go to your project root directory and create a newmoveCatalog.
  2. Access to the projectmovedirectory and runaptos move init --name my_todo_listThe

This command will be executed in themovedirectory to create asources/directory and aMove.tomlDocumentation. YourmoveThe catalog should now look like the following:

move
├── Move.toml
└── sources
    └─ YOUR_CONTRACT_FILE.move

Now you can edit theMove.tomlfiles and Move module files, Move modules are smart contracts written in the Move language, and you can compile and publish Move modules using the Aptos CLI and then interact with them using the Remix IDE plug-in.

All of the above content is reproduced from the Internet, does not represent the position of AptosNews, is not investment advice, investment risk, the market need to be cautious, such as infringement, please contact the administrator to delete.

Like (0)
Donate WeChat Sweep WeChat Sweep Alipay Sweep Alipay Sweep
Previous November 14, 2023 at 7:58 pm
Next November 18, 2023 at 7:33 pm

Related posts

Leave a Reply

Please Login to Comment
WeChat Sweep
Baidu Sweep

Subscribe to AptosNews

Subscribe to AptosNews to stay on top of Aptos.


This will close in 0 seconds

This site has no investment advice, investment risk, the market needs to be cautious.