Skip to content

Commit

Permalink
[docs] Make location of Sui configuration more explicit (MystenLabs#933)
Browse files Browse the repository at this point in the history
* [docs] Make locatio of Sui configuration more explicit

* Removed a line that did not make much sense anymore

* Added clarification on the location of the games source code

* Addressed a review comment
  • Loading branch information
awelc authored Mar 18, 2022
1 parent a764ad1 commit 7ccfb12
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 19 deletions.
8 changes: 4 additions & 4 deletions doc/src/build/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ dependencies. As a prerequisite, you will need to [install
Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
version 1.59.0 or higher in order to build and install Sui on your machine.

If you'd like to install only Sui binaries (`sui`, `wallet`, and
`sui-move`), use the following command:
If you'd like to install only Sui binaries (`sui`, `wallet`,
`sui-move`, and `rest_server`), use the following command:

```shell
cargo install --git https://git@github.com/MystenLabs/sui.git
cargo install --git https://github.com/MystenLabs/sui.git
```

Alternatively, clone the [Sui
Expand All @@ -23,5 +23,5 @@ git clone https://github.com/MystenLabs/sui.git
cargo install --path sui/sui
```

In both cases, this will install `sui`, `wallet`, and `sui-move`
In both cases, this will install `sui`, `wallet`, `sui-move`, and `rest_server`
binaries in a `~/.cargo/bin` directory that can be executed directly.
36 changes: 30 additions & 6 deletions doc/src/build/wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ interface, *Wallet CLI*.

## Setup

Follow the instructions to [install Sui binaries](install.md).
Follow the instructions to [install Sui binaries](install.md). Then
create a directory where your Sui configuration files will live - let
us name this directory `sui_instance` and let us assume that it lives
in another directory designated by the `$SUI_ROOT` environment
variable:

```shell
cd "$SUI_ROOT"
mkdir sui_instance
```

## Genesis

```shell
cd "$SUI_ROOT"/sui_instance
sui genesis
```
NOTE: For logs, set `RUST_LOG=debug` before invoking `sui genesis`.
Expand Down Expand Up @@ -109,14 +120,21 @@ implement more secure key management and support hardware signing in a future re
Run the following command to start the local Sui network:

```shell
cd "$SUI_ROOT"/sui_instance
sui start
```

or
You can also run this command in any directory if you provide a path
to the directory where Sui configuration files are stored:

```shell
sui start --config [config file path]
sui start --config "$SUI_ROOT"/sui_instance
```

Executing any of these two commands in a terminal window will result
in no output but the terminal will be "blocked" by the running Sui
instance (it will not return the command prompt).

NOTE: For logs, set `RUST_LOG=debug` before invoking `sui start`.

The network config file path defaults to `./network.conf` if not
Expand All @@ -143,16 +161,18 @@ The wallet can be started in two modes: interactive shell or command line interf

### Interactive shell

To start the interactive shell:
To start the interactive shell, execute the following (in a different terminal window than one used to execute `sui start`):

```shell
cd "$SUI_ROOT"/sui_instance
wallet
```

or
You can also run this command in any directory if you provide a path
to the directory where Sui configuration files are stored:

```shell
wallet --config [config file path]
wallet --config "$SUI_ROOT"/sui_instance
```

The wallet config file path defaults to `./wallet.conf` if not
Expand All @@ -176,6 +196,10 @@ The wallet can also be used without the interactive shell, which can be useful i
you want to pipe the output of the wallet to another application or invoke wallet
commands using scripts.

**For the remainder of this tutorial we will assume that you are
executing the `wallet` command in a directory where the Sui
configuration files are stored (`"$SUI_ROOT"/sui_instance`).**

```shell
USAGE:
wallet --no-shell [SUBCOMMAND]
Expand Down
25 changes: 16 additions & 9 deletions doc/src/explore/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ In this tutorial, we demonstrate an end-to-end process of starting a Sui network

## Setup

Follow the instructions to [install Sui binaries](../build/install.md).
Follow the instructions to [install Sui
binaries](../build/install.md) and clone the repository as
described in the installation instructions as this tutorial assumes
that you have a clone of Sui's repository.


Then follow the instructions to [create
Sui genesis](../build/wallet.md#genesis) by running the `sui genesis`
command.
Expand All @@ -16,17 +21,19 @@ by running the `sui start` command. After completing
these steps, you will have a running local Sui instance and the
`wallet` command used in the remainder of this tutorial in your path.

Please make sure that you run the `wallet` command in the directory
where wallet configuration is located or by passing wallet's
configuration file as a parameter, as described in the `wallet`
[command description](../build/wallet.md#using-the-wallet).
We will follow the same convention as the one described in the [Sui
setup instructions](../build/wallet.md#setup) and assume that Sui
configuration files generated durind Sui genesis state creation are
stored in the `"$SUI_ROOT"/sui_instance` directory, and **for the
remainder of this tutorial we will assume that you are executing the
`wallet` command in this directory**.


## Gather Accounts and Gas Objects
Now switch to a new terminal window (keep the above running).

First take a look at the account addresses we own in our wallet:
```
$ ./wallet --no-shell addresses
$ wallet --no-shell addresses
Showing 5 results.
ECF53CE22D1B2FB588573924057E9ADDAD1D8385
7B61DA6AACED7F28C1187D998955F10464BEAE55
Expand Down Expand Up @@ -77,9 +84,9 @@ export O_GAS=2110ADFB7BAF889A05EA6F5889AF7724299F9BED
```

## Publish the TicTacToe game on Sui
We implemented a TicTacToe game in [TicTacToe.move](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/games/sources/TicTacToe.move). To publish the game, we run the publish command and specify the path to the game package:
We implemented a TicTacToe game in [TicTacToe.move](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/games/sources/TicTacToe.move). To publish the game, we run the publish command and specify the path to the game package. As described in the earlier [setup section](#setup), we assume that Sui repository was cloned locally - let us further assume that it was cloned into `"$SUI_ROOT"/sui` directory.
```
$ wallet --no-shell publish --path ../../sui_programmability/examples/games --gas $ADMIN_GAS --gas-budget 30000
$ wallet --no-shell publish --path "$SUI_ROOT"/sui/sui_programmability/examples/games --gas $ADMIN_GAS --gas-budget 30000
----- Certificate ----
Signed Authorities : ...
Transaction Kind : Publish
Expand Down

0 comments on commit 7ccfb12

Please sign in to comment.