# DevNet 体验

<mark style="background-color:green;">加入 MoveMove 社区，一起构建 Move 生态</mark>：<https://discord.gg/Vsj7Jwny9G>

## DevNet 环境

{% hint style="info" %}
注意：

该步骤是进去 Docker 容器，容器中已经安装好 Sui，后面的操作都会在 Docker 容器中执行。
{% endhint %}

更新镜像：

```bash
sudo docker pull jiangydev/sui-node:devnet
```

进入 Sui 节点环境：

```bash
sudo docker run --rm -it --name=sui-node jiangydev/sui-node:devnet /bin/bash
```

## 钱包使用

### 激活账户

如果不存在，会创建新账户并提示设置 RPC 接口，最后返回新账户地址：

```shell
sui client active-address
```

{% hint style="info" %}
devnet RPC 接口：<https://gateway.devnet.sui.io:443/>
{% endhint %}

![](/files/vxlCN1mTybaIzeFBceE2)

### 查看账户地址和私钥

{% hint style="info" %} <mark style="color:red;">注意保存地址和私钥！！！</mark>
{% endhint %}

查看账户地址：

```bash
cat /root/.sui/sui_config/client.yaml
```

查看私钥：

```bash
cat /root/.sui/sui_config/sui.keystore
```

### 导入账户

<mark style="color:orange;">如果你没有需要导入的账户，可以跳过这步。</mark>

#### 编辑账户两个文件

需要编辑 `client.yaml` 和 `sui.keystore` 这两个文件，把之前保存的地址和私钥分别添加进去。

{% hint style="info" %}
下面演示修改后的结果，按顺序往后添加即可，注意逗号和双引号。
{% endhint %}

![](/files/VJsFK5hAd0BY5GzAPkPt)

![](/files/sNDUt8Z0PO7CQ18qE8ZK)

#### 切换激活的账户

导入后的账户不是默认的，所以需要设置为默认激活的账户。

```bash
sui client switch --address b26328f2c0fa0f3b8e7ff0b63948a0fa206bf9af
```

#### 切换 devnet RPC

```bash
sui client switch --gateway https://gateway.devnet.sui.io:443/
```

### 获取代币

加入 Discord（<https://discord.gg/sui>），在 #devnet-faucet 频道中获取。

### 余额查看

#### 通过区块浏览器

地址：<https://explorer.devnet.sui.io/>

#### 通过 wallet cli

先查看账户下的资源：

```bash
sui client objects
```

使用上一步对象 ID 继续查看具体的资源明细（余额）：

```bash
sui client object --id 0x06a69315551dcc6dab936b0f7ead467e2a9d7590 --json
```

![](/files/TXjFWzvIJIFVSGsQpn1t)

### 转账

这里演示使用默认账户向 `2a1acbb0300499fb490c5c308756e01485296be6` 转账：

```bash
sui client transfer-coin \
  --to 2a1acbb0300499fb490c5c308756e01485296be6 \
  --coin-object-id 0x06a69315551dcc6dab936b0f7ead467e2a9d7590 \
  --gas-budget 100
```

![](/files/2nzvugGCvKCwXqs7RaAI)

### 创建 NFT

```bash
sui client create-example-nft
```

![](/files/gjsiRaCHkR1532OUYJ6y)

查看 NFT：

<https://explorer.devnet.sui.io/addresses/b26328f2c0fa0f3b8e7ff0b63948a0fa206bf9af>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.sui.movemove.org/jiao-cheng/devnet-ti-yan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
