👨🏻‍💻工作:Web3 产品经理 🏙️城市:香港 🧩性格:INFP 最近在做 GameFi,能赚钱的游戏

Move on Aptos Spring Training Camp Notes | 01 HelloWorld

Note Map: Move on Aptos Spring Training Camp

Environment Installation#

  1. Rust Environment

Verification: Enter cargo in the command line


  1. Aptos Move Environment

Verification: Enter aptos in the command line

Windows Environment Variable Settings

Shortcut win + R, enter sysdm.cpl to open System Properties


Select Advanced, open Environment Variables... at the bottom


Create Project#

  1. Initialize Move Project
aptos move init --name lesson1
  1. Initialize Account
aptos init

Project Structure

│ Move.toml // Project configuration, such as project name, project address, third-party packages

├─ .aptos // Account and project configuration information pointed by the module

│ config.yaml

├─ scripts // Script files used to call modules (used less frequently)

├─ sources // Module folder, modules and tests can be placed here

└─ tests // Test files used to write test cases (used less frequently)


  • private_key: Account private key

  • public_key: Account public key

  • account: Account

  • rest_url: Node address

  • faucet_url: Faucet address

After creating an account, test tokens on the test chain will be automatically received as transaction fees


  • [package]: Project information

  • [addresses]: Address global variables

  • [dev-addresses]: Test address variables

  • [dependencies.AptosFramework]: Dependencies

  • [dev-dependencies]: Test dependencies

Helloworld Project#

Create a main.move file in the sources folder:

module Lesson1::HelloWorld{
    use std::debug::print;
    use std::string::utf8; //Move doesn't support String type, you need to introduce string.

    fun test_hello_world(){
        print(&utf8(b"Hello World")); //
        1. Strings are not recognized and need to be preceded by a b, meaning converted to bytes.
        2. & var, for read-only, & mut var, for readable and writable

Important notes have been written in the comments, even Chinese characters cannot be written in the comments, otherwise compilation errors will occur.

Save the code and compile it with aptos init

Run it with aptos move test


The console will output Hello World


Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.