What You’ll Build
In this quickstart, you’ll:
Install Sui CLI and tools
Create your first Move package
Write a simple smart contract
Deploy to Sui devnet
Interact with your contract
This tutorial takes approximately 10 minutes to complete.
Prerequisites
Linux (Ubuntu 20.04+)
macOS (12+)
Windows (via WSL2)
Rust 1.75.0 or later
Git for version control
curl for downloading tools
Step 1: Install Sui
Install Rust
If you don’t have Rust installed: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source " $HOME /.cargo/env"
Install Sui CLI
Install Sui from the main branch: cargo install --locked --git https://github.com/MystenLabs/sui.git --branch main sui
This takes 5-10 minutes to compile. For faster installation, download pre-built binaries from the releases page .
Verify Installation
Expected output: sui 1.68.0 or later
Configure Sui Client
Initialize your Sui configuration: This creates a new keypair and connects to devnet by default.
Get Test Tokens
Request SUI tokens from the devnet faucet: Wait ~10 seconds, then verify:
Step 2: Create Your First Move Package
Initialize New Package
sui move new hello_world
cd hello_world
This creates a new Move package with this structure: hello_world/
├── Move.toml
└── sources/
└── hello_world.move
Write Your Smart Contract
Open sources/hello_world.move and replace with: module hello_world :: hello {
use std::string::{ Self , String };
/// A simple object that holds a message
public struct HelloWorld has key {
id: UID ,
message: String ,
}
/// Create a new HelloWorld object
public fun create (message: vector < u8 >, ctx: & mut TxContext ) {
let hello = HelloWorld {
id: object:: new (ctx),
message: string:: utf8 (message),
};
transfer:: share_object (hello);
}
/// Update the message
public fun update (hello: & mut HelloWorld , message: vector < u8 >) {
hello.message = string:: utf8 (message);
}
/// Get the current message
public fun get_message (hello: & HelloWorld ): String {
hello.message
}
}
Build the Package
If successful, you’ll see: BUILDING hello_world
Build Successful
Step 3: Deploy to Devnet
Publish the Package
sui client publish --gas-budget 100000000
The gas budget (0.1 SUI) covers the cost of publishing the package.
Save Package ID
After publishing, you’ll see output like: ╭──────────────────────────────────────────────────╮
│ Object Changes │
├──────────────────────────────────────────────────┤
│ Published Objects: │
│ ┌── │
│ │ PackageID: 0xabcd1234... │
│ └── │
╰──────────────────────────────────────────────────╯
Save this PackageID - you’ll need it to interact with your contract!
Step 4: Interact with Your Contract
Call the Create Function
Replace PACKAGE_ID with your actual package ID: sui client call \
--package PACKAGE_ID \
--module hello \
--function create \
--args "Hello, Sui!" \
--gas-budget 10000000
Find the Object ID
The transaction will create a new HelloWorld object. Look for: Created Objects:
┌──
│ ObjectID: 0x5678abcd...
│ Type: PACKAGE_ID::hello::HelloWorld
└──
Save this ObjectID .
Update the Message
Update the message in your object: sui client call \
--package PACKAGE_ID \
--module hello \
--function update \
--args OBJECT_ID "Hello from Sui blockchain!" \
--gas-budget 10000000
Verify the Update
Query your object to see the updated message: sui client object OBJECT_ID
You’ll see the object data including your message!
What You’ve Learned
Move Basics
Module structure
Object definitions
Public functions
Shared objects
Sui CLI
Build Move packages
Publish to network
Call smart contract functions
Query objects
Object Model
Creating objects with UID
Sharing objects
Mutating object state
Gas & Transactions
Gas budgets
Transaction submission
Object updates
Next Steps
Learn Move Deep dive into Move programming
Build an NFT Create and mint your first NFT
Explore Examples Learn from complete code examples
Use SDKs Integrate with TypeScript or Rust
Troubleshooting
Build fails with 'package not found'
Ensure you’re in the package directory: cd hello_world
sui move build
Publish fails with 'InsufficientGas'
Increase the gas budget: sui client publish --gas-budget 200000000
Or get more test tokens from the faucet.
Add Cargo bin to PATH: export PATH = " $HOME /.cargo/bin: $PATH "
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
Get Help
Documentation Browse the full documentation
Discord Community Ask questions and get help
GitHub Explore the source code
Examples Learn from code examples