diff --git a/pages/common/sui-client-faucet.md b/pages/common/sui-client-faucet.md new file mode 100644 index 000000000..d128e4a58 --- /dev/null +++ b/pages/common/sui-client-faucet.md @@ -0,0 +1,16 @@ +# sui client faucet + +> Interact with the Sui faucet. +> More information: . + +- Get a SUI coin from the faucet associated with the active network: + +`sui client faucet` + +- Get a SUI coin for the address (accepts also an alias): + +`sui client faucet --address {{address}}` + +- Get a SUI coin from custom faucet: + +`sui client faucet --url {{custom-faucet-url}}` diff --git a/pages/common/sui-client-ptb.md b/pages/common/sui-client-ptb.md new file mode 100644 index 000000000..9652bb165 --- /dev/null +++ b/pages/common/sui-client-ptb.md @@ -0,0 +1,24 @@ +# sui client ptb + +> Create, sign and execute programmable transaction blocks. +> More information: . + +- Call a Move function from a package and module: + +`sui client ptb --move-call p::m::f "<{{type}}>" args` + +- Make a Move vector with two elements of type u64: + +`sui client ptb --make-move-vec "" "[1000,2000]"` + +- Split a gas coin and transfer it to address: + +`sui client ptb --split-coins gas "[1000]" --assign new_coins --transfer-objects "[new_coins]" @{{address}}` + +- Transfer an object to an address: + +`sui client ptb --transfer-objects "[{{object_id}}]" @{{address}}` + +- Publish a Move package, and transfer the upgrade capability to sender: + +`sui client ptb --move-call sui::tx_context::sender --assign sender --publish "." --assign upgrade_cap --transfer-objects "[upgrade_cap]" sender` diff --git a/pages/common/sui-client.md b/pages/common/sui-client.md new file mode 100644 index 000000000..d1e38fa1f --- /dev/null +++ b/pages/common/sui-client.md @@ -0,0 +1,36 @@ +# sui client + +> Publish smart contracts, get object information, execute transactions, and more. +> More information: . + +- Create a new address with the ED25519 scheme: + +`sui client new-address ed25519 {{address-alias}}` + +- Create a new testnet environment with an RPC URL and alias: + +`sui client new-env --rpc https://fullnode.testnet.sui.io:443 --alias testnet` + +- Switch to the address of your choice (accepts also an alias): + +`sui client switch --address {{address-alias}}` + +- Switch to the given environment: + +`sui client switch --env {{env-alias}}` + +- Publish a smart contract: + +`sui client publish {{package-path}}` + +- Interact with the Sui faucet: + +`sui client faucet {{subcommand}}` + +- List the gas coins for the given address (accepts also an alias): + +`sui client gas {{address}}` + +- Create, sign, and execute programmable transaction blocks: + +`sui client ptb {{options}} {{subcommand}}` diff --git a/pages/common/sui-move.md b/pages/common/sui-move.md new file mode 100644 index 000000000..406c1ffc1 --- /dev/null +++ b/pages/common/sui-move.md @@ -0,0 +1,32 @@ +# sui move + +> Work with Move source code. +> More information: . + +- Create a new Move project in the given folder: + +`sui move new {{project_name}}` + +- Test the Move project in the current directory: + +`sui move test` + +- Test with coverage and get a summary: + +`sui move test --coverage; sui move coverage summary` + +- Find which parts of your code are covered from tests (i.e. explain coverage results): + +`sui move coverage source --module {{module_name}}` + +- Build the Move project in the current directory: + +`sui move build` + +- Build the Move project from the given path: + +`sui move build --path {{path}}` + +- Migrate to Move 2024 for the package at the provided path: + +`sui move migrate {{path}}` diff --git a/pages/common/sui.md b/pages/common/sui.md new file mode 100644 index 000000000..88ca6ae8e --- /dev/null +++ b/pages/common/sui.md @@ -0,0 +1,24 @@ +# sui + +> Interact with the Sui network. +> More information: . + +- Execute a Sui subcommand: + +`sui {{subcommand}}` + +- Build tools for a smart contract: + +`sui move {{subcommand}}` + +- Publish smart contracts, get object information, execute transactions and more: + +`sui client {{subcommand}}` + +- Start a local network: + +`sui start` + +- Update from source: + +`cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui`