Skip to content

Commit

Permalink
Add farm module command docs (#2667)
Browse files Browse the repository at this point in the history
* add command docs

* apply comments from github

Co-authored-by: vincent <vincent.ch.cn@gmail.com>
  • Loading branch information
Zhiqiang Zhang and chengwenxi authored Sep 24, 2021
1 parent 084ff94 commit b98c07a
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 0 deletions.
113 changes: 113 additions & 0 deletions docs/cli-client/farm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Farm

Farm module allows you to easily create farm activities on irishub.

## Available Commands

| Name | Description |
| --------------------------------- | ----------------------------------------------------- |
| [create](#iris-tx-farm-create) | Create a new farm pool |
| [adjust](#iris-tx-farm-adjust) | Adjust farm pool parameters |
| [destroy](#iris-tx-farm-destroy) | Destroy the farm pool and get back the invested bonus |
| [stake](#iris-tx-farm-stake) | Deposit liquidity token |
| [harvest](#iris-tx-farm-harvest) | Get back the bonus for participating in the farm pool |
| [farmer](#iris-query-farm-farmer) | Query farmer information |
| [pool](#iris-query-farm-pool) | Query the current status of a farm pool |
| [pools](#iris-query-farm-pools) | Query farm pool information by page |
| [params](#iris-query-farm-params) | Query the management parameters of the farm module |

## iris tx farm create

Create a new farm pool and pay the handling fee and bonus.

```bash
iris tx farm create <Farm Pool Name> [flags]
```

**Flags:**

| Name, shorthand | Required | Default | Description |
| ------------------ | -------- | ------- | -------------------------------------------------------- |
| --lp-token-denom | true | | The liquidity token accepted by farm pool |
| --reward-per-block | true | | The reward per block,ex: 1iris,1atom |
| --total-reward | true | | The Total reward for the farm pool |
| --description | false | "" | The simple description of a farm pool |
| --start-height | true | | The start height the farm pool |
| --editable | false | false | Is it possible to adjust the parameters of the farm pool |

### iris tx farm adjust

Adjust the parameters of the pool before the farm pool ends, such as `reward-per-block`, `total-reward`.

```bash
iris tx farm adjust <Farm Pool Name> [flags]
```

**Flags:**

| Name, shorthand | Required | Default | Description |
| ------------------- | ----------------------------------------- | ------- | ------------------------------------ |
| --additional-reward | And `--reward-per-block` must choose one | "" | Bonuses added to the farm pool |
| --reward-per-block | And `--additional-reward` must choose one | "" | The reward per block,ex: 1iris,1atom |

## iris tx farm destroy

Destroy the farm pool and get back the invested bonus.The rewards earned by the user farm ends at this moment, requiring the user to manually retrieve the income and the liquidity of the deposit.

```bash
iris tx farm destroy <Farm Pool Name> [flags]
```

### iris tx farm stake

The farmer participates in farm activities by staking the liquidity tokens specified by the pool. The rewards obtained by participating in the activities are related to the number of staking tokens and farm pool parameters.

```bash
iris tx farm stake <Farm Pool Name> <lp token> [flags]
```

### iris tx farm harvest

The farmer withdraws his rewards back.

```bash
iris tx farm harvest <Farm Pool Name>
```

### iris query farm farmer

Query farmer's information, including unclaimed rewards, mortgage liquidity, etc.

```bash
iris query farm farmer <Farmer Address> --pool-name <Farm Pool Name>
```

**Flags:**

| Name, shorthand | Required | Default | Description |
| --------------- | -------- | ------- | ------------------ |
| --pool-name | false | "" | the farm pool name |

### iris query farm pool

Query related information of a farm pool by name

```bash
iris query farm pool <Farm Pool Name>
```

### iris query farm pools

Paging query farm pool

```bash
iris query farm pools
```

### iris query farm params

Paging query farm pool

```bash
iris query farm params
```
113 changes: 113 additions & 0 deletions docs/zh/cli-client/farm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Farm

Farm 模块允许您在`irishub`上轻松创建`Farm`活动。

## 可用命令

| 名称 | 描述 |
| ------------------------------------------ | ---------------------------- |
| [创建 Pool](#iris-tx-farm-create) | 创建一个新的`Farm`|
| [调整 Pool 参数](#iris-tx-farm-adjust) | 调整`Farm`池参数 |
| [销毁 Pool](#iris-tx-farm-destroy) | 销毁`Farm`池并取回投入的奖金 |
| [抵押流动性](#iris-tx-farm-stake) | 抵押流动性代币 |
| [取回奖励](#iris-tx-farm-harvest) | 取回参与`Farm`池而获取的奖金 |
| [查询 Farmer](#iris-query-farm-farmer) | 查询 Farmer 信息 |
| [查询`Farm`](#iris-query-farm-pool) | 查询`Farm`池的当前状态 |
| [分页查询`Farm`](#iris-query-farm-pools) | 按页查询`Farm`池信息 |
| [查询可治理参数](#iris-query-farm-params) | 查询`Farm`模块的可治理参数 |

## iris tx farm create

创建一个新的`Farm`池 并支付手续费和奖金。

```bash
iris tx farm create <Farm Pool Name> [flags]
```

**标志:**

| 名称,速记 | 是否必须 | 默认 | 描述 |
| ------------------ | -------- | ----- | ------------------------- |
| --lp-token-denom || |`Farm`池可接受的流动性代币 |
| --reward-per-block || | 每个区块的奖励 |
| --total-reward || | 总奖励 |
| --description || "" |`Farm`池的简要描述 |
| --start-height || |`Farm`池的开始高度 |
| --editable || false |`Farm`池是否可编辑 |

### iris tx farm adjust

`Farm`池结束前调整池的参数,例如`reward-per-block``total-reward`

```bash
iris tx farm adjust <Farm Pool Name> [flags]
```

**标志:**

| 名称,速记 | 是否必须 | 默认 | 描述 |
| ------------------- | ----------------------------- | ---- | -------------------- |
| --additional-reward |`--reward-per-block`二选一 | "" |`Farm`池追加的奖金 |
| --reward-per-block |`--additional-reward`二选一 | "" | 每个区块的奖励 |

## iris tx farm destroy

销毁`Farm`池,取回投入的奖金。此时用户农场获得的奖励结束,需要用户手动取回奖励和流动性代币。

```bash
iris tx farm destroy <Farm Pool Name> [flags]
```

### iris tx farm stake

Farmer 通过抵押`Farm`池指定的流动性代币来参与`Farm`活动。参与活动获得的奖励与质押代币数量和`Farm`池参数有关。

```bash
iris tx farm stake <Farm Pool Name> <lp-token> [flags]
```

### iris tx farm harvest

Farmer 取回奖励。

```bash
iris tx farm harvest <Farm Pool Name> [flags]
```

### iris query farm farmer

查询 Farmer 信息,包括待领取的奖励、抵押的流动性等。

```bash
iris query farm farmer <Farmer Address> --pool-name <Farm Pool Name>
```

**标志:**

| 名称,简写 | 必填 | 默认 | 说明 |
| ----------- | ---- | ---- | ----------- |
| --pool-name || "" |`Farm`池名称 |

### iris query farm pool

按名称查询`Farm`池的相关信息

```bash
iris query farm pool <Farm Pool Name>
```

### iris query farm pools

分页查询`Farm`

```bash
iris query farm pools
```

### iris query farm params

查询`Farm`模块的可治理的参数

```bash
iris query farm params
```

0 comments on commit b98c07a

Please sign in to comment.