LinuxCommandLibrary

sui-move

Compile and manage Sui Move smart contracts

TLDR

Create a new Move project in the given folder

$ sui move new [project_name]
copy

Test the Move project in the current directory
$ sui move test
copy

Test with coverage and get a summary
$ sui move test --coverage; sui move coverage summary
copy

Find which parts of your code are covered from tests (i.e. explain coverage results)
$ sui move coverage source --module [module_name]
copy

Build the Move project in the current directory
$ sui move build
copy

Build the Move project from the given path
$ sui move build --path [path]
copy

Migrate to Move 2024 for the package at the provided path
$ sui move migrate [path]
copy

SYNOPSIS

"sui-move" is not a direct command. It refers to subcommands under sui client move.

General Usage:
sui client move <subcommand> [options] [arguments]

Examples:
sui client move publish [options] <path-to-package>
(Publishes a Move package)

sui client move call [options] --package <package-id> --module <module-name> --function <function-name> --args <arg1> [<arg2> ...]
(Calls a function on a deployed Move module)

PARAMETERS

--gas-budget [AMOUNT]
    Sets the maximum gas amount (in Sui MIST) to be used for the transaction. This is a crucial parameter to prevent excessive transaction fees.

--sender [ADDRESS]
    Specifies the sender's Sui address for the transaction. This address must be managed by the current client profile.

--gas-object [OBJECT_ID]
    Provides the ID of a specific gas object to be used for transaction fees. If not specified, the client will attempt to find a suitable gas object automatically.

--package [PACKAGE_ID]
    (For 'call' subcommand) The object ID of the deployed Move package containing the target module and function.

--module [MODULE_NAME]
    (For 'call' subcommand) The name of the Move module within the specified package.

--function [FUNCTION_NAME]
    (For 'call' subcommand) The name of the function to be invoked within the specified module.

--args [ARG1 ARG2 ...]
    (For 'call' subcommand) A list of arguments to pass to the Move function. Arguments must be formatted according to Move's type system (e.g., '10u64', '0x...::module::Type', 'true').

--json
    Outputs the transaction response or command result in JSON format, useful for scripting and programmatic interactions.

-y, --yes
    Bypasses all interactive confirmation prompts, automatically assuming 'yes' to proceed with the operation. Use with caution.

DESCRIPTION

The term "sui-move" does not refer to a standalone Linux command in the traditional sense. Instead, it conceptualizes a group of commands within the Sui blockchain client (sui client) that interact with Move smart contracts. The Move language is a secure and robust programming language designed for writing smart contracts on blockchain platforms like Sui.

These sui client move subcommands allow users and developers to perform essential operations such as publishing new Move packages (smart contracts) to the Sui network, calling specific functions within deployed Move modules, disassembling Move bytecode for inspection, and more. It's a core component for developing and managing decentralized applications (dApps) on the Sui blockchain.

CAVEATS

It is critical to understand that "sui-move" is not a standalone executable or a universal Linux command. Its functionality is exclusively tied to the Sui blockchain ecosystem and requires the Sui client CLI to be installed and configured. Users looking for general file movement should use the standard Linux mv command.

OFFICIAL SUI DOCUMENTATION

For comprehensive and up-to-date information on the Sui blockchain, the Sui client CLI, and Move development, refer to the official Sui documentation portal, which provides detailed guides, API references, and tutorials.

HISTORY

The Move programming language was originally developed by Meta (formerly Facebook) for its Diem (Libra) blockchain project. After Diem was discontinued, Move found new life in independent blockchain projects, including Sui, developed by Mysten Labs. The `sui client move` commands are integral to Sui's design, enabling direct interaction with its smart contract layer, leveraging Move's security and expressiveness for asset management and decentralized applications.

SEE ALSO

sui client CLI (The official command-line interface for the Sui blockchain), Move programming language (The smart contract language used on Sui), mv(1) (The standard Linux command for moving or renaming files and directories, distinct from 'sui-move')

Copied to clipboard