Skip to content

Commit

Permalink
Update docs/translations/cn/cosmos-hub to 36dcd7b (cosmos#4211)
Browse files Browse the repository at this point in the history
Update Chinese documents of cosmos-hub to 0e54369.

Remove non-Chinese blogs.

Fix some typo of English documents of cosmos-hub.

Rename gaia to cosmos-hub
  • Loading branch information
Frank Yang authored and Alessio Treglia committed Apr 29, 2019
1 parent 36dcd7b commit df2e0bf
Show file tree
Hide file tree
Showing 22 changed files with 622 additions and 67 deletions.
8 changes: 4 additions & 4 deletions docs/cosmos-hub/gaiacli.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ gaiacli tx send <sender_address> <recipient_address> 10faucetToken \
```bash
gaiacli tx sign \
--chain-id=<chain_id> \
--from=<key_name>
--from=<key_name> \
unsignedSendTx.json > signedSendTx.json
```
Expand Down Expand Up @@ -733,7 +733,7 @@ For example, given a multisig key comprising the keys `p1`, `p2`, and `p3`, each
by a distinct party, the user holding `p1` would require to import both `p2` and `p3` in order to
generate the multisig account public key:
```
```bash
gaiacli keys add \
p2 \
--pubkey=cosmospub1addwnpepqtd28uwa0yxtwal5223qqr5aqf5y57tc7kk7z8qd4zplrdlk5ez5kdnlrj4
Expand Down Expand Up @@ -781,7 +781,7 @@ gaiacli tx sign \
unsignedTx.json \
--multisig=<multisig_address> \
--from=p1 \
--output-document=p1signature.json \
--output-document=p1signature.json
```
Once the signature is generated, `p1` transmits both `unsignedTx.json` and
Expand All @@ -793,7 +793,7 @@ gaiacli tx sign \
unsignedTx.json \
--multisig=<multisig_address> \
--from=p2 \
--output-document=p2signature.json \
--output-document=p2signature.json
```
`p1p2p3` is a 2-of-3 multisig key, therefore one additional signature
Expand Down
2 changes: 1 addition & 1 deletion docs/cosmos-hub/genesis.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Genesis File

This document explains how the genesis file of the Cosmmos Hub mainnet is structured. It also explains how you can build a genesis file for your own `gaia` testnet.
This document explains how the genesis file of the Cosmos Hub mainnet is structured. It also explains how you can build a genesis file for your own `gaia` testnet.

Note that you can generate a default genesis file for your own testnet by running the following command:

Expand Down
2 changes: 1 addition & 1 deletion docs/cosmos-hub/ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The funds stored in an account are controlled by the private key. This private k
At the core of a Ledger device, there is a mnemonic that is used to generate private keys. When you initialize you Ledger, a mnemonic is generated.

::: danger
**Do not lose or share your 12 words with anyone. To prevent theft or loss of funds, it is best to ensure that you keep multiple copies of your mnemonic, and store it in a safe, secure place and that only you know how to access. If someone is able to gain access to your mnemonic, they will be able to gain access to your private keys and control the accounts associated with them.**
**Do not lose or share your 24 words with anyone. To prevent theft or loss of funds, it is best to ensure that you keep multiple copies of your mnemonic, and store it in a safe, secure place and that only you know how to access. If someone is able to gain access to your mnemonic, they will be able to gain access to your private keys and control the accounts associated with them.**
:::

This mnemonic is compatible with Cosmos accounts. The tool used to generate addresses and transactions on the Cosmos Hub network is called `gaiacli`, which supports derivation of account keys from a Ledger seed. Note that the Ledger device acts as an enclave of the seed and private keys, and the process of signing transaction takes place within it. No private information ever leaves the Ledger device.
Expand Down
4 changes: 2 additions & 2 deletions docs/translations/cn/cn-translation-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Please refer to the official english version of the documentation for the latest

- ToDo

### [`gaia`](../gaia/)
### [`cosmos-hub`](../cosmos-hub/)

- Synced until commit [9e7440a9](https://github.com/cosmos/cosmos-sdk/commit/9e7440a92c14187b05a3064864899f708a507d82)
- Synced until commit [36dcd7b7](https://github.com/cosmos/cosmos-sdk/commit/36dcd7b7ad94cf59a8471506e10b937507d1dfa5)

### [`intro`](../intro/)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Must specify these options: --chain-id when --trust-node is false
你必须选择是否要验证轻客户端的证明。如果你信任要查询的节点,则可以简单地传递`--trust-node=true` -- 否则你需要指定`--chain-id`
:::

`gaiacli`是管理Cosmos测试网上的帐户和交易的命令行操作界面。它的配置文件位于`$HOME/.gaiacli/config/config.toml`中,可以手动编辑或通过`gaiacli config`命令编辑:
`gaiacli`是管理 Cosmos 测试网上的帐户和交易的命令行操作界面。它的配置文件位于`$HOME/.gaiacli/config/config.toml`中,可以手动编辑或通过`gaiacli config`命令编辑:

```bash
gaiacli config chain-id cosmoshub-1
gaiacli config chain-id gaia-9004
```

有关命令用法的更多信息,请参阅其帮助信息:`gaiacli config --help`
Expand Down Expand Up @@ -112,26 +112,32 @@ gaiacli keys add --multisig=baz,foo,bar --multisig-threshold=2 multisig_address
gaiacli keys show --multisig-threshold K name1 name2 name3 [...]
```

有关如何生成多签帐户,使用其签名和广播多签交易的详细信息,请参阅[多签交易]()
有关如何生成多签帐户,使用其签名和广播多签交易的详细信息,请参阅[多签交易](#多签交易)

### fee和gas
### Tx 广播

每笔交易可能会提供fee或gas price,但不能同时提供。大多数用户通常会提供fee,因为这是你将为最终被记入帐本中的交易提供的费用
在广播交易时,`gaiacli`接受`--broadcast-mode`标识。 这个标识的值可以是`sync`(默认值)、`async``block`,其中`sync`使客户端返回 CheckTx 响应,`async`使客户端立即返回,而`block`使得 客户端等待 tx 被提交(或超时)

验证人可以配置最低gas price(多币种的),并且在决定它们是否能被包含在区块中的`CheckTx`期间使用改值,其中 `gasPrices >= minGasPrices`。请注意,你的交易必须提供大于或等于验证人要求的任何接受币种的费用
值得注意的是,在大多数情况下****应该使用`block`模式。 这是因为广播可以超时但是 tx 仍然可能存在在块中,这可能导致很多不良结果。 因此,最好使用`sync``async`并通过 tx hash 查询以确定 tx 何时包含在块中

注意:有了这样的机制,验证人可能会开始在mempool中通过gasPrice来优先处理某些txs,因此提供更高fee或gas price可能会产生更高的tx优先级。
### Fees 和 Gas

每笔交易可能会提供 fees 或 gas price,但不能同时提供。

验证人可以配置最低 gas price(多币种的),并且在决定它们是否能被包含在区块中的`CheckTx`期间使用改值,其中 `gasPrices >= minGasPrices`。请注意,你的交易必须提供大于或等于验证人要求的任何接受币种的费用。

**注意**:有了这样的机制,验证人可能会开始在 mempool 中通过 gasPrice 来优先处理某些 txs,因此提供更高 fee 或 gas price可能会产生更高的tx优先级。

比如:

```bash
gaiacli tx send ... --fees=100photino
gaiacli tx send ... --fees=50000uatom
```

或:

```bash
gaiacli tx send ... --gas-prices=0.000001stake
gaiacli tx send ... --gas-prices=0.025uatom
```


Expand All @@ -149,25 +155,25 @@ gaiacli tx send ... --gas-prices=0.000001stake
gaiacli query account <account_cosmos>
```

::: 注意
::: warning 注意
当你查询余额为零的帐户时,你将收到以下错误:`No account with address <account_cosmos> was found in the state.` 如果你在节点与区块链完全同步之前就查询,也会发生这种情况。这些都很正常。
:::

#### 发送token
#### 发送 token

你可以通过如下命令从一个账户发送资金到另一个账户:

```bash
gaiacli tx send <destination_cosmos> 10faucetToken \
--chain-id=<chain_id> \
--from=<key_name> \
--from=<key_name>
```

::: 注意
::: warning 注意
`--amount`标识接收格式:`--amount=<value|coin_name>`
:::

::: 注意
::: tip 注意
你可能希望通过`--gas`标识限制交易可以消耗的最大燃料。如果你通过`--gas=auto`,将在执行交易前自动估gas。gas估算可能是不准确的,因为状态变化可能发生在模拟结束和交易的实际执行之间,因此在原始估计之上应用调整以确保能够成功地广播交易。可以通过`--gas-adjustment`标识控制调整,其默认值为1.0。
:::

Expand Down Expand Up @@ -209,6 +215,10 @@ gaiacli tx sign \
unsignedSendTx.json > signedSendTx.json
```

::: tip 注意
标识 `--generate-only` 只能在访问本地 keybase 时使用。
:::

你可以通过下面的命令验证交易的签名:

```bash
Expand Down Expand Up @@ -247,17 +257,18 @@ gaiacli query txs --tags='<tag1>:<value1>&<tag2>:<value2>'
gaiacli query txs --tags='<tag>:<value>' --page=1 --limit=20
```

::: 注意
action标签始终等于相关message的Type()函数返回的消息类型。
::: tip 注意

action标签始终等于相关message的`Type()`函数返回的消息类型。

你可以在每个SDK的模块中找到目前的标签列表:
+ [Common tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/types/tags.go#L57-L63)
+ [Staking tags](https://github.com/cosmos/cosmos-sdk/blob/master/x/staking/tags/tags.go#L8-L24)
+ [Governance tags](https://github.com/cosmos/cosmos-sdk/blob/master/x/gov/tags/tags.go#L8-L24)
+ [Slashing tags](https://github.com/cosmos/cosmos-sdk/blob/master/x/slashing/tags/tags.go#L8-L24)
+ [Distribution tags](https://github.com/cosmos/cosmos-sdk/blob/master/x/distribution/tags/tags.go#L8-L24)
+ [Bank tags](https://github.com/cosmos/cosmos-sdk/blob/master/x/bank/tags.go#L8-L24)
:::
- [Common tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/types/tags.go#L57-L63)
- [Staking tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/x/staking/tags/tags.go#L8-L24)
- [Governance tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/x/gov/tags/tags.go#L8-L22)
- [Slashing tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/x/slashing/handler.go#L52)
- [Distribution tags](https://github.com/cosmos/cosmos-sdk/blob/develop/x/distribution/tags/tags.go#L8-L17)
- [Bank tags](https://github.com/cosmos/cosmos-sdk/blob/d1e76221d8e28824bb4791cb4ad8662d2ae9051e/x/bank/keeper.go#L193-L206)
:::

#### 匹配一笔交易的hash

Expand Down Expand Up @@ -357,12 +368,12 @@ gaiacli query staking delegations <delegator_addr>
你还可以通过添加`--height`标识来获取先前的委托状态。

#### 解绑token
如果出于一些原因验证人行为异常,或者你想解绑一定数量的token,请使用以下命令。你可以使用相应的`shares-amount`标识(例如:`12.1`)或`shares-fraction`(例如:`0.25`)来解绑。
如果出于一些原因验证人行为异常,或者你想解绑一定数量的token,请使用以下命令。

```bash
gaiacli tx staking unbond \
--validator=<account_cosmosval> \
--shares-fraction=0.5 \
<validator_addr> \
10atom \
--from=<key_name> \
--chain-id=<chain_id>
```
Expand Down Expand Up @@ -397,9 +408,9 @@ gaiacli query staking unbonding-delegations-from <account_cosmosval>

```bash
gaiacli tx staking redelegate \
--addr-validator-source=<account_cosmosval> \
--addr-validator-dest=<account_cosmosval> \
--shares-fraction=50 \
<src-validator-operator-addr> \
<dst-validator-operator-addr> \
10atom \
--from=<key_name> \
--chain-id=<chain_id>
```
Expand Down Expand Up @@ -492,7 +503,7 @@ gaiacli tx gov submit-proposal \
--title=<title> \
--description=<description> \
--type=<Text/ParameterChange/SoftwareUpgrade> \
--deposit=<40steak> \
--deposit="1000000uatom" \
--from=<name> \
--chain-id=<chain_id>
```
Expand Down Expand Up @@ -521,10 +532,10 @@ gaiacli query gov proposer <proposal_id>

#### 增加存入金

为了将提案广播到网络,存入的金额必须高于`minDeposit`值(默认值`10steak`)。如果你之前创建的提案不符合此要求,你仍可以增加存入的总金额以激活它。达到最低存入金后,提案进入投票期:
为了将提案广播到网络,存入的金额必须高于`minDeposit`值(初始值`10steak`)。如果你之前创建的提案不符合此要求,你仍可以增加存入的总金额以激活它。达到最低存入金后,提案进入投票期:

```bash
gaiacli tx gov deposit <proposal_id> <200steak> \
gaiacli tx gov deposit <proposal_id> "10000000uatom" \
--from=<name> \
--chain-id=<chain_id>
```
Expand All @@ -549,6 +560,16 @@ gaiacli query gov deposit <proposal_id> <depositor_address>

在提案的存入金达到`MinDeposit`后,投票期将开放。抵押了`Atom`的持有人可以投票:

```bash
gaiacli tx gov vote <proposal_id> <Yes/No/NoWithVeto/Abstain> \
--from=<name> \
--chain-id=<chain_id>
```

#### 查询投票

使用您刚才提交的参数检查投票:

```bash
gaiacli query gov vote <proposal_id> <voter_address>
```
Expand Down Expand Up @@ -641,17 +662,17 @@ gaiacli query distr rewards <delegator_address>

```bash
gaiacli keys add \
--pubkey=cosmospub1addwnpepqtd28uwa0yxtwal5223qqr5aqf5y57tc7kk7z8qd4zplrdlk5ez5kdnlrj4 \
p2
p2 \
--pubkey=cosmospub1addwnpepqtd28uwa0yxtwal5223qqr5aqf5y57tc7kk7z8qd4zplrdlk5ez5kdnlrj4

gaiacli keys add \
--pubkey=cosmospub1addwnpepqgj04jpm9wrdml5qnss9kjxkmxzywuklnkj0g3a3f8l5wx9z4ennz84ym5t \
p3
p3 \
--pubkey=cosmospub1addwnpepqgj04jpm9wrdml5qnss9kjxkmxzywuklnkj0g3a3f8l5wx9z4ennz84ym5t

gaiacli keys add \
--multisig-threshold=2
p1p2p3 \
--multisig-threshold=2 \
--multisig=p1,p2,p3
p1p2p3
```

已存储新的多签公钥`p1p2p3`,其地址将用作多签交易的签名者:
Expand All @@ -660,6 +681,14 @@ gaiacli keys add \
gaiacli keys show --address p1p2p3
```

您还可以通过查看 key 的 JSON 输出或增加`--show-multisig`标识来查看multisig阈值,pubkey构成和相应的权重:

```bash
gaiacli keys show p1p2p3 -o json

gaiacli keys show p1p2p3 --show-multisig
```

创建多签交易的第一步是使用上面创建的多签地址初始化:

```bash
Expand All @@ -672,14 +701,26 @@ gaiacli tx send cosmos1570v2fq3twt0f0x02vhxpuzc9jc4yl30q2qned 10000000uatom \

```bash
gaiacli tx sign \
unsignedTx.json \
--multisig=<multisig_address> \
--name=p1 \
--output-document=p1signature.json \
unsignedTx.json
--from=p1 \
--output-document=p1signature.json
```

生成签名后,`p1``unsignedTx.json``p1signature.json`都发送到`p2``p3`,然后`p2``p3`将生成它们各自的签名:

```bash
gaiacli tx sign \
unsignedTx.json \
--multisig=<multisig_address> \
--from=p2 \
--output-document=p2signature.json
```

`p1p2p3` is a 2-of-3 multisig key, therefore one additional signature is sufficient. Any the key holders can now generate the multisig transaction by combining the required signature files:

p1p2p3` 是 2-of-3 多签key,因此一个的签名就足够了。 现在,任何密钥持有者都可以通过组合所需的签名文件来生成多签交易:

```bash
gaiacli tx multisign \
unsignedTx.json \
Expand All @@ -693,7 +734,7 @@ gaiacli tx multisign \
gaiacli tx broadcast signedTx.json
```

## shell完全脚本
## shell 自动补全脚本

可以通过完全命令生成主流的UNIX shell解释器(如`Bash``Zsh`)的`completion`命令,该命令可用于`gaiad``gaiacli`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Gaia的创世状态
# Gaia 创世状态(Genesis State)

`GenesisState`是Gaia的创世状态,由账户,不同模块的状态和例如创世交易这样的数据组成。每个模块可以指定自己的`GenesisState`,还有每个模块可以指定对创世状态的验证,导入和导出
Gaia 创世状态`GenesisState`由账户、各种模块状态和元数据组成,例如创世交易。 每个模块可以指定自己的`GenesisState`。 此外,每个模块可以指定自己的创世状态有效性验证、导入和导出功能

Gaia的创世状态有如下定义:
Gaia 创世状态定义如下:

```go
type GenesisState struct {
Expand All @@ -18,11 +18,11 @@ type GenesisState struct {
}
```

在gaia的ABCI接口`initChainer`的定义中`initFromGenesisState`被调用,它在内部调用每个模块的`InitGenesis`提供各自的`GenesisState`作为参数
在 Gaia 的 ABCI`initChainer`定义中调用`initFromGenesisState`,它在内部调用每个模块的`InitGenesis`提供它自己的`GenesisState`作为参数

## 账户
## 账户(Accounts)

`GenesisState`中的创世账户有如下定义:
`GenesisState` 中的创世账户定义如下:

```go
type GenesisAccount struct {
Expand All @@ -40,9 +40,8 @@ type GenesisAccount struct {
}
```

每个账户必须有一个合理的并唯一的account number,还要有sequence number和address
除序列号(nonce)和地址外,每个帐户还必须具有有效且唯一的账户编号

账户也可以是锁定账户,必须提供必要的锁定信息。锁定账户必须提供一个最小的`OriginalVesting``EndTime`。如果`StartTime`也提供了,这个账户将会被当做一个连续的锁定账户,将按照预定的时间线锁定代币。提供的`StartTime`必须小于`EndTime`,但可以是将来的某个时间。换句话说,`StartTime`不必小于创世时间。当一条新链从一个新状态(不是到处的)生成时,`OriginalVesting` 必须要小于`Coins`

<!-- TODO: Remaining modules and components in GenesisState -->
账户也可能锁仓,此时他们必须提供必要的锁仓信息,锁仓帐户必须至少提供`OriginalVesting``EndTime`。如果还提供了`StartTime`,则该帐户将被视为“连续”锁仓帐户,其中按预定义的时间表锁仓 coins。 提供的`StartTime`必须小于`EndTime`,但可能是未来的时间。 换句话说,它不必等于创世时间。 在从新状态(未导出)开始的新链中,`OriginalVesting`必须小于或等于`Coins`

<!-- TODO: Remaining modules and components in GenesisState -->
Loading

0 comments on commit df2e0bf

Please sign in to comment.