Skip to content

Commit

Permalink
Consolidate and promote Devnet to Build section, move down CLI Client…
Browse files Browse the repository at this point in the history
… to Contribute (MystenLabs#4009)
  • Loading branch information
Clay-Mysten authored Aug 16, 2022
1 parent 9f72754 commit d3f4690
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 39 deletions.
2 changes: 1 addition & 1 deletion crates/sui-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This directory contains examples of interacting with a Move language smart contr

#### 1. Prepare the environment
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. [Connect to Sui Devnet](https://github.com/MystenLabs/sui/blob/main/doc/src/explore/devnet.md).
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
Expand Down
33 changes: 4 additions & 29 deletions doc/src/build/cli-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,14 @@ command line interface. In this document, we describe how to set up
the Sui client and execute commands through its command line
interface, *Sui CLI*.

Note, this is an advanced option and an alternative to simply connecting to our public
[Devnet](../explore/devnet.md). Use Devnet to build upon Sui. Use the Sui CLI here to
[contribute](../contribute/index.md) to Sui itself.

## Set up

Follow the instructions to [install Sui binaries](install.md#binaries).

## Connect to Devnet
We are hosting a public [Devnet](../explore/devnet.md) for the community to
experiment with our tech and help to shape the future of the Sui network. To
connect the Sui client to the Devnet, run the following command:
```shell
$ sui client
```
The Sui CLI will print the following line if the client is starting up the
first time.
```shell
Config file ["/Users/dir/.sui/sui_config/client.yaml"] doesn't exist, do you want to connect to a Sui RPC server [y/n]?
```
Type 'y' and then press 'Enter'. You should see the following output:
```shell
Sui RPC server Url (Default to Sui Devnet if not specified) :
```
The Sui client will prompt for the RPC server URL; press 'Enter' and it will default to Devnet.
Or enter a custom URL if you want to connect to a server hosted elsewhere.
If you have used the Sui client before with a local network, follow the next section to
[manually change the RPC server URL](#manually-change-the-rpc-server-url) to Devnet.
### Manually change the RPC server URL
If you have used the Sui client before, you will have an existing `client.yaml` configuration
file. Change the configured RPC server URL to Devnet by using:
```shell
$ sui client switch --gateway https://gateway.devnet.sui.io:443
```
## Genesis

The `genesis` command creates four validators and five user accounts
Expand Down
32 changes: 29 additions & 3 deletions doc/src/explore/devnet.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
title: Experiment with Sui Devnet
title: Connect to Sui Devnet
---

Welcome to the beginnings of the Sui Devnet. It exists now to gain operational experience with the Sui software in a public setting. The Sui Devnet currently consists of:
Welcome to the Sui Devnet. We are hosting a public Devnet for the community to experiment with our tech and help to shape the future of the Sui network. It exists to gain operational experience with the Sui software in a public setting prior to our Mainnet launch.

To instead [contribute](../contribute/index.md) to Sui itself, you may experiment with the advanced [Sui CLI client](../build/cli-client.md) at the command line.


The Sui Devnet currently consists of:

* A four-validator network with all nodes operated by Mysten Labs. Clients send transactions and read requests via this endpoint: gateway.devnet.sui.io:443 using [JSON-RPC](../build/json-rpc.md)
* A public network [Sui Explorer](https://github.com/MystenLabs/sui/tree/main/explorer/client#readme) for browsing transaction history: https://explorer.devnet.sui.io
Expand Down Expand Up @@ -43,7 +48,28 @@ In addition, to conduct advanced work such as publishing a Move module or making

### Set up Sui CLI client, connect to gateway

Now [set up your Sui CLI client and connect to Devnet](../build/cli-client.md#connect-to-devnet) in a single step. Note you can [manually change the Gateway URL](../build/cli-client.md#manually-change-the-rpc-server-url) if you have already configured a Sui CLI client.
Now set up your Sui CLI client and connect to Devnet. Note you can manually change the Gateway URL if you have already configured a Sui CLI client.

To connect the Sui client to the Devnet, run the following command:
```shell
$ sui client
```
The Sui CLI will print the following line if the client is starting up for the first time:
```shell
Config file ["/Users/dir/.sui/sui_config/client.yaml"] doesn't exist, do you want to connect to a Sui RPC server [y/n]?
```
Type `y` and then press `Enter`. You should see the following output:
```shell
Sui RPC server Url (Default to Sui Devnet if not specified) :
```
The Sui client will prompt for the RPC server URL; press 'Enter' and it will default to Devnet.
Or enter a custom URL to connect to a server hosted elsewhere.
If you have used the Sui client before with a local network, you will have an existing `client.yaml` configuration
file needing update. Change the configured RPC server URL to Devnet by using:
```shell
$ sui client switch --gateway https://gateway.devnet.sui.io:443
```
> **Tip:** If you run into issues, reset the Sui configuration by removing its directory, by default located at `~/.sui/sui_config`. Then reinstall [Sui binaries](../build/install.md#binaries).
Expand Down
12 changes: 6 additions & 6 deletions doc/src/navconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"fileName": "build/install"
},
{
"label": "Use Sui CLI to Start Network",
"fileName": "build/cli-client"
"label": "Connect to Sui Devnet",
"fileName": "explore/devnet"
},
{
"label": "Create Smart Contracts with Move",
Expand Down Expand Up @@ -209,10 +209,6 @@
"label": "Wallet in Browser",
"fileName": "explore/wallet-browser"
},
{
"label": "Devnet",
"fileName": "explore/devnet"
},
{
"label": "Tutorial",
"fileName": "explore/tutorials"
Expand All @@ -239,6 +235,10 @@
"label": "Frequently Asked Questions",
"fileName": "contribute/faq"
},
{
"label": "Sui CLI and Local Network",
"fileName": "build/cli-client"
},
{
"label": "Logging",
"fileName": "contribute/observability"
Expand Down

0 comments on commit d3f4690

Please sign in to comment.