Skip to content

Commit

Permalink
docs: update docs (#219)
Browse files Browse the repository at this point in the history
* docs: add gas_over_premium to design-specs.md

* docs: update getting-started.md

* docs: add venus-messager-tools.md
  • Loading branch information
simlecode committed Jul 22, 2022
1 parent 6a49546 commit 4e28836
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/en/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ options:

7. set parameters related to address fee

> venus message address set-fee-params [options] address
> venus-messager address set-fee-params [options] address
```bash
# options
# --gas-overestimation value Estimate the coefficient of gas (default: 0)
# --max-feecap value Max feecap for a message (burn and pay to miner, attoFIL/GasUnit)
# --max-fee value Spend up to X attoFIL for message
# --gas-over-premium value Coefficient of gas premium (default: 0)

./venus-messager address set-fee-params <address>
```
Expand All @@ -167,7 +168,7 @@ options:
2. set shared params

```bash
./venus-messager share-params set --gas-over-estimation=1.25 --max-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20
./venus-messager share-params set --gas-over-estimation=1.25 --max-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20 --gas-over-premium 1
```

3. manual refresh shared params from DB
Expand Down
7 changes: 5 additions & 2 deletions docs/zh/design-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ venus-messager 用到了4张数据表,分别是全局参数表,地址表,
name | type | desc
---|---|---|
id | smallint(2) | primary key
gas_over_estimation | double | gas 预估超出的系数
gas_over_estimation | double | gas limit的系数
max_fee | varchar(256) |
max_fee_cap | varchar(256) |
sel_msg_num | bigint(20) | 单次选择的最大消息数
gas_over_premium | DOUBLE | gas premium的系数

2. 地址表,用于保存地址相关信息

Expand All @@ -135,7 +136,8 @@ nonce | bigint | 地址的nonce
weight | bigint |
sel_msg_num | bigint(20) | 改地址单次选择的最大消息数
state | int | 地址状态
gas_over_estimation | decimal(10,2) | gas 预估超出的系数
gas_over_estimation | decimal(10,2) | gas limit的系数
gas_over_estimation | decimal(10,2) | gas premium的系数
max_fee | varchar(256) |
max_fee_cap | varchar(256) |
is_deleted | int | 是否删除,-1:否,1:是
Expand Down Expand Up @@ -169,6 +171,7 @@ meta_expire_epoch | bigint | 过期高度
meta_gas_over_estimation | gas 预估超出的系数
meta_max_fee | varchar(256) |
meta_max_fee_cap | varchar(256) |
gas_over_premium | decimal(10,2) | gas premium的系数
wallet_name | varchar(256) | 钱包名,用于指定具体签名钱包
from_user | varchar(256) | 用户名,用于指定具体签名用户
state | int | 消息状态
Expand Down
89 changes: 89 additions & 0 deletions docs/zh/venus-messager-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# venus messager tools

一个基于 venus-messager 开发的常用工具集

### 帮助

```sh
./venus-messager-tools -h

NAME:
venus-messager-tools - A new cli application

USAGE:
venus-messager-tools [global options] command [command options] [arguments...]

COMMANDS:
batch-replace batch replace messages
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--config value, -c value The configuration file (default: "./tools_config.toml")
--help, -h show help (default: false)
```

### [配置](https://github.com/filecoin-project/venus-messager/blob/main/tools_config.toml)

默认配置是 `tools_config.toml`,使用时需提前把配置配好

```
$cat tools_config.toml
# res
[BatchReplace]
# 消息在messager阻塞的时间,只包含fillmsg
BlockTime = "5m"
# 限定消息的from地址
From = ""
[[BatchReplace.Selectors]]
# 限定消息 from 地址的类型,具体可以参考:https://github.com/filecoin-project/venus/blob/master/venus-shared/builtin-actors/builtin_actors_gen.go
ActorCode = ""
# 限定消息的methods
Methods = [5]
[Messager]
# venus-messager 的 token
Token = ""
# venus-messager 的 URL
URL = "/ip4/127.0.0.1/tcp/39812"
[Venus]
# 节点的 token
Token = ""
# 节点的 URL
URL = "/ip4/127.0.0.1/tcp/3453"
```

可以使用 `./venus state get-actor <address>` 来查看地址的 actor code

主网不同类型 actor code 如下:

* account: bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y
* cron: bafk2bzacecqb3eolfurehny6yp7tgmapib4ocazo5ilkopjce2c7wc2bcec62
* init: bafk2bzaceaipvjhoxmtofsnv3aj6gj5ida4afdrxa4ewku2hfipdlxpaektlw
* multisig: bafk2bzacebhldfjuy4o5v7amrhp5p2gzv2qo5275jut4adnbyp56fxkwy5fag
* paymentchannel: bafk2bzacebalad3f72wyk7qyilvfjijcwubdspytnyzlrhvn73254gqis44rq
* reward: bafk2bzacecwzzxlgjiavnc3545cqqil3cmq4hgpvfp2crguxy2pl5ybusfsbe
* storagemarket: bafk2bzacediohrxkp2fbsl4yj4jlupjdkgsiwqb4zuezvinhdo2j5hrxco62q
* storageminer: bafk2bzacecgnynvd3tene3bvqoknuspit56canij5bpra6wl4mrq2mxxwriyu
* storagepower: bafk2bzacebjvqva6ppvysn5xpmiqcdfelwbbcxmghx5ww6hr37cgred6dyrpm
* system: bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w
* verifiedregistry: bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4


### 批量replace message

根据配置中的条件批量replace长时间阻塞在 venus-messager 中的消息

> venus-messager-tools batch-replace [command options] [arguments...]
```
# --max-fee 和 --gas-over-premium 是可选项,gas-over-premium 是 gas premium的系数,该值为0是,则不会起作用
./venus-messager-tools batch-replace --auto
or
./venus-messager-tools batch-replace --gas-feecap <value> --gas-premium <value> --gas-limit <value>
```
7 changes: 5 additions & 2 deletions docs/zh/快速上手.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ options:

7. 设置地址fee相关参数

> venus message address set-fee-params [command options] address
> venus-messager address set-fee-params [command options] address
```bash
# options
# --gas-overestimation 估算gas的系数 (default: 0)
# --max-feecap 单个消息愿意付出的最多 feecap (包括燃烧和支付给矿工, attoFIL/GasUnit)
# --max-fee 单个消息最多花费 X attoFIL
# --gas-over-premium gas premium的系数 (default: 0)

./venus-messager address set-fee-params <address>
```
Expand All @@ -166,8 +167,10 @@ options:

2. 设置共享的参数

> venus-messager share-params set [command options] [arguments...]
```bash
./venus-messager share-params set --gas-over-estimation=1.25 --max-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20
./venus-messager share-params set --gas-over-estimation=1.25 --max-feecap="0" --max-fee="7000000000000000" --sel-msg-num=20 --gas-over-premium 1
```

3. 从数据库手动刷新共享参数
Expand Down

0 comments on commit 4e28836

Please sign in to comment.