Skip to content

Commit

Permalink
Updates to install topic (MystenLabs#6208)
Browse files Browse the repository at this point in the history
* updates

* Update install.md

Installed on Windows

* Updates to install

* Updates to install

* Clean up

* More updates

* Update doc/src/build/install.md

* Updates based on review

* Updates based on comments

Co-authored-by: Randall-Mysten <[email protected]>
  • Loading branch information
ronny-mysten and randall-Mysten authored Nov 23, 2022
1 parent 46368e0 commit 773c505
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 71 deletions.
138 changes: 70 additions & 68 deletions doc/src/build/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,69 @@
title: Install Sui to Build
---

Learn how to install and configure Sui.
Learn how to install and configure Sui to develop smart contracts on the Sui blockchain.

Before you install Sui, you need to install some prerequisite tools and then configure your environment.
Before you install Sui, you need to install some prerequisite tools and configure your development environment.

The steps to install Sui include:

1. Install [prerequisites](#prerequisites)
1. [Install Sui binaries](#install-sui-binaries)
1. Configure an [Integrated Development Environment (IDE)](#integrated-development-environment)
1. Request [SUI tokens](#sui-tokens) to evaluate Devnet and Sui Wallet
1. Install [prerequisites](#prerequisites) for your operating system.
1. Install the [Sui binaries](#install-sui-binaries).
1. Configure an [Integrated Development Environment (IDE)](#integrated-development-environment).
1. Request [SUI tokens](#sui-tokens) to evaluate Devnet and Sui Wallet.
1. Optionally, download the [source code](#source-code) to have local
access to examples and contribute to Sui.

## Branches of the Sui repo
## Sui repository

The Sui repo includes two primary branches, `devnet` and `main`.
The Sui repository includes two primary branches, `devnet` and `main`.

* The `devnet` branch includes the latest stable build of Sui. Choose the `devnet` branch if you want to build or test on Sui. If you encounter an issue or find a bug, it may already be fixed in the `main` branch. To submit a Pull Request (PR), you should push commits to your fork of the `main` branch.
* The `main` (Latest build) branch includes the most recent changes and updates. Use the `main` (Latest build) branch if you want to contribute to the Sui project. The `main` branch may include unreleased changes, or introduce changes that cause issues in apps created using an earlier version.
* The `devnet` branch includes the latest stable build of Sui. Choose the `devnet` branch if you want to build or test on Sui. If you encounter an issue or find a bug, it may already be fixed in the `main` branch. To submit a pull request (PR), you should push commits to your fork of the `main` branch.
* The `main` branch includes the most recent changes and updates. Use the `main` branch if you want to contribute to the Sui project. The `main` branch may include unreleased changes, or introduce changes that cause issues in apps created using an earlier version.

## Choose the documentation branch
## Documentation in the Sui repository

This documentation is built from the same branches, `main` and `devnet`. The `main` branch includes the latest additions and updates to the documentation. You can view the content to learn about upcoming updates to the documentation, but the information may not be accurate or up-to-date for the features and functionality available in the `devnet` branch. In most cases, you should view the `devnet` version of the documentation.
The `main` and `devnet` branches of the Sui repository contain the relevant documentation for each branch. A version toggle on the documentation site enables you to switch between `main` branch content (labeled **Latest build**) and `devnet` branch content (labeled **Devnet**). Make sure the toggle is set to **Devnet** for to learn how to install, configure, and build on Sui. The content in **Latest build** is useful to learn about potential updates to Sui, but the features and functionality described might not ever become available in the `devnet` branch.

To change branches, choose **Latest build** to view the documentation generated from the `main` branch of the repository. You should not use the **Latest build** version to learn how to install, configure, or build on Sui, as the information may change before the content is merged to **Devnet**.
## Supported operating systems

## Supported Operating Systems
Sui supports the following operating systems, beginning with the versions indicated.

Sui supports the following operating systems.

* Linux - Ubuntu version 18.04 (Bionic Beaver)
* Linux - Ubuntu version 20.04 (Bionic Beaver)
* macOS - macOS Monterey
* Microsoft Windows - Windows 11

## Prerequisites

Install the prerequisites and tools you need to work with Sui.
Install the prerequisites and tools you need to work with Sui. Click a marker in the table to jump to the relevant section.

| Package/OS | Linux | macOS | Windows 11 |
| --- | :---: | :---: | :---: |
| Curl | X | X | X |
| Rust | X | X | X |
| Git CLI | X | X | X |
| CMake | X | X | X |
| libssl-dev | X | | |
| libclang-dev | X | | |
| Brew | | X | |
| C++ build tools | | | X |
| LLVM Compiler | | | X |
| cURL | [X](#curl) | [X](#curl-1) | [X](#curl-2) |
| Rust and Cargo | [X](#rust-and-cargo) | [X](#rust-and-cargo) | [X](#rust-and-cargo) |
| Git CLI | [X](#git-cli) | [X](#git-cli-1) | [X](#git-cli-2) |
| CMake | [X](#cmake) | [X](#cmake-1) | [X](#cmake-2) |
| libssl-dev | [X](#libssl-dev) | | |
| libclang-dev | [X](#libclang-dev) | | |
| Brew | | [X](#brew) | |
| C++ build tools | | | [X](#additional-tools-for-windows) |
| LLVM Compiler | | | [X](#additional-tools-for-windows) |


### Rust and Cargo

Sui requires Rust and Cargo on all supported operating systems.
Sui requires Rust and Cargo on all supported operating systems. Some operating systems require cURL to download Rust and Cargo, so check the relevant prerequisite section to install cURL first, if necessary.

Use the following command to install Rust:
Use the following command to install Rust and Cargo on macOS or Linux:
```shell
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

For additional installation options, see [Install Rust](https://www.rust-lang.org/tools/install).
Windows 11 users can use the [Rust installer](https://www.rust-lang.org/tools/install) available on the Rust website. The installer detects if you do not have the required C++ build tools and prompts you to install. Select the option that best defines your environment and follow the instructions in the install wizard.

The `rustup` script also installs Cargo.
For additional installation options, see [Install Rust](https://www.rust-lang.org/tools/install) on the Rust website.

Sui uses the latest version of Cargo to build and manage dependencies. See the [Cargo installation](https://doc.rust-lang.org/cargo/getting-started/installation.html) page for more information.
Sui uses the latest version of Cargo to build and manage dependencies. See the [Cargo installation](https://doc.rust-lang.org/cargo/getting-started/installation.html) page on the Rust website for more information.

Use the following command to update Rust:

Expand All @@ -81,7 +79,9 @@ After you install Rust, proceed to the prerequisites for your operating system.

## Linux prerequisites

Take Ubuntu as an example, install the prerequisites listed in this section. You should make sure that your system has the latest version of `apt-get`. Use the following command to update it:
> **Note:** The Linux instructions assume a distribution that uses the APT package manager. Adapt the instructions as needed for other package managers.
Install the prerequisites listed in this section. You should make sure that your system has the latest version of `apt-get`. Use the following command to update `apt-get`:

```shell
$ sudo apt-get update
Expand All @@ -101,29 +101,29 @@ $ curl --version

### Git CLI

Run the following command to install Git, including the Git CLI:
Run the following command to install Git, including the [Git CLI](https://cli.github.com/):

```shell
$ sudo apt-get install git-all
```

For more information, see [Install Git on Linux](https://github.com/git-guides/install-git#install-git-on-linux).
For more information, see [Install Git on Linux](https://github.com/git-guides/install-git#install-git-on-linux) on the GitHub website.

### CMake

Install CMake, see [Install CMake](https://cmake.org/install/)
Install CMake using the instructions at [Installing CMake](https://cmake.org/install/) on the CMake website.

### libssl-dev

use the following command to install `libssl-dev`:
Use the following command to install `libssl-dev`:

```shell
$ sudo apt-get install libssl-dev
```

### libclang-dev

use the following command to install `libclang-dev`:
Use the following command to install `libclang-dev`:

```shell
$ sudo apt-get install libclang-dev
Expand All @@ -134,7 +134,7 @@ Proceed to [Install Sui binaries](#binaries) to continue installing Sui.

## macOS prerequisites

macOS includes a version of cURL. Use cURL to install Brew, and then use Brew to install other tools, including a newer version of cURL.
macOS includes a version of cURL you can use to install Brew. Use Brew to install other tools, including a newer version of cURL.

### Brew

Expand All @@ -145,7 +145,7 @@ $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/

### cURL

Use the following command to install [cURL](https://curl.se):
Use the following command to update the default [cURL](https://curl.se) on macOS:
```shell
$ brew install curl
```
Expand All @@ -164,27 +164,26 @@ Use the following command to install Git:
$ brew install git
```

You can also Download and install the [Git command line interface](https://git-scm.com/download/) for your operating system.
After installing Git, download and install the [Git command line interface](https://git-scm.com/download/).

Proceed to [Install Sui binaries](#install-sui-binaries) to continue installing Sui.


## Windows prerequisites

Install the prerequisites listed in the following section if to work with Sui on Microsoft Windows.
Install the following prerequisites to work with Sui on Microsoft Windows 11.

### cURL

Download and install [cURL](https://curl.se) from https://curl.se/windows/.
Windows 11 ships with a Microsoft version of [cURL](https://curl.se/windows/microsoft.html) already installed. If you want to use the curl project version instead, download and install it from [https://curl.se/windows/](https://curl.se/windows/).

### Git CLI

Download and install the [Git command line interface](https://git-scm.com/download/)
for your operating system.
Download and install the [Git command line interface](https://git-scm.com/download/).

### CMake

Download and install [CMake](https://cmake.org/) from: https://cmake.org/download/
Download and install [CMake](https://cmake.org/download/) from the CMake website.

### Protocol Buffers

Expand All @@ -194,19 +193,19 @@ Download [Protocol Buffers](https://github.com/protocolbuffers/protobuf/releases

Sui requires the following additional tools on computers running Windows.

* For Windows on ARM64 only - [Visual Studio 2022 Preview](https://visualstudio.microsoft.com/vs/preview/)
* [C++ build tools](https://visualstudio.microsoft.com/downloads/)
* The [LLVM Compiler Infrastructure](https://releases.llvm.org/)
* For Windows on ARM64 only - [Visual Studio 2022 Preview](https://visualstudio.microsoft.com/vs/preview/).
* [C++ build tools](https://visualstudio.microsoft.com/downloads/) are required to [install Rust](#rust-and-cargo), so you should already have these installed if you followed these instructions.
* The [LLVM Compiler Infrastructure](https://releases.llvm.org/).

>**Tip:** The installation progress might appear hanging if the `cmd.exe` window loses focus;
>press the `enter` key in the command prompt fix the issue.
>press the `enter` key in the command prompt to fix the issue.
>**Known Issue:** The `sui console` command does not work in PowerShell.
>**Known issue:** The `sui console` command does not work in PowerShell.

## Install Sui binaries

After you install Cargo, use the following command to install Sui binaries:
With Cargo installed, use the following command to install Sui binaries:

```shell
$ cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui
Expand All @@ -215,7 +214,6 @@ $ cargo install --locked --git https://github.com/MystenLabs/sui.git --branch de
The command installs the following Sui components in `~/.cargo/bin`:
* [`sui`](cli-client.md) - The Sui CLI tool contains subcommands for enabling `genesis` of validators and accounts, starting the Sui network, and [building and testing Move packages](move/index.md), as well as a [client](cli-client.md) for interacting with the Sui network.

Trouble shooting:
If the previous command fails, make sure you have the latest version of Rust installed:

```
Expand All @@ -225,39 +223,43 @@ source "$HOME/.cargo/env"

### macOS and Linux

Confirm the binaries are installed with:
Confirm the binaries are installed with `.cargo/bin` appearing in your PATH variable:
```
$ echo $PATH
```
### Windows

Confirm the binaries are installed with:
Confirm the binaries are installed with `.cargo\bin` appearing in your PATH variable:
```
$ echo %PATH%
```
And ensure the `.cargo/bin` directory appears. Access the help for any of these binaries by passing the `--help` argument to it.
Use the `--help` flag to access helpful information for any of these binaries.

> **Important:** Make sure your entire toolchain stays up-to-date. If you encounter issues building and installing the Sui binaries, update all packages and re-install.
> **Important:** Make sure your entire toolchain stays up-to-date. If you encounter issues building and installing the Sui binaries, update all packages above and re-install.
## Integrated development environment

## Integrated Development Environment
For Move development, we recommend the [Visual Studio Code](https://code.visualstudio.com/) IDE with the Move Analyzer language server plugin installed:
The recommended IDE for Move development is [Visual Studio Code](https://code.visualstudio.com/) with the move-analyzer extension. Follow the Visual Studio Marketplace instructions to install the [move-nalyzer extension](https://marketplace.visualstudio.com/items?itemName=move.move-analyzer), passing `address20` using the `--features` flag:

```shell
$ cargo install --git https://github.com/move-language/move move-analyzer --features "address20"
```

Then follow the Visual Studio Marketplace instructions to install the [Move Analyzer extension](https://marketplace.visualstudio.com/items?itemName=move.move-analyzer). (The `cargo install` command for the language server is broken there; hence, we include the correct command above.)

See more [IDE options](https://github.com/MystenLabs/awesome-move#ides) in the [Awesome Move](https://github.com/MystenLabs/awesome-move) docs.
See more [IDE options](https://github.com/MystenLabs/awesome-move#ides) in the [Awesome Move](https://github.com/MystenLabs/awesome-move) documentation.

## SUI tokens

To [experiment with Devnet](../build/devnet.md) or [use the Sui Wallet Browser Extension](../explore/wallet-browser.md), you can add SUI tokens to your account address.
To [experiment with Devnet](../build/devnet.md) or [use the Sui Wallet browser extension](../explore/wallet-browser.md), add SUI tokens to your account address.

To request SUI test tokens from the browser extension:

1. Use the Sui Wallet browser extension to open your wallet.
2. Click the **Request Sui Devnet SUI Tokens** button.

To request SUI test tokens:
To request SUI test tokens in Discord:

1. Join the [Sui Discord](https://discord.com/invite/sui) If you haven’t already.
1. Identify your address through either the Sui Wallet Browser Extension or by running the following command and electing to connect to a Sui RPC server if prompted:
1. Identify your address through either the Sui Wallet browser extension or by running the following command and electing to connect to a Sui RPC server if prompted:
```shell
$ sui client active-address
```
Expand All @@ -269,7 +271,7 @@ To request SUI test tokens:

## Source code

View the Sui repo on GitHub:
View the Sui repository on GitHub:
https://github.com/MystenLabs/sui

Clone the Sui repository:
Expand All @@ -278,7 +280,7 @@ Clone the Sui repository:
$ git clone https://github.com/MystenLabs/sui.git --branch devnet
```

You can start exploring Sui's source code by looking into the following primary directories:
The following primary directories offer a good starting point for exploring Sui's source code:
* [sui](https://github.com/MystenLabs/sui/tree/main/crates/sui) - the Sui CLI binary
* [sui_programmability](https://github.com/MystenLabs/sui/tree/main/sui_programmability) - Sui's Move language integration also including games and other Move code examples for testing and reuse
* [sui_core](https://github.com/MystenLabs/sui/tree/main/crates/sui-core) - authority server and Sui Gateway
Expand All @@ -297,7 +299,7 @@ See the Rust [Crates](https://doc.rust-lang.org/rust-by-example/crates.html) in

To contribute updates to Sui code, [send pull requests](../contribute/index.md#send-pull-requests) our way.

> NOTE: the above `git clone` command syncs with the `devnet` branch, which makes sure the source code is compatible with our Devnet. If you want to run network locally using the latest version and don't need to interact with our Devnet, you should switch to `main` branch.
> **Note:** The previous `git clone` command syncs with the `devnet` branch, which makes sure the source code is compatible with our Devnet. If you want to run a network locally using the latest version and don't need to interact with our Devnet, you should switch to `main` branch.
## Next steps
Expand Down
6 changes: 3 additions & 3 deletions doc/src/learn/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Learn About Sui
title: Learn about Sui
---

*Sui: pronounced "sweet" without the "T" - with Transactions (loads of them), things are SWEET indeed. :-)*
Sui *(swē)* is the water element in Japanese philosophy. The power of the sui element lies in its fluidity---its ability to easily adapt to and transform any environment. Similarly, the Sui platform seeks to provide a flexible network that you can leverage to shape the web3 landscape.

Welcome to the documentation for the Sui platform. Sui is built on the core [Move](https://github.com/MystenLabs/awesome-move) programming language. This documentation assumes that you have a basic working knowledge of Move. To learn more about the differences between core Move and Sui Move, see [How Sui Move differs from core Move](../learn/sui-move-diffs.md).
The Sui platform is built on Sui Move, which is derived from the core [Move](https://github.com/MystenLabs/awesome-move) programming language. This documentation assumes that you have a basic working knowledge of Move. To learn more about the differences between core Move and Sui Move, see [How Sui Move differs from core Move](../learn/sui-move-diffs.md).

For a deep dive into Sui technology, see the [Sui Smart Contracts Platform](https://github.com/MystenLabs/sui/blob/main/doc/paper/sui.pdf) white paper. Find answers to common questions about our [roadmap](https://github.com/MystenLabs/sui/blob/main/DEVX_ROADMAP.md) and more in our [FAQ](../contribute/faq.md).

Expand Down

0 comments on commit 773c505

Please sign in to comment.