Skip to content

Commit

Permalink
Small fixes in docs and error messages (#7826)
Browse files Browse the repository at this point in the history
* Small fixes in docs and error messages

* Add chain id

Co-authored-by: Federico Kunze <[email protected]>
  • Loading branch information
amaury1093 and fedekunze authored Nov 6, 2020
1 parent 03a4618 commit 4309859
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/run-node/interact-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ simd query account $MY_VALIDATOR_ADDRESS --chain-id my-test-chain
You should see the current balance of the account you created, equal to the original balance of `stake` you granted it minus the amount you delegated via the `gentx`. Now, create a second account:

```bash
simd keys add recipient
simd keys add recipient --keyring-backend test

# Put the generated address in a variable for later use.
RECIPIENT=$(simd keys show recipient -a)
RECIPIENT=$(simd keys show recipient -a --keyring-backend test)
```

The command above creates a local key-pair that is not yet registered on the chain. An account is created the first time it receives tokens from another account. Now, run the following command to send tokens to the `recipient` account:
Expand All @@ -37,10 +37,10 @@ simd query account $RECIPIENT --chain-id my-test-chain
Finally, delegate some of the stake tokens sent to the `recipient` account to the validator:

```bash
simd tx staking delegate $(simd keys show my_validator --bech val -a) 500stake --from recipient --chain-id my-test-chain
simd tx staking delegate $(simd keys show my_validator --bech val -a --keyring-backend test) 500stake --from recipient --chain-id my-test-chain

# Query the total delegations to `validator`.
simd query staking delegations-to $(simd keys show my_validator --bech val -a) --chain-id my-test-chain
simd query staking delegations-to $(simd keys show my_validator --bech val -a --keyring-backend test) --chain-id my-test-chain
```

You should see two delegations, the first one made from the `gentx`, and the second one you just performed from the `recipient` account.
2 changes: 1 addition & 1 deletion docs/run-node/keyring.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ To create a new key in the keyring, run the `add` subcommand with a `<key_name>`
$ simd keys add my_validator --keyring-backend test

# Put the generated address in a variable for later use.
MY_VALIDATOR_ADDRESS=$(simd keys show my_validator -a)
MY_VALIDATOR_ADDRESS=$(simd keys show my_validator -a --keyring-backend test)
```

This command generates a new 24-word mnemonic phrase, persists it to the relevant backend, and outputs information about the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase somewhere safe!
Expand Down
8 changes: 4 additions & 4 deletions docs/run-node/run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ The `~/.simapp` folder has the following structure:
|- priv_validator_key.json # Private key to use as a validator in the consensus protocol.
```

Before starting the chain, you need to populate the state with at least one account. To do so, first [create a new account in the keyring](./keyring.md#adding-keys-to-the-keyring) named `my_validator` (feel free to choose another name).
Before starting the chain, you need to populate the state with at least one account. To do so, first [create a new account in the keyring](./keyring.md#adding-keys-to-the-keyring) named `my_validator` under the `test` keyring backend (feel free to choose another name and another backend).

Now that you have created a local account, go ahead and grant it some `stake` tokens in your chain's genesis file. Doing so will also make sure your chain is aware of this account's existence:

```bash
simd add-genesis-account $(simd keys show my_validator -a) 100000000stake --chain-id my-test-chain
simd add-genesis-account $MY_VALIDATOR_ADDRESS 100000000stake
```

Recall that `$MY_VALIDATOR_ADDRESS` is a variable that holds the address of the `my_validator` key in the [keyring](./keyring.md#adding-keys-to-the-keyring). Also note that the tokens in the SDK have the `{amount}{denom}` format: `amount` is is a 18-digit-precision decimal number, and `denom` is the unique token identifier with its denomination key (e.g. `atom` or `uatom`). Here, we are granting `stake` tokens, as `stake` is the token identifier used for staking in [`simapp`](https://github.com/cosmos/cosmos-sdk/tree/v0.40.0-rc2/simapp). For your own chain with its own staking denom, that token identifier should be used instead.
Expand All @@ -53,10 +53,10 @@ Now that your account has some tokens, you need to add a validator to your chain

```bash
# Create a gentx.
simd gentx --name my_validator --amount 100000stake --chain-id my-test-chain
simd gentx my_validator --amount 100000stake --chain-id my-test-chain --keyring-backend test

# Add the gentx to the genesis file.
simd collect-gentxs --chain-id my-test-chain
simd collect-gentxs
```

A `gentx` does three things:
Expand Down
2 changes: 1 addition & 1 deletion types/tx/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (t *Tx) ValidateBasic() error {
if len(sigs) != len(t.GetSigners()) {
return sdkerrors.Wrapf(
sdkerrors.ErrUnauthorized,
"wrong number of signers; expected %d, got %d", t.GetSigners(), len(sigs),
"wrong number of signers; expected %d, got %d", len(t.GetSigners()), len(sigs),
)
}

Expand Down

0 comments on commit 4309859

Please sign in to comment.