From 3bf1ec501e4d66e7062d516fcf8fc58038493cef Mon Sep 17 00:00:00 2001 From: Frank Yang Date: Tue, 14 May 2019 01:56:57 +0800 Subject: [PATCH] Merge PR #4334: Align cn-doc to 7558f760 (2019-05-13) and fix some typo of en-doc --- docs/clients/service-providers.md | 9 +- docs/cosmos-hub/gaiacli.md | 4 +- .../cn/clients/service-providers.md | 11 +- .../cn/cn-translation-progress.md | 6 +- docs/translations/cn/cosmos-hub/gaiacli.md | 125 ++++++++++++++---- .../cn/cosmos-hub/installation.md | 10 +- 6 files changed, 116 insertions(+), 49 deletions(-) diff --git a/docs/clients/service-providers.md b/docs/clients/service-providers.md index b31c2d9be6..f89e379376 100644 --- a/docs/clients/service-providers.md +++ b/docs/clients/service-providers.md @@ -63,20 +63,19 @@ gaiacli account Here is the command to send coins via the CLI: ```bash -gaiacli tx send \ - --chain-id= \ - --from= +gaiacli tx send \ + --chain-id= ``` Parameters: -- ``: Address of the recipient. +- ``: Key name or address of sending account. +- ``: Address of the recipient. - ``: This parameter accepts the format ``, such as `10faucetToken`. Flags: - `--chain-id`: This flag allows you to specify the id of the chain. There will be different ids for different testnet chains and main chain. -- `--from`: Name of the key of the sending account. #### Help diff --git a/docs/cosmos-hub/gaiacli.md b/docs/cosmos-hub/gaiacli.md index 9ef76ff5c6..681bcbd2bb 100644 --- a/docs/cosmos-hub/gaiacli.md +++ b/docs/cosmos-hub/gaiacli.md @@ -19,7 +19,7 @@ First, set up the address of the full-node you want to connect to: ```bash gaiacli config node : 以下是通过 CLI 发送代币的命令: ```bash -gaiacli tx send \ - --chain-id= \ - --from= +gaiacli tx send \ + --chain-id= ``` 参数: -- ``: 接收者地址。 +- ``: 发送账户的名称或地址。 +- ``: 接收者地址。 - ``: 接受``格式的参数,例如 `10faucetToken`。 标识: -- `--chain-id`: This flag allows you to specify the id of the chain. There will be different ids for different testnet chains and main chain. -- `--from`: Name of the key of the sending account. +- `--chain-id`: 此标志允许您指定链的ID,不同的testnet链和主链会有不同的 id。 #### 帮助 diff --git a/docs/translations/cn/cn-translation-progress.md b/docs/translations/cn/cn-translation-progress.md index 0283dc269f..2df8b3078f 100644 --- a/docs/translations/cn/cn-translation-progress.md +++ b/docs/translations/cn/cn-translation-progress.md @@ -26,11 +26,11 @@ Please refer to the official english version of the documentation for the latest ### [`cosmos-hub`](../cosmos-hub/) -- Synced until commit [36dcd7b7](https://github.com/cosmos/cosmos-sdk/commit/36dcd7b7ad94cf59a8471506e10b937507d1dfa5) +- Synced until commit [7558f760](https://github.com/cosmos/cosmos-sdk/commit/7558f7607918b6337a8b58b8f956d6776f503138) (2019-05-13) ### [`intro`](../intro/) -- Synced until commit [160928b8](https://github.com/cosmos/cosmos-sdk/commit/160928b8f3586a2674cca136891e2cc15d4232d9) +- Synced until commit [7558f760](https://github.com/cosmos/cosmos-sdk/commit/7558f7607918b6337a8b58b8f956d6776f503138) (2019-05-13) ### [`modules`](../modules/) @@ -38,5 +38,5 @@ Please refer to the official english version of the documentation for the latest ### [`clients`](../clients/) -- Synced until Commit [dfe58f8d]() +- Synced until Commit [7558f760](https://github.com/cosmos/cosmos-sdk/commit/7558f7607918b6337a8b58b8f956d6776f503138) (2019-05-13) diff --git a/docs/translations/cn/cosmos-hub/gaiacli.md b/docs/translations/cn/cosmos-hub/gaiacli.md index 3091d5d2e1..7b0f909f43 100644 --- a/docs/translations/cn/cosmos-hub/gaiacli.md +++ b/docs/translations/cn/cosmos-hub/gaiacli.md @@ -2,25 +2,41 @@ ## Gaia CLI -::: 注意 -如果你收到了下面这条错误消息: +`gaiacli`是一个工具,使您能够与 Cosmos Hub 网络中的节点进行交互,无论您是否自己运行它。 让我们恰当的设置它。 要安装它,请按照[安装步骤](./ installation.md)进行安装。 + +### 配置 gaiacli + +设置`gaiacli`的主要命令如下: ```bash -Must specify these options: --chain-id when --trust-node is false +gaiacli config ``` -你必须选择是否要验证轻客户端的证明。如果你信任要查询的节点,则可以简单地传递`--trust-node=true` -- 否则你需要指定`--chain-id`。 -::: +该命令能为每个标志设置默认值。 -`gaiacli`是管理 Cosmos 测试网上的帐户和交易的命令行操作界面。它的配置文件位于`$HOME/.gaiacli/config/config.toml`中,可以手动编辑或通过`gaiacli config`命令编辑: +首先,设置要连接的全节点的地址: ```bash -gaiacli config chain-id gaia-9004 +gaiacli config node : ``` -::: warning 注意 +::: warning Note 当你查询余额为零的帐户时,你将收到以下错误:`No account with address was found in the state.` 如果你在节点与区块链完全同步之前就查询,也会发生这种情况。这些都很正常。 ::: -#### 发送 token +#### 发送 Token 你可以通过如下命令从一个账户发送资金到另一个账户: @@ -169,11 +185,11 @@ gaiacli tx send 10faucetToken \ --from= ``` -::: warning 注意 +::: warning Note `--amount`标识接收格式:`--amount=` ::: -::: tip 注意 +::: tip Note 你可能希望通过`--gas`标识限制交易可以消耗的最大燃料。如果你通过`--gas=auto`,将在执行交易前自动估gas。gas估算可能是不准确的,因为状态变化可能发生在模拟结束和交易的实际执行之间,因此在原始估计之上应用调整以确保能够成功地广播交易。可以通过`--gas-adjustment`标识控制调整,其默认值为1.0。 ::: @@ -215,7 +231,7 @@ gaiacli tx sign \ unsignedSendTx.json > signedSendTx.json ``` -::: tip 注意 +::: tip Note 标识 `--generate-only` 只能在访问本地 keybase 时使用。 ::: @@ -329,7 +345,7 @@ gaiacli query staking validators gaiacli query staking validator ``` -#### 绑定token +#### 绑定 Token 在Cosmos Hub主网中,我们绑定`uatom`,`1atom = 1000000uatom`。你可以把token绑定在一个测试网验证人节点上(即委托): @@ -367,7 +383,7 @@ gaiacli query staking delegations 你还可以通过添加`--height`标识来获取先前的委托状态。 -#### 解绑token +#### 解绑 Token 如果出于一些原因验证人行为异常,或者你想解绑一定数量的token,请使用以下命令。 ```bash @@ -493,21 +509,74 @@ gaiacli query delegations-to #### 创建一个治理提案 -要创建治理提案,你必须提交初始存款以及提案详细信息: -+ `title` : 提案的标题 -+ `description` : 提案的描述 -+ `type` : 提案类型。值必须是 *Text*(目前还不支持*SoftwareUpgrade*和*ParameterChange*类型)。 +要创建治理提案,您必须提交初始抵押以及标题和说明。治理之外的其它模块可以实现自己的提议类型和处理程序(例如:参数更改),其中治理模块本身支持`Text`提议。治理之外的任何模块都将命令绑定在`submit-proposal`上。 + +提交一个文本类型的提案: ```bash gaiacli tx gov submit-proposal \ --title= \ --description=<description> \ - --type=<Text/ParameterChange/SoftwareUpgrade> \ + --type="Text" \ --deposit="1000000uatom" \ --from=<name> \ --chain-id=<chain_id> ``` +您也可以直接通过`--proposal`指向包含提案的 JSON 文件。 + +要提交更改参数的提案,您必须提供提案文件,因为其内容对 CLI 输入不太友好: + +```bash +gaiacli tx gov submit-proposal param-change <path/to/proposal.json> \ + --from=<name> \ + --chain-id=<chain_id> +``` + +其中`proposal.json`包含以下内容: + +```json +{ + "title": "Param Change", + "description": "Update max validators", + "changes": [ + { + "subspace": "staking", + "key": "MaxValidators", + "value": 105 + } + ], + "deposit": [ + { + "denom": "stake", + "amount": "10000000" + } + ] +} +``` + +::: danger Warning + +Currently parameter changes are _evaluated_ but not _validated_, so it is very important +that any `value` change is valid (ie. correct type and within bounds) for its +respective parameter, eg. `MaxValidators` should be an integer and not a decimal. + +Proper vetting of a parameter change proposal should prevent this from happening +(no deposits should occur during the governance process), but it should be noted +regardless. + +目前,参数更改已经过*评估*但未*经过验证*,因此`value`对于其相应参数,任何更改都是有效的(即正确类型和边界内)非常重要,例如 `MaxValidators` 应该是整数而不是小数。 + +正确审查参数变更提案应该可以防止这种情况发生(在治理过程中不会发生抵押),但无论如何都应该注意。 + +::: + +::: tip Note + +目前不支持`SoftwareUpgrade`,因为它没有实现,目前与`Text`提议的语义没有区别。 + +::: + #### 查询提案 一旦创建,你就可以查询提案的信息: @@ -752,10 +821,10 @@ gaiad completion --zsh > gaiad_completion gaiacli completion --zsh > gaiacli_completion ``` -::: 注意 +::: tip Note 在大多数UNIX系统上,可以在`.bashrc`或`.bash_profile`中加载此类脚本以启用Bash自动完成: -``` +```bash echo '. gaiad_completion' >> ~/.bashrc echo '. gaiacli_completion' >> ~/.bashrc ``` diff --git a/docs/translations/cn/cosmos-hub/installation.md b/docs/translations/cn/cosmos-hub/installation.md index 0085955b6d..5c0bba93e2 100644 --- a/docs/translations/cn/cosmos-hub/installation.md +++ b/docs/translations/cn/cosmos-hub/installation.md @@ -15,15 +15,15 @@ echo "export GO111MODULE=on" >> ~/.bash_profile source ~/.bash_profile ``` -::: 提示 +::: tip Cosmos SDK需要安装**Go 1.12.4+** ::: ### 安装二进制执行程序 -接下来,安装最新版本的Gaia。这里我们使用`master`分支,包含了最新的稳定发布版本。如果需要,请通过`git checkout`命令确定是正确的[发布版本](https://github.com/cosmos/cosmos-sdk/releases)。 +接下来,安装最新版本的Gaia。需要确认您 `git checkout 了正确的[发布版本](https://github.com/cosmos/cosmos-sdk/releases)。 -::: 警告 +::: warning 对于主网,请确保你的版本大于或等于`v0.33.0` ::: @@ -31,7 +31,7 @@ Cosmos SDK需要安装**Go 1.12.4+** mkdir -p $GOPATH/src/github.com/cosmos cd $GOPATH/src/github.com/cosmos git clone https://github.com/cosmos/cosmos-sdk -cd cosmos-sdk && git checkout master +cd cosmos-sdk && git checkout <latest-release-tag> make tools install ``` @@ -64,4 +64,4 @@ build tags指定了可执行程序具有的特殊特性。 | ledger | 支持Ledger设备(硬件钱包) | ### 接下来 -然后你可以选择 加入公共测试网 或是 创建私有测试网。 +然后你可以选择 加入[主网](./join-mainnet.md)、[公共测试网](./join-testnet.md) 或是 [创建私有测试网](./deploy-testnet.md)。