如你所见,监听地址默认绑定到本地环回接口,如果您需要向其他机器开放对矿工API的访问权限,您将需要将此设置为要使用的网络接口的IP地址,或设置为0.0.0.0(表示“所有接口”)。请注意,即使公开,API访问仍然受JWT令牌保护。 将 RemoteListenAddress 配置为其他节点必须使用才能访问此 API 的值。通常,它是矿工的 IP 地址和 API 端口,但根据您的设置(代理、公共 IP 等),它可能是不同的 IP。
Libp2p
本节配置矿工的嵌入式 Libp2p 节点。如设置说明中所述,使用矿机的公共 IP 和固定端口来调整此部分非常重要:
$ ./lotus-miner sectors batching commit --publish-now=true
Batch 0:
Message: bafy2bzacedtmykgf5g4evdvapacpmo4l32ewu5l7yxqkzjh3h6fhev7v7qoys
Sectors:
15 OK
17 OK
12 OK
10 OK
11 OK
13 OK
16 OK
14 OK
[Storage]# Upper bound on how many sectors can be fetched in parallel by the storage system at a time
ParallelFetchLimit =10# Sealing steps that the miner can perform itself. Sometimes we have a dedicated seal worker to do them and do not want the miner to commit any resources for this.
AllowAddPiece =true
AllowPreCommit1 =true
AllowPreCommit2 =true
AllowCommit =true
AllowUnseal =true
费用
费用部分允许为矿工提交给链的不同消息设置gas消耗限制:
[Fees]# Maximum fees to pay
MaxPreCommitGasFee ="0.025 FIL"
MaxCommitGasFee ="0.05 FIL"
MaxTerminateGasFee ="0.5 FIL"# This is a high-value operation, so the default fee is higher.
MaxWindowPoStGasFee ="5 FIL"
MaxPublishDealsFee ="0.05 FIL"
MaxMarketBalanceAddFee ="0.007 FIL"[Fees.MaxPreCommitBatchGasFee]
Base ="0 FIL"
PerSector ="0.02 FIL"[Fees.MaxCommitBatchGasFee]
Base ="0 FIL"
PerSector ="0.03 FIL"
根据网络拥塞情况,消息的基本费用可能会增加或减少。您的 gas 限额必须大于要包含的消息的基本费用。但是,在基础费用非常高的情况下,非常大的最大费用会导致资金快速燃烧,因为矿机在正常操作期间会自动提交消息,因此请注意这一点。还需要有比任何最高费用集更多的可用资金,即使实际费用将远低于最高费用集。 设置您愿意为每个扇区的封装支付的最高成本,MaxPreCommitBatchGasFee.PerSector/MaxCommitBatchGasFee.PerSector以避免意外的高成本。 注意:当前的 MaxCommitBatchGasFee.PerSector 足以聚合 6 个扇区的证明。根据您的操作分别调整。如果值太低,消息可能会在内存池中等待很长时间。如果您没有足够的资金,则不会发送消息。
[Addresses]# Addresses to send PreCommit messages from
PreCommitControl =[]# Addresses to send Commit messages from
CommitControl =[]# Disable the use of the owner address for messages which are sent automatically.# This is useful when the owner address is an offline/hardware key
DisableOwnerFallback =false# Disable the use of the worker address for messages for which it's possible to use other control addresses
DisableWorkerFallback =false