Skip to content

Commit

Permalink
Merge pull request #355 from ipfs-force-community/docs/elvindu/add-co…
Browse files Browse the repository at this point in the history
…nfig-explanation

annotate a configuration file using comments in toml format / toml注释的格式进行参数说明
  • Loading branch information
LinZexiao authored Jul 17, 2023
2 parents 34a2bc9 + 175700a commit c29565d
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions docs/zh/config-desc.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 配置文件

默认配置文件是~/.sophon-messager/config.toml
默认配置文件是~/.sophon-messager/config.toml`#`表示是注释。

```
```toml
[api]
Address = "/ip4/127.0.0.1/tcp/39812" //messager的监听地址
Address = "/ip4/127.0.0.1/tcp/39812" #messager的监听地址

[db]
type = "sqlite" //数据库类型。mysql或者sqlite
type = "sqlite" #数据库类型。mysql或者sqlite

[db.mysql]
connMaxLifeTime = "1m0s"
Expand All @@ -20,32 +20,28 @@
debug = false

[gateway]
token = "" //[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token
token = "" #[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token
url = ["/ip4/127.0.0.1/tcp/45132"]

[jwt]
authURL = "http://127.0.0.1:8989"
token = "" //[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token
token = "" #[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token

//messager直接通过p2p给链节点(venus/lotus)发送消息
//可选
# messager直接通过p2p给链节点(venus/lotus)发送消息
# 可选
[libp2p]
bootstrapAddresses = []
expandPeriod = "0s"
listenAddresses = "/ip4/0.0.0.0/tcp/0"
minPeerThreshold = 0

[log]
level = "info"
path = ""
[messageService]
DefaultTimeout = "1s" //请求链节点接口的超时时长
EstimateMessageTimeout = "5s" //调用链节点进行消息预估gas费等的超时时长
SignMessageTimeout = "3s" //调用gateway请求wallet进行签名的超时时长
WaitingChainHeadStableDuration = "8s" //
skipProcessHead = false //是否更新消息上链后的状态。在多个messager共用一个数据库时,只需要一个messager进行消息的全部状态更新
skipPushMessage = false //不推送消息到链。在多个messager共用一个数据库时,不推送消息的messager只做接受消息的任务,另外的messager进行推送消息
DefaultTimeout = "1s" #请求链节点接口的超时时长
EstimateMessageTimeout = "5s" #调用链节点进行消息预估gas费等的超时时长
SignMessageTimeout = "3s" #调用gateway请求wallet进行签名的超时时长
WaitingChainHeadStableDuration = "8s" #messager收到一个newhead消息后,如果8秒内没有收到新的newhead,就会认为收到的newhead是stable的了
skipProcessHead = false #是否更新消息上链后的状态。在多个messager共用一个数据库时,只需要一个messager进行消息的全部状态更新
skipPushMessage = false #不推送消息到链。在多个messager共用一个数据库时,不推送消息的messager只做接受消息的任务,另外的messager进行推送消息

[metrics]
Enabled = false
Expand All @@ -66,24 +62,25 @@
RegistryType = "define"
ReportingPeriod = "10s"

//venus同步节点或者sophon-co负载代理服务
#venus同步节点或者sophon-co负载代理服务
[node]
token = "" //[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token
token = "" #[gateway],[jwt],[node]三个字段基本上都是用同一个auth服务的token
url = "/ip4/127.0.0.1/tcp/3453"

[publisher]
cacheReleasePeriod = 0 //间隔多久缓存清理一次
concurrency = 5 // 同时推送消息的线程数
enableMultiNode = true //是否可以给多个节点推送消息
enablePubsub = false //是否通过p2p网络发送消息。需要和[libp2p]配置一起使用
cacheReleasePeriod = 0 #间隔多久缓存清理一次
concurrency = 5 #同时推送消息的线程数
enableMultiNode = true #是否可以给多个节点推送消息
enablePubsub = false #是否通过p2p网络发送消息。需要和[libp2p]配置一起使用

//可选
#可选
[rateLimit]
redis = ""
#redis地址,用于记录用户访问的次数。如果要开启对某个user的访问限速,还需要`auth` 服务同时设置`sophon-auth user rate-limit`命令。
redis = "" # eg. 127.0.0.1:6379

//可选
#可选
[tracing]
JaegerEndpoint = "localhost:6831"
JaegerEndpoint = "" # 例如:localhost:6831
JaegerTracingEnabled = false
ProbabilitySampler = 1.0
ServerName = ""
Expand Down

0 comments on commit c29565d

Please sign in to comment.