Setup Development Environment
Welcome to the Sui Move introduction course. In this first unit, we will walk you through the process of setting up the development environment for working with Sui Move, and create a basic Hello World project as a gentle introduction into the world of Sui.
Install Sui Binaries Locally
-
Install Sui binaries
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet suiChange the branch target here to
testnetormainnetif you are targeting one of those.Linux Users: The installation process will create build artifacts in /tmp directory. If you encountered
disk out of spacerelated issues during installation. Make sure to expand your tmpfs to at least 11GB.To check your tmpfs usage on Linux systems: df /tmp You can expand the tmpfs by editing the `/etc/fstab` file and setting the size of tmpfs to 20G: tmpfs /tmp tmpfs noatime,size=20G,mode=1777 0 0 -
Check binaries are installed successfully:
sui --versionYou should see the version number in the terminal if sui binaries were installed successfully.
Using a Docker Image with Pre-installed Sui Binaries
-
Pull Sui official docker image
docker pull mysten/sui-tools:devnet -
Start and shell into the Docker container:
docker run --name suidevcontainer -itd mysten/sui-tools:devnetdocker exec -it suidevcontainer bash
💡Note: If the above Docker image is not compatible with your CPU architecture, you can start with a base Rust Docker image appropriate for your CPU architecture, and install the Sui binaries and prerequisites as described above.
(Optional) Configure VS Code with Move Analyzer Plug-in
-
Install Move Analyzer plugin from VS Marketplace
-
Add compatibility for Sui style wallet addresses:
cargo install --git https://github.com/move-language/move move-analyzer --features "address20"
Sui CLI Basic Usage
Initialization
- Enter
Yfordo you want to connect to a Sui Full node server?and pressEnterto default to Sui Devnet full node - Enter
0for key scheme selection to chooseed25519
Managing Networks
- Switching network:
sui client switch --env [network alias] - Default network aliases:
- localnet: http://0.0.0.0:9000
- devnet: https://fullnode.devnet.sui.io:443
- List all current network aliases:
sui client envs - Add new network alias:
sui client new-env --alias <ALIAS> --rpc <RPC>- Try adding a testnet alias with:
sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
- Try adding a testnet alias with:
Check Active Address and Gas Objects
- Check current addresses in key store:
sui client addresses - Check active-address:
sui client active-address - List all controlled gas objects:
sui client gas
Get Devnet or Testnet Sui Tokens
- Join Sui Discord
- Complete verification steps
- Enter
#devnet-faucetchannel for devnet tokens, or#testnet-faucetchannel for testnet tokens - Type
!faucet <WALLET ADDRESS>