Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Move all global flags to cli-client/README.md, and refactor stake and distribution interface #633

Merged
merged 5 commits into from
Nov 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion docs/cli-client/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
# CLi Client
# Command Line Client

## Global flags of query commands

All query commands has these global flags. Their unique flags will be introduced later.

| Name, shorthand | type | Required | Default Value | Description |
| --------------- | ---- | -------- | --------------------- | -------------------------------------------------------------------- |
| --chain-id | string | false | "" | Chain ID of tendermint node |
| --height | int | false | 0 | Block height to query, omit to get most recent provable block |
| --help, -h | string | false | | Print help message |
| --indent | bool | false | false | Add indent to JSON response |
| --ledger | bool | false | false | Use a connected Ledger device |
| --node | string | false | tcp://localhost:26657 | \<host>:\<port> to tendermint rpc interface for this chain |
| --trust-node | bool | false | true | Don't verify proofs for responses |

## Global flags of commands to send transactions

All commands which can be used to send transactions have these global flags. Their unique flags will be introduced later.

| Name, shorthand | type | Required | Default | Description |
| -----------------| ----- | -------- | --------------------- | ------------------------------------------------------------------- |
| --account-number | int | false | 0 | AccountNumber number to sign the tx |
| --async | bool | false | false | broadcast transactions asynchronously |
| --chain-id | string | true | "" | Chain ID of tendermint node |
| --dry-run | bool | false | false | Ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it |
| --fee | string | true | "" | Fee to pay along with transaction |
| --from | string | false | "" | Name of private key with which to sign |
| --from-addr | string | false | "" | Specify from address in generate-only mode |
| --gas | int | false | 200000 | Gas limit to set per-transaction; set to "simulate" to calculate required gas automatically |
| --gas-adjustment | int | false | 1 | Adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set |
| --generate-only | bool | false | false | Build an unsigned transaction and write it to STDOUT |
| --help, -h | string | false | | Print help message |
| --indent | bool | false | false | Add indent to JSON response |
| --json | string | false | false | Return output in json format |
| --ledger | bool | false | false | Use a connected Ledger device |
| --memo | string | false | "" | Memo to send along with transaction |
| --node | string | false | tcp://localhost:26657 | \<host>:\<port> to tendermint rpc interface for this chain |
| --print-response | bool | false | false | return tx response (only works with async = false)|
| --sequence int | int | false | 0 | Sequence number to sign the tx |
| --trust-node | bool | false | true | Don't verify proofs for responses |

## Modules list

Each modules provides a set of command line interfaces. Here we sort these commands by modules.

1. [bank command](./bank/README.md)
2. [distribution command](./distribution/README.md)
3. [gov command](./gov/README.md)
4. [keys command](./keys/README.md)
5. [lcd command](./lcd/README.md)
6. [record command](./record/README.md)
7. [service command](./service/README.md)
8. [stake command](./stake/README.md)
9. [status command](./status/README.md)
10. [tendermint command](./tendermint/README.md)
11. [upgrade command](./upgrade/README.md)
111 changes: 20 additions & 91 deletions docs/cli-client/distribution/README.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,28 @@
# Introduction
# iriscli distribution

This document description how to use the the command line interface of distribution module.
## introduction

# Query interface
This document describes how to use the the command line interfaces of distribution module.

By default, trust-node mode is enable. If you don't trust the connected node, just append --trust-node=false in each query command.
## Usage

1. Query withdraw address
```shell
iriscli distribution [subcommand] [flags]
```

For example:
```bash
iriscli distribution withdraw-address faa1vm068fnjx28zv7k9kd9j85wrwhjn8vfsxfmcrz
```
If the given delegator doesn't specify other withdraw address, the query result will be empty.
Print all supported subcommands and flags:

2. Query delegation distribution information
```shell
iriscli distribution --help
```

For example:
```bash
iriscli distribution delegation-distr-info --address-delegator=faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j \
--address-validator=fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4
```
Query result:
```json
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4",
"del_pool_withdrawal_height": "4044"
}
```
The above response means this delegator has send transaction to withdraw reward at height 4044 or the delegation is created on height 4044.
## Available Subommands

2. Query delegator distribution information

For example:
```bash
iriscli distribution delegator-distr-info faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j
```
Query result:
```json
[
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva14a70gzu0v2w8dlfx462c9sldvja24qaz6vv4sg",
"del_pool_withdrawal_height": "10859"
},
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4",
"del_pool_withdrawal_height": "4044"
}
]
```

4. Query validator distribution information

For example:
```bash
iriscli distribution delegator-distr-info faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j
```
Query result:
```json
{
"operator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"fee_pool_withdrawal_height": "416",
"del_accum": {
"update_height": "416",
"accum": "0.0000000000"
},
"del_pool": "0.0000000000iris",
"val_commission": "0.0000000000iris"
}
```

# Send transactions interface

1. Set withdraw address

Validator operators or delegators can specify other address as their withdraw address. If no other address has been specified, the delegator address or validator self-delegator address will be used as default address.
For example:
```bash
iriscli distribution set-withdraw-addr faa1syva9fvh8m6dc6wjnjedah64mmpq7rwwz6nj0k --from mykey --fee=0.004iris --chain-id=irishub-test
```

2. withdraw rewards

1. Only withdraw the delegation reward from a given validator
```bash
iriscli distribution withdraw-rewards --only-from-validator fva134mhjjyyc7mehvaay0f3d4hj8qx3ee3w3eq5nq --from mykey --fee=0.004iris --chain-id=irishub-test
```
2. Withdraw all delegation reward of a delegator
```bash
iriscli distribution withdraw-rewards --from mykey --fee=0.004iris --chain-id=irishub-test
```
3. If the delegator is a onwer of a validator, withdraw all delegation reward and validator reward:
```bash
iriscli distribution withdraw-rewards --is-validator=true --from mykey --fee=0.004iris --chain-id=irishub-test
```
| Name | Description |
| --------------------------------| --------------------------------------------------------------|
| [delegation-distr-info](delegation-distr-info.md) | Query delegation distribution information |
| [delegator-distr-info](delegator-distr-info.md) | Query delegator distribution information |
| [validator-distr-info](validator-distr-info.md) | Query validator distribution information |
| [withdraw-address](withdraw-address.md) | Query withdraw address |
| [set-withdraw-address](set-withdraw-address.md) | change the default withdraw address for rewards associated with an address |
| [withdraw-rewards](withdraw-rewards.md) | withdraw rewards for either: all-delegations, a delegation, or a validator |
37 changes: 37 additions & 0 deletions docs/cli-client/distribution/delegation-distr-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# iriscli distribution delegation-distr-info

## introduction

Query a delegation distribution information

## Usage

```
iriscli distribution delegation-distr-info [flags]
```

Print help messages:
```
iriscli distribution delegation-distr-info --help
```

## Unique Flags

| Name, shorthand | type | Required | Default | Description |
| --------------------| ----- | -------- | -------- | ------------------------------------------------------------------- |
| --address-validator | string | true | "" | Bech address of the validator |
| --address-delegator | string | true | "" | Bech address of the delegator |

## Examples

```
iriscli distribution delegation-distr-info --address-delegator=<delegator address> --address-validator=<validator address>
```
Example response:
```json
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4",
"del_pool_withdrawal_height": "4044"
}
```
41 changes: 41 additions & 0 deletions docs/cli-client/distribution/delegator-distr-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# iriscli distribution delegator-distr-info

## Description

Query a delegator distribution information

## Usage

```
iriscli distribution delegator-distr-info [flags]
```

Print help messages:
```
iriscli distribution delegator-distr-info --help
```

## Unique Flags

There is no unique flag. But it requires a argument: delegator address

## Examples

```
iriscli distribution delegator-distr-info <delegator address>
```
Example response:
```json
[
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva14a70gzu0v2w8dlfx462c9sldvja24qaz6vv4sg",
"del_pool_withdrawal_height": "10859"
},
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4",
"del_pool_withdrawal_height": "4044"
}
]
```
27 changes: 27 additions & 0 deletions docs/cli-client/distribution/set-withdraw-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# iriscli distribution set-withdraw-addr

## Description

Set withdraw address for delegator

## Usage

```
iriscli distribution set-withdraw-addr [withdraw-addr] [flags]
```

Print help messages:
```
iriscli distribution set-withdraw-addr --help
```

## Unique Flags

There is no unique flag. But it requires an argument: new withdraw address


## Examples

```
iriscli distribution set-withdraw-addr <withdraw address> --from <key name> --fee=0.004iris --chain-id=<chain-id>
```
42 changes: 42 additions & 0 deletions docs/cli-client/distribution/validator-distr-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# iriscli distribution validator-distr-info

## Description

Query a validator distribution information

## Usage

```
iriscli distribution validator-distr-info [flags]
```

Print help messages:
```
iriscli distribution validator-distr-info --help
```

## Unique Flags

There is no unique flag. But it requires an argument: validator address


## Examples

```
iriscli distribution validator-distr-info <validator address>
```
Example response:
```json
[
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva14a70gzu0v2w8dlfx462c9sldvja24qaz6vv4sg",
"del_pool_withdrawal_height": "10859"
},
{
"delegator_addr": "faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j",
"val_operator_addr": "fva1ezzh0humhy3329xg4avhcjtay985nll0hpyhf4",
"del_pool_withdrawal_height": "4044"
}
]
```
33 changes: 33 additions & 0 deletions docs/cli-client/distribution/withdraw-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# iriscli distribution withdraw-address

## Description

Query the withdraw address of a delegator

## Usage

```
iriscli distribution withdraw-address [delegator address] [flags]
```

Print help messages:

```
iriscli distribution withdraw-address --help
```

## Unique Flags

There is no unique option. But it requires a argument: delegator address


## Examples

```
iriscli distribution withdraw-address
```
Example response:
```text
faa1ezzh0humhy3329xg4avhcjtay985nll0zswc5j
```
If the given delegator didn't specify other withdraw address, the query result will be empty.
Loading