From 207a8c7bf4d63fec5a39b17bb1ddaff035915563 Mon Sep 17 00:00:00 2001 From: Clay-Mysten <100217682+Clay-Mysten@users.noreply.github.com> Date: Tue, 26 Jul 2022 08:34:58 -0700 Subject: [PATCH] Edit Rust SDK README (#3487) * Edit Rust SDK README * Add reciprocal link --- crates/sui-sdk/README.md | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/crates/sui-sdk/README.md b/crates/sui-sdk/README.md index 79108a6520510..0524d34539e68 100644 --- a/crates/sui-sdk/README.md +++ b/crates/sui-sdk/README.md @@ -1,38 +1,42 @@ # Rust SDK examples -Examples of interacting with the move contract using the Sui Rust SDK. +This directory contains examples of interacting with a Move language smart contract using the Sui Rust SDK. See the [introduction to the Rust SDK](https://github.com/MystenLabs/sui/blob/main/doc/src/build/rust-sdk.md) for additional details. ## Tic Tac Toe ### Demo quick start #### 1. Prepare the environment - * Install `sui` and `rpc-server` binaries following the [installation doc](https://github.com/MystenLabs/sui/blob/main/doc/src/build/install.md#binaries). - * [Connect to devnet](https://github.com/MystenLabs/sui/blob/main/doc/src/build/cli-client.md#connect-to-devnet). - * Make sure you have two addresses with gas, you can use the new-address command to create new addresses `sui client new-address`, - you can skip this step if you are going to play with a friend :) - * [Request gas tokens](https://github.com/MystenLabs/sui/blob/main/doc/src/explore/devnet.md#request-gas-tokens) for all addresses that will be used to join the game. + 1. Install `sui` and `rpc-server` binaries following the [Sui installation](https://github.com/MystenLabs/sui/blob/main/doc/src/build/install.md#binaries) docs. + 1. [Connect to Sui Devnet](https://github.com/MystenLabs/sui/blob/main/doc/src/build/cli-client.md#connect-to-devnet). + 1. [Make sure you have two addresses with gas](https://github.com/MystenLabs/sui/blob/main/doc/src/build/cli-client.md#adding-accounts-to-the-client) by using the `new-address` command to create new addresses: + ```shell + sui client new-address + ``` + You can skip this step if you are going to play with a friend. :) + 1. [Request Sui tokens](https://github.com/MystenLabs/sui/blob/main/doc/src/build/install.md#sui-tokens) for all addresses that will be used to join the game. #### 2. Publish the move contract - * [Download the Sui source code](https://github.com/MystenLabs/sui/blob/main/doc/src/build/install.md#source-code) - * Publish the [`games` package](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/games) - using the Sui client and copy down the package object ID. + 1. [Download the Sui source code](https://github.com/MystenLabs/sui/blob/main/doc/src/build/install.md#source-code). + 1. Publish the [`games` package](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/games) + using the Sui client: ```shell sui client publish --path /path-to-sui-source-code/sui_programmability/examples/games --gas-budget 10000 ``` + 1. Record the package object ID. #### 3. Create a new tic-tac-toe game - * run the following command in the sui source code folder to start a new game. + 1. Run the following command in the Sui source code directory to start a new game, replacing the game package objects ID with the one you recorded: ```shell cargo run --example tic-tac-toe -- --game-package-id <> new-game ``` - this will create a game for the first two addresses in your keystore by default. If you want to specify the identity of each player, -you can use the following command + This will create a game for the first two addresses in your keystore by default. If you want to specify the identity of each player, +use the following command and replace the variables with the actual player's addresses: ```shell cargo run --example tic-tac-toe -- --game-package-id <> new-game --player-x <> --player-o <> ``` - * Copy the game id and pass it to your friend to join the game. + 1. Copy the game ID and pass it to your friend to join the game. #### 4. Joining the game - * run the following command in the sui source code folder to join the game. - ```shell - cargo run --example tic-tac-toe -- --game-package-id <> join-game --my-identity <
> --game-id <> - ``` \ No newline at end of file +Run the following command in the Sui source code directory to join the game, replacing the game ID and address accordingly: +```shell +cargo run --example tic-tac-toe -- --game-package-id <> join-game --my-identity <
> --game-id <> +```