Skip to content

Commit

Permalink
fix: update devnet and testnet urls
Browse files Browse the repository at this point in the history
  • Loading branch information
oJshua authored and CriesofCarrots committed May 14, 2021
1 parent ec621e7 commit 7be3171
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ solana config get
例如,要指定 Devnet 集群,请运行:

```bash
solana config set --url https://devnet.solana.com
solana config set --url https://api.devnet.solana.com
```

## 确保版本相匹配
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title: 发送和接收代币
首先,在测试网给您的钱包_空投_ 一些虚拟代币。

```bash
solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url https://devnet.solana.com
solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url https://api.devnet.solana.com
```

其中,用您的 base58-encoded 公钥/钱包地址替换此处的 `<RECIPIENT_ACCOUNT_ADDRESS>`文本。
Expand All @@ -27,7 +27,7 @@ solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url https://devnet.solana.com
通过检查帐户余额确认空投已经成功。 输出值应当为 `10 SOL`:

```bash
solana balance <ACCOUNT_ADDRESS> --url https://devnet.solana.com
solana balance <ACCOUNT_ADDRESS> --url https://api.devnet.solana.com
```

#### 创建第二个钱包地址
Expand All @@ -51,15 +51,15 @@ pubkey: GKvqsuNcnwWqPzzuhLmGi4rzzh55FhJtGizkhHaEJqiV
接下来,通过发送来证明你拥有空投代币。 Solana 集群只有在您用交易发送方公钥对应的私钥签名时,才会接受交易。

```bash
solana transfer --from <KEYPAIR> <RECIPIENT_ACCOUNT_ADDRESS> 5 --url https://devnet.solana.com --fee-payer <KEYPAIR>
solana transfer --from <KEYPAIR> <RECIPIENT_ACCOUNT_ADDRESS> 5 --url https://api.devnet.solana.com --fee-payer <KEYPAIR>
```

其中,用第一个钱包的秘钥对的路径替换 `<KEYPAIR>`,用第二个钱包地址替换 `<RECIPIENT_ACCOUNT_ADDRESS>`

使用 `solana balance` 确认余额已经更新:

```bash
solana balance <ACCOUNT_ADDRESS> --url http://devnet.solana.com
solana balance <ACCOUNT_ADDRESS> --url http://api.devnet.solana.com
```

其中 `<ACCOUNT_ADDRESS>` 是您密钥对的公钥或收件人的公钥。
Expand All @@ -78,11 +78,11 @@ pubkey: DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK #
width enhance concert vacant ketchup eternal spy craft spy guard tag punch # 如果这是一个真实的钱包,不要将这次单词分享到网络上!
==========================================================================

$ solana airdrop 10 DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com # 空投 10 个 SOL 到我的钱包地址/公钥
$ solana airdrop 10 DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://api.devnet.solana.com # 空投 10 个 SOL 到我的钱包地址/公钥
正在从 35.233.193.70:9900 请求 10 SOL
10 SOL

$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com # 检查钱包余额
$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://api.devnet.solana.com # 检查钱包余额
10 SOL

$ solana-keygen new --no-outfile # 创建第二个钱包即纸钱包
Expand All @@ -95,13 +95,13 @@ pubkey: 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv # 这是
clump panic cousin hurt coast charge engage fall eager urge win love # 如果这是一个真实的钱包,切记不要将这次单词分享到网络上!
====================================================================

$ solana transfer --from my_solana_wallet.json 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv 5 --url https://devnet.solana.com --fee-payer my_solana_wallet.json # 发送代币到纸钱包的公钥地址
$ solana transfer --from my_solana_wallet.json 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv 5 --url https://api.devnet.solana.com --fee-payer my_solana_wallet.json # 发送代币到纸钱包的公钥地址
3gmXvykAd1nCQQ7MjosaHLf69Xyaqyq1qw2eu1mgPyYXd5G4v1rihhg1CiRw35b9fHzcftGKKEu4mbUeXY2pEX2z # 该笔交易的签名

$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://devnet.solana.com
$ solana balance DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK --url https://api.devnet.solana.com
4.999995 SOL # 由于需要 0.000005 SOL 的交易费用,发送金额要稍微小于 5 SOL

$ solana balance 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv --url https://devnet.solana.com
$ solana balance 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv --url https://api.devnet.solana.com
5 SOL # 第二个钱包现在已经接收到第一个钱包发送的 5 SOL

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Solana 维护专用的 API 节点来完成 [JSON RPC](developing/clients/jsonrpc

## Devnet(开发者网络)

- `https://devnet.solana.com` - 单个 Solana 托管的 api 节点;限定频率
- `https://api.devnet.solana.com` - 单个 Solana 托管的 api 节点;限定频率

## Testnet(测试网)

- `https://testnet.solana.com` - 单个 Solana 托管的 api 节点;限定频率
- `https://api.testnet.solana.com` - 单个 Solana 托管的 api 节点;限定频率

## Mainnet Beta(主网 Beta)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Solana维护着几个不同用途的集群。
```bash
export SOLANA_METRICS_CONFIG="host=https://metrics.solana.com:8086,db=devnet,u=scratch_writer,p=topsecret"
```
- Devnet RPC URL:`https://devnet.solana.com`
- Devnet RPC URL:`https://api.devnet.solana.com`

##### 示例 `solana` 命令行配置

```bash
solana config set --url https://devnet.solana.com
solana config set --url https://api.devnet.solana.com
```

##### 示例 `solana-validator` 命令行
Expand Down Expand Up @@ -66,12 +66,12 @@ $ solana-validator \
```bash
export SOLANA_METRICS_CONFIG="host=https://metrics.solana.com:8086,db=tds,u=testnet_write,p=c4fa841aa918bf8274e3e2a44d77568d9861b3ea"
```
- Testnet 的 RPC URL: `https://testnet.solana.com`
- Testnet 的 RPC URL: `https://api.testnet.solana.com`

##### 示例 `solana` 命令行配置

```bash
solana config set --url https://testnet.solana.com
solana config set --url https://api.testnet.solana.com
```

##### 示例 `solana-validator` 命令行
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ FLAGS:
OPTIONS:
-d, --data_dir <PATH> Directory to store install data [default: .../Library/Application Support/solana]
-u, --url <URL> JSON RPC URL for the solana cluster [default: http://devnet.solana.com]
-u, --url <URL> JSON RPC URL for the solana cluster [default: http://api.devnet.solana.com]
-p, --pubkey <PUBKEY> Public key of the update manifest [default: 9XX329sPuskWhH4DQh6k16c87dHKhXLBZTL3Gxmve8Gp]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ solana vote-account ~/vote-account-keypair.json

```bash
#与solana-gossip相似,您应该在集群节点列表中看到您的验证节点
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}' http://api.devnet.solana.com
# 如果您的验证节点进行了正确的投票,那么它应该出现在“当前”投票帐户列表中。 如果已经质押,那么`stake` 应当为 > 0
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' http://api.devnet.solana.com
# 返回当前的领导者安排表
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' http://api.devnet.solana.com
# 返回当前 epoch 的信息 slotIndex 应该在随后的调用中获得进展。
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' http://api.devnet.solana.com
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 启动验证程序
Solana cli包含`get``set`配置命令,可自动为cli命令设置`--url`参数。 例如:

```bash
solana config set --url http://devnet.solana.com
solana config set --url http://api.devnet.solana.com
```

尽管本节演示了如何连接到Devnet群集,但其他的[Solana群集](../clusters.md)步骤与此类似。
Expand Down Expand Up @@ -166,7 +166,7 @@ solana config set --keypair ~/validator-keypair.json

```text
Wallet Config Updated: /home/solana/.config/solana/wallet/config.yml
* url: http://devnet.solana.com
* url: http://api.devnet.solana.com
* keypair: /home/solana/validator-keypair.json
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/implemented-proposals/installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ FLAGS:
OPTIONS:
-d, --data_dir <PATH> Directory to store install data [default: .../Library/Application Support/solana]
-u, --url <URL> JSON RPC URL for the solana cluster [default: http://devnet.solana.com]
-u, --url <URL> JSON RPC URL for the solana cluster [default: http://api.devnet.solana.com]
-p, --pubkey <PUBKEY> Public key of the update manifest [default: 9XX329sPuskWhH4DQh6k16c87dHKhXLBZTL3Gxmve8Gp]
```

Expand Down
8 changes: 4 additions & 4 deletions docs/src/running-validator/validator-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ cluster, as well as the health of the cluster:

```bash
# Similar to solana-gossip, you should see your validator in the list of cluster nodes
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}' http://api.devnet.solana.com
# If your validator is properly voting, it should appear in the list of `current` vote accounts. If staked, `stake` should be > 0
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}' http://api.devnet.solana.com
# Returns the current leader schedule
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' http://api.devnet.solana.com
# Returns info about the current epoch. slotIndex should progress on subsequent calls.
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' http://devnet.solana.com
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' http://api.devnet.solana.com
```
4 changes: 2 additions & 2 deletions docs/src/running-validator/validator-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The solana cli includes `get` and `set` configuration commands to automatically
set the `--url` argument for cli commands. For example:

```bash
solana config set --url http://devnet.solana.com
solana config set --url http://api.devnet.solana.com
```

While this section demonstrates how to connect to the Devnet cluster, the steps
Expand Down Expand Up @@ -208,7 +208,7 @@ You should see the following output:

```text
Wallet Config Updated: /home/solana/.config/solana/wallet/config.yml
* url: http://devnet.solana.com
* url: http://api.devnet.solana.com
* keypair: /home/solana/validator-keypair.json
```

Expand Down
2 changes: 1 addition & 1 deletion install/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const JSON_RPC_URL: &str = "http://devnet.solana.com";
pub const JSON_RPC_URL: &str = "http://api.devnet.solana.com";

lazy_static! {
pub static ref CONFIG_FILE: Option<String> = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/solana-install-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ esac

case $URL in
stable)
URL=http://devnet.solana.com
URL=http://api.devnet.solana.com
;;
localhost)
URL=http://localhost:8899
Expand Down
2 changes: 1 addition & 1 deletion stake-accounts/src/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ where
.global(true)
.takes_value(true)
.value_name("URL")
.help("RPC entrypoint address. i.e. http://devnet.solana.com"),
.help("RPC entrypoint address. i.e. http://api.devnet.solana.com"),
)
.subcommand(
SubCommand::with_name("new")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [[ -n "$1" ]]; then
fi

if [[ -z "$url" ]]; then
echo Provide complete URL, ex: "$0" http://devnet.solana.com:8899
echo Provide complete URL, ex: "$0" http://api.devnet.solana.com:8899
exit 1
fi
solana config set --url $url
Expand Down
2 changes: 1 addition & 1 deletion tokens/src/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
.global(true)
.takes_value(true)
.value_name("URL")
.help("RPC entrypoint address. i.e. http://devnet.solana.com"),
.help("RPC entrypoint address. i.e. http://api.devnet.solana.com"),
)
.subcommand(
SubCommand::with_name("distribute-tokens")
Expand Down

0 comments on commit 7be3171

Please sign in to comment.