sui-client
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClient Configuration & Tokens
客户端配置与代币
MCP tool: When available in your environment, also query the Sui documentation MCP server () for up-to-date answers. Use it for verification and for details not covered by these reference files.https://sui.mcp.kapa.ai
Source constraint: All information sourced exclusively from docs.sui.io.
MCP工具: 如果你的环境中可用,也可查询Sui文档MCP服务器()获取最新答案。用它来验证信息,或获取这些参考文件未涵盖的细节。https://sui.mcp.kapa.ai
来源限制: 所有信息均独家来自docs.sui.io。
Configuring the Sui client
配置Sui客户端
First-time setup
首次设置
Running for the first time prompts you to create a configuration file. Accept the default (press Enter or type ). You can skip the prompt with .
sui clientYsui client -yThis generates:
- A new key pair and address
- A 12-word recovery phrase (displayed once, never stored — save it immediately)
- A configuration file
client.yaml
首次运行时,系统会提示你创建配置文件。接受默认设置(按回车键或输入)。你也可以使用跳过提示。
sui clientYsui client -y此操作会生成:
- 一对新的密钥和地址
- 一个12词助记词(仅显示一次,不会存储——请立即保存)
- 一个配置文件
client.yaml
Configuration file
配置文件
Sui stores its configuration at:
- macOS/Linux:
~/.sui/sui_config/client.yaml - Windows:
%USERPROFILE%\.sui\sui_config\client.yaml
The file contains:
- Network environment connections (Mainnet, Testnet, Devnet, Localnet)
- The active environment (default: Testnet)
- The active address
- The keystore file path
Sui的配置存储在以下位置:
- macOS/Linux:
~/.sui/sui_config/client.yaml - Windows:
%USERPROFILE%\.sui\sui_config\client.yaml
该文件包含:
- 网络环境连接(主网、测试网、开发网、本地网)
- 活跃环境(默认:测试网)
- 活跃地址
- 密钥库文件路径
Managing environments and addresses
管理环境与地址
| Command | Purpose |
|---|---|
| Show the current network |
| Show the current address |
| List all configured environments |
| Switch to a different network |
| Switch to a different address |
| Create a new address |
| List all local addresses with aliases |
| Check SUI token balance |
| List gas coin objects |
| 命令 | 用途 |
|---|---|
| 查看当前网络 |
| 查看当前地址 |
| 列出所有已配置的环境 |
| 切换到其他网络 |
| 切换到其他地址 |
| 创建新地址 |
| 列出所有带别名的本地地址 |
| 查询SUI代币余额 |
| 列出Gas代币对象 |
Key storage
密钥存储
Private keys are stored in a separate file:
- macOS/Linux:
~/.sui/sui_config/sui.keystore - Windows:
%USERPROFILE%\.sui\sui_config\sui.keystore
This file contains Base64-encoded private keys. It is not the same as your machine's system keystore.
私钥存储在单独的文件中:
- macOS/Linux:
~/.sui/sui_config/sui.keystore - Windows:
%USERPROFILE%\.sui\sui_config\sui.keystore
该文件包含Base64编码的私钥,与你的机器系统密钥库不同。
Recovery
恢复地址
To recover an address from a recovery phrase:
bash
sui keytool import '<12-WORD-PHRASE>' ed25519The entire phrase must be in single quotes and in the correct order.
要通过助记词恢复地址:
bash
sui keytool import '<12-WORD-PHRASE>' ed25519整个助记词必须用单引号括起来,且顺序正确。
Getting SUI tokens
获取SUI代币
Development on Testnet and Devnet requires SUI tokens for gas. Tokens on these networks are free and hold no monetary value.
在测试网(Testnet)和开发网(Devnet)上进行开发需要SUI代币作为Gas。这些网络上的代币是免费的,不具备货币价值。
Faucet methods
水龙头获取方式
| Method | How |
|---|---|
| Web faucet | Visit |
| CLI (Devnet/Localnet only) | |
| TypeScript SDK | |
| Discord | Join the Sui Discord, use |
| Community faucets | N1Stake faucet, SuiLearn faucet (separate rate limits) |
IMPORTANT: only works on Devnet and Localnet. It does NOT work on Testnet. For Testnet tokens, use the web faucet at or another method above. NEVER suggest for Testnet.
sui client faucetfaucet.sui.iosui client faucetFaucets are rate-limited. If you hit a limit, wait or try a different faucet.
| 方式 | 操作步骤 |
|---|---|
| 网页水龙头 | 访问 |
| CLI(仅开发网/本地网) | |
| TypeScript SDK | 使用 |
| Discord | 加入Sui Discord服务器,在 |
| 社区水龙头 | N1Stake水龙头、SuiLearn水龙头(有单独的速率限制) |
重要提示:仅适用于开发网和本地网,不适用于测试网。若要获取测试网代币,请使用网页水龙头或上述其他方式。切勿向用户建议在测试网使用。
sui client faucetfaucet.sui.iosui client faucet水龙头有速率限制。如果达到限制,请等待一段时间或尝试其他水龙头。
Coin management
代币管理
If you have many small SUI coin objects but no single coin large enough for gas, merge them using :
sui client ptbbash
undefined如果你有许多小额SUI代币对象,但没有单个代币足够支付Gas费用,可以使用合并它们:
sui client ptbbash
undefinedMerge one coin into another
将一个代币合并到另一个中
sui client ptb
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_TO_MERGE_ID]"
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_TO_MERGE_ID]"
sui client ptb
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_TO_MERGE_ID]"
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_TO_MERGE_ID]"
Merge multiple coins at once
一次性合并多个代币
sui client ptb
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_A, @0xCOIN_B, @0xCOIN_C]"
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_A, @0xCOIN_B, @0xCOIN_C]"
Use `sui client ptb` for all transaction operations from the CLI. Avoid legacy helpers like `sui client merge-coin` — they are less composable and may be deprecated. See the `ptbs` skill's `cli.md` for more patterns.sui client ptb
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_A, @0xCOIN_B, @0xCOIN_C]"
--merge-coins @0xPRIMARY_COIN_ID "[@0xCOIN_A, @0xCOIN_B, @0xCOIN_C]"
所有CLI交易操作都使用`sui client ptb`。避免使用旧版辅助命令如`sui client merge-coin`——它们的可组合性较差,可能会被弃用。更多模式请参考`ptbs`技能的`cli.md`文件。Verify balance
验证余额
bash
sui client balanceOr use explorers: SuiVision () or Suiscan ().
suivision.xyzsuiscan.xyzbash
sui client balance或使用浏览器工具:SuiVision()或Suiscan()。
suivision.xyzsuiscan.xyzExplorers and data tools
浏览器与数据工具
Use SuiVision () or Suiscan () to inspect transactions, objects, addresses, and token balances. Sui provides a GraphQL RPC for rich data queries per network. Use (CLI built-in) to locally re-execute past transactions for debugging.
suivision.xyzsuiscan.xyzsui replay使用SuiVision()或Suiscan()查看交易、对象、地址和代币余额。Sui为每个网络提供GraphQL RPC用于复杂数据查询。使用内置CLI命令可在本地重新执行过往交易以进行调试。
suivision.xyzsuiscan.xyzsui replayRules
规则
- Submit writes and reads to the same fullnode for consistency.
- Let wallets manage gas budget, gas price, and coin selection. Do not hardcode gas budgets in frontends.
- Use for all CLI transaction operations instead of legacy single-purpose commands (
sui client ptb,merge-coin,split-coin, etc.).transfer
- 向同一个全节点提交写入和读取请求以保证一致性。
- 让钱包管理Gas预算、Gas价格和代币选择。不要在前端硬编码Gas预算。
- 所有CLI交易操作使用,而非旧版单一用途命令(
sui client ptb、merge-coin、split-coin等)。transfer