LinuxCommandLibrary

sui-client

Interact with the Sui blockchain

TLDR

Create a new address with the ED25519 scheme

$ sui client new-address ed25519 [address-alias]
copy

Create a new testnet environment with an RPC URL and alias
$ sui client new-env --rpc https://fullnode.testnet.sui.io:443 --alias testnet
copy

Switch to the address of your choice (accepts also an alias)
$ sui client switch --address [address-alias]
copy

Switch to the given environment
$ sui client switch --env [env-alias]
copy

Publish a smart contract
$ sui client publish [package-path]
copy

Interact with the Sui faucet
$ sui client faucet [subcommand]
copy

List the gas coins for the given address (accepts also an alias)
$ sui client gas [address]
copy

Create, sign, and execute programmable transaction blocks
$ sui client ptb [options] [subcommand]
copy

SYNOPSIS

sui client [OPTIONS]

PARAMETERS

--config
    Path to the Sui config file. Defaults to ~/.sui/sui_config.toml.

--keystore-path
    Path to the Sui keystore file. Defaults to ~/.sui/sui_config.

--rpc-url
    URL of the Sui RPC endpoint to connect to. Overrides the RPC URL in the config file.

--client-type
    Specify client type.
Possible values:
- wallet-context
- sync (Default)

SUBCOMMAND
    The specific action to perform (e.g., `address`, `move`, `object`, `transfer`, `pay`, `call`, `publish`, `query`, `faucet`). Use `sui client help` for a list of available subcommands.

DESCRIPTION

The `sui-client` command is a crucial tool for interacting with the Sui blockchain. It provides a command-line interface (CLI) for users to perform a wide range of actions, including managing accounts, transferring SUI tokens, inspecting objects on the chain, publishing and calling Move smart contracts, and participating in governance.

Essentially, it acts as your portal to the Sui network, enabling you to build, test, and deploy decentralized applications (dApps) and manage your assets on the Sui blockchain. It can be used for development purposes on a local Sui network or for interacting with the Sui Devnet, Testnet or Mainnet. Configuration files define which Sui network is being targeted. Authentication is achieved through private key based digital signatures.

CAVEATS

The `sui-client` requires a correctly configured Sui environment, including a valid Sui config file and an active connection to a Sui RPC endpoint. Security is paramount; always handle your private keys with extreme care. Misuse of the client can result in loss of funds or unintended consequences.

SUBCOMMANDS

Common subcommands include:
-`address`: Manages Sui addresses and keypairs.
-`move`: Interacts with Move smart contracts (publish, call).
-`object`: Inspects objects on the Sui blockchain.
-`transfer`: Transfers SUI tokens.
-`pay`: Pays coins to addresses.
-`call`: Calls a function on a smart contract.
-`publish`: Publishes a smart contract to the Sui network.
-`query`: Queries events and transactions.
-`faucet`: Requests SUI from the faucet (Devnet only).

Copied to clipboard