命令行领水

本文将介绍使用Sui CLI命令和curl命令领取测试代币的方法。

CLI领水

  • 查看所在网络
$ sui client envs
  • 切换网络

若不是测试网或开发网进行切换。

$ sui client switch --env xxx
  • 执行领水命令
$ sui client faucet
Request successful. It can take up to 1 minute to get the coin. Run sui client gas to check your gas coins.
  • 查看领水结果
$ sui client gas --json
[
  {
    "gasCoinId": "0xb12724820ac35687458d97f2bfabb56ae77dc89140dc24918cf3afc6d0c76c1a",
    "mistBalance": 1000000000,
    "suiBalance": "1.00"
  }
]

curl命令领水

curl命令仅在开发网可以领水,请求格式如下:

curl --location --request POST 'https://faucet.devnet.sui.io/gas' \
--header 'Content-Type: application/json' \
--data-raw '{
    "FixedAmountRequest": {
        "recipient": "<YOUR SUI ADDRESS>"
    }
}'