lotus - butterfly命令及参数

目录

1 lotus

1.1 lotus daemon

启动lotus守护进程

  • --api value: 设置lotus监听地址,默认1234
  • --genesis value: 设置第一个节点
  • --bootstrap: 默认true
  • --import-chain value: 第一次运行时,从给定文件加载链
  • --halt-after-import: 从文件导入链后停止进程,默认false
  • --pprof value: 指定写入CPU的配置文件的文件名
  • --profile value: 指定节点类型
  • --manage-fdlimit: manage open file limit (default: true)

如果想设置lotus的生成路径,环境变量LOTUS_PATH

1.1.1 lotus daemon stop

停止守护进程

1.2 lotus version

打印版本

1.3 lotus wallet

钱包管理

1.3.1 lotus wallet new bls

创建一个新的bls钱包地址(t3)  
如果没有加bls,是生成一个t1开头的钱包地址

1.3.2 lotus wallet list

列出所有钱包地址(密钥)

1.3.3 lotus wallet balance

获取钱包总额
后面加钱包地址,可以查看指定钱包地址余额,不局限于本地钱包哦!

1.3.4 lotus wallet export

导出地址

lotus wallet export  [address]

导出地址的密钥一般存在在文件中,所以要导出命令使用以下命令格式:

lotus wallet export  [address] > filename

1.3.5 lotus wallet import

导入地址

lotus wallet import [command options] [<path> (optional, will read from stdin if omitted)]
  • --format value: 指定地址(密钥)的输入格式

导入地址,直接指定上面命令导出的钱包地址密钥文件,如下:

lotus wallet import filename

1.3.6 lotus wallet default

打印出默认钱包地址(密钥)

1.3.7 lotus wallet set-default

设置默认钱包地址(密钥)

lotus wallet set-default [address]

1.3.8 lotus wallet sign

签署消息

lotus wallet sign  <signing address> <hexMessage>

hexMessage:Hex编码/解码

1.3.9 lotus wallet verify

验证消息的签名

lotus wallet verify <signing address> <hexMessage> <signature>

sign和verify以我的理解,是为了安全交易而使用的,如果有A和B两个矿工进行资金转移,可以用此命令来确认对方是否本人。A给B发送hexMessage,B通过自己的钱包地址和hexMessage生成一串密钥发送给A,A通过验证B的钱包地址、hexMessage和密钥是否有效来判断B是否本人。

1.3.10 lotus wallet delete

删除钱包地址(密钥)

lotus wallet delete <address> 

1.4 lotus send

在帐户之间发送资金

lotus send [command options] [targetAddress] [amount]
  • --source value: 可以选择指定要从中发送资金的帐户
  • --gas-price value: 指定要在AttoFIL中使用的gas价格,默认值为0
  • --nonce value: 指定要使用的nonce,默认值为-1

1.5 lotus msig

与一个multisig钱包互动
multisig是一个t2开头的钱包,通过多个t3钱包生成的一个可以相互限制的钱包地址。

1.5.1 lotus msig create

创建一个新的multisig钱包

lotus msig create [command options] [address1 address2 ...]
  • --required value: 默认为0
  • --value value: 给multisig的初始资金
  • --from value: account to send the create message from

指定哪些t3钱包一起创建t2钱包

1.5.2 lotus msig inspect

检查multisig钱包

lotus msig inspect  [address]

1.5.3 lotus msig propose

提出一个multisig事务

lotus msig propose [command options] [multisigAddress destinationAddress value <methodId methodParams> (optional)]
  • --source value: 设置发送建议消息的帐户

提交一个从msig转账到t3的事务,这个事务必须要其它钱包地址同意才能执行成功。

1.5.4 lotus msig approve

批准multisig消息

lotus msig approve [command options] [multisigAddress messageId proposerAddress destination value <methodId methodParams> (optional)]
  • --source value: 设置发送批准消息的帐户

通过其它钱包提出的事务

lotus msig approve --source=本地钱包地址 multisigAddress messageId 提出者的钱包地址 目标的钱包地址 数额

messageId可以用lotus msig inspect multisigAddress查看到

1.6 lotus paych

管理支付渠道

1.6.1 lotus paych get

创建新的付款渠道或获取现有的付款渠道

lotus paych get  [fromAddress toAddress amount]

1.6.2 lotus paych list

列出所有本地注册的付款渠道

1.6.3 lotus paych voucher

与支付渠道凭证交互

1.6.3.1 lotus paych voucher create

创建已签名的付款渠道凭证

lotus paych voucher create [channelAddress amount]
  • --lane value: 指定要使用的付款渠道通道

1.6.3.2 lotus paych voucher check

检查付款渠道凭证的有效性

lotus paych voucher check [channelAddress voucher]

1.6.3.3 lotus paych voucher add

向本地数据存储添加付款渠道凭证

lotus paych voucher add [channelAddress voucher]

1.6.3.4 lotus paych voucher list

列出给定付款渠道的存储凭证

lotus paych voucher list [command options] [channelAddress]
  • --export: 打印导出字符串

1.6.3.5 lotus paych voucher best-spendable

打印当前可消费的最高值凭证

lotus paych voucher best-spendable [channelAddress]

1.6.3.6 lotus paych voucher submit

向链提交凭证以更新付款渠道状态

lotus paych voucher submit [channelAddress voucher]

1.7 lotus auth

管理RPC权限

1.7.1 lotus auth create-token

创建token

lotus auth create-token [command options]
  • --perm value: 分配给令牌的权限(value: read, write, sign, admin)

1.7.2 lotus auth api-info

获取连接到此节点所需的API信息的令牌

lotus auth api-info
  • --perm value: 分配给令牌的权限(value: read, write, sign, admin)

1.8 lotus mpool

管理消息池

1.8.1 lotus mpool pending

获取挂起的信息

1.8.2 lotus mpool sub

从Subscibe到mpool的更改

1.8.3 lotus mpool stat

打印mpool统计

1.9 lotus state

与filecoin链状态交互并查询

1.9.1 lotus state power

查询网络或矿工的算力(power)
不加minerAddress,就是全网的算力

lotus state power [<minerAddress> (optional)]

1.9.2 lotus state sectors

查询矿工的sector

lotus state sectors [minerAddress]

1.9.3 lotus state proving

查询一个矿工的proving

lotus state proving [minerAddress]

1.9.4 lotus state pledge-collateral

获得最低矿工抵押担保

1.9.5 lotus state list-actors

列出网络中的所有参与者

1.9.6 lotus state list-miners

列出网络中的所有矿工

1.9.7 lotus state get-actor

获取网络中某个参与者的信息

lotus state get-actor [actorrAddress]

1.9.8 lotus state lookup

查找对应的ID地址(输入钱包地址,获取miner矿工号)

lotus state lookup [command options] [address]
  • --reverse, -r: 执行反向查找

1.9.9 lotus state replay

在一个tipset中重播特定消息

lotus state replay [tipsetKey messageCid]

1.9.10 lotus state sector-size

查看矿工sector大小

lotus state sector-size [minerAddress]

1.9.11 lotus state read-state

查看参与者状态的json

lotus state read-state [actorAddress]

1.9.12 lotus state list-messages

列出与给定条件匹配的链上消息

lotus state list-messages [command options]
  • --to value: 将消息返回到给定地址
  • --from value: 从给定地址返回消息
  • --toheight value: 在给定的块高度之前不要查看
  • --cids: 打印CIDs消息而不是messages

1.9.13 lotus state compute-state

执行状态计算

lotus state compute-state [command options]
  • --height value: 将高度设置为计算状态
  • --apply-mpool-messages: 将来自mempool的消息应用于计算状态
  • --show-trace: 打印给定tipset的完整执行跟踪
  • --html: 生成html报表

1.9.14 lotus state call

在本地调用参与者的方法

lotus state call [toAddress methodId <param1 param2 ...> (optional)]
  • --from value: 默认值为t00
  • --value value: 指定要调用的值字段,默认值为0
  • --ret value: 指定如何分析输出(auto, raw, addr, big),默认值为auto

1.9.15 lotus state get-deal

查看on-chain交易信息

lotus state get-deal [dealId]

1.9.16 lotus state wait-msg

等待消息出现在链上

lotus state wait-msg [command options] [messageCid]
  • --timeout value: 默认值为1

1.9.17 lotus state search-msg

搜索以查看消息是否已出现在链上

lotus state search-msg [messageCid]

1.9.18 lotus state miner-info

检索矿工信息

lotus state miner-info [minerAddress]

1.10 lotus chain

与filecoin区块链互动

1.10.1 lotus chain head

打印链头

1.10.2 lotus chain getblock

获取一个块并打印其详细信息

lotus chain getblock [command options] [blockCid]
  • --raw: 只打印原始块标题

1.10.3 lotus chain read-obj

读取对象的原始字节

lotus chain read-obj [objectCid]

1.10.4 lotus chain stat-obj

收集对象的对象大小和ipld链接计数
当提供一个基时,它将首先被遍历,当传入对象被遍历时,所有访问的链接都将被忽略。

lotus chain stat-obj [command options] [cid]
  • --base value: 忽略此对象中找到的链接

1.10.5 lotus chain getmessage

通过cid获取并打印消息

lotus chain getmessage [messageCid]

1.10.6 lotus chain sethead

手动设置本地节点头tipset(注意:通常仅用于恢复)

lotus chain sethead [command options] [tipsetkey]
  • --genesis: 重置头部去为genesis
  • --epoch value: 重置头部为给定的纪元

1.10.7 lotus chain list

查看链的一段

lotus chain list [command options]
  • --height value: 默认为0
  • --count value: 默认为30
  • --format value: 指定打印提示集的格式,默认为": (

1.10.8 lotus chain get

按路径获取链DAG节点

lotus chain get [command options] [path]
DESCRIPTION:
   Get ipld node under a specified path:

   lotus chain get /ipfs/[cid]/some/path

   Path prefixes:
   - /ipfs/[cid], /ipld/[cid] - traverse IPLD path
   - /pstate - traverse from head.ParentStateRoot

   Note:
   You can use special path elements to traverse through some data structures:
   - /ipfs/[cid]/@H:elem - get 'elem' from hamt
   - /ipfs/[cid]/@Hi:123 - get varint elem 123 from hamt
   - /ipfs/[cid]/@Hu:123 - get uvarint elem 123 from hamt
   - /ipfs/[cid]/@Ha:t01 - get element under Addr(t01).Bytes
   - /ipfs/[cid]/@A:10   - get 10th amt element
   - .../@Ha:t01/@state  - get pretty map-based actor state

   List of --as-type types:
   - raw
   - block
   - message
   - smessage, signedmessage
   - actor
   - amt
   - hamt-epoch
   - hamt-address
   - cronevent
   - account-state
  • --as-type value: 指定要将输出解释为的类型
  • --verbose:
  • --tipset value: 为/pstate指定tipset,(传递以逗号分隔的cids数组)

1.10.9 lotus chain bisect

事件的对分链

lotus chain bisect [minHeight maxHeight path shellCommand <shellCommandArgs (if any)>]
DESCRIPTION:
   Bisect the chain state tree:

   lotus chain bisect [min height] [max height] '1/2/3/state/path' 'shell command' 'args'

   Returns the first tipset in which condition is true
                  v
   [start] FFFFFFFTTT [end]

   Example: find height at which deal ID 100 000 appeared
    - lotus chain bisect 1 32000 '@Ha:t03/1' jq -e '.[2] > 100000'

   For special path elements see 'chain get' help

1.10.10 lotus chain export

将链导出到car文件

lotus chain export [outputPath]

1.10.11 lotus chain slash-consensus

报告一致性错误

lotus chain slash-consensus [command options] [blockCid1 blockCid2]
  • --miner value: Miner address
  • --extra value: 额外的block cid

1.11 lotus log

管理日志记录

1.11.1 lotus log list

列出日志系统

1.11.2 lotus log set-level

设置日志级别

lotus log set-level [command options] [level]
DESCRIPTION:
   Set the log level for logging systems:

   The system flag can be specified multiple times.

   eg) log set-level --system chain --system blocksync debug

   Available Levels:
   debug
   info
   warn
   error

   Environment Variables:
   GOLOG_LOG_LEVEL - Default log level for all log systems
   GOLOG_LOG_FMT   - Change output log format (json, nocolor)
   GOLOG_FILE      - Write logs to file in addition to stderr
  • --system value: 日志系统限制

1.12 lotus wait-api

等待lotus api上线

1.13 lotus fetch-params

获取证明参数

lotus fetch-params [sectorSize]

1.14 lotus net

管理P2P网络

1.14.1 lotus net peers

打印peers

1.14.2 lotus net connect

连接一个peer

lotus net connect [peerMultiaddr]

1.14.3 lotus net listen

列出监听的地址

1.14.4 lotus net id

获取节点标识

1.14.5 lotus net findpeer

查找给定peerID的地址

lotus net findpeer [peerId]

1.14.6 lotus net scores

打印peer的pubsub scores

1.15 lotus sync

检查或与链同步器交互

1.15.1 lotus sync status

检查同步状态

1.15.2 lotus sync wait

等待同步完成

1.15.3 lotus sync mark-bad

将给定块标记为坏块,将阻止与包含它的链同步

lotus sync mark-bad [blockCid]

1.15.4 lotus sync check-bad

检查给定的块是否标记为坏,以及原因

lotus sync check-bad [blockCid]

1.16 lotus client

做交易,存储数据,检索数据

1.16.1 lotus client import

导入数据

lotus client import [command options] [inputPath]
  • --car: 从一个car文件而不是常规文件去导入

1.16.2 lotus client commp

计算CAR文件的piece-cid

lotus client commP [inputFile minerAddress]

1.16.3 lotus client local

列出本地导入的数据

1.16.4 lotus client deal

与矿工初始化存储交易

lotus client deal [command options] [dataCid miner price duration]
  • --manual-piece-cid value: 手动指定数据的piece commitmen(dataCid必须是car文件)
  • --manual-piece-size value: 如果手动指定piece cid,则用于指定尺寸(dataCid必须是car文件),默认为0
  • --from value: 指定为交易提供资金的地址
  • --start-epoch value: 指定交易开始的时间,默认-1

1.16.5 lotus client find

在网络中查找数据

lotus client find  [dataCid]

1.16.6 lotus client retrieve

从网络检索数据

lotus client retrieve [command options] [dataCid outputPath]
  • --address value: 用于交易的地址
  • --car : 从一个car文件而不是常规文件去导出,默认false

1.16.7 lotus client query-ask

找个矿工问一问

lotus client query-ask [command options] [minerAddress]
  • --peerid value: 指定要查询的节点peer ID
  • --size value: 数据大小(字节),默认为0
  • --duration value: 交易持续时间,默认为0

1.16.8 lotus client list-deals

列出存储市场交易

1.16.9 lotus client generate-car

从输入中生成一个car文件

lotus client generate-car  [inputPath outputPath]

2 lotus-storage-miner

  • --actor value, -a value : specify other actor to check state for (read only)
  • --storagerepo value: (default: “~/.lotusstorage_32”) [$LOTUS_STORAGE_PATH]

2.1 lotus-storage-miner actor

操纵the miner actor

2.1.1 lotus-storage-miner actor set-addrs

set addresses that your miner can be publically dialed on

  • --gas-limit value: set gas limit (default: 100000)

2.2 lotus-storage-miner storage-deals

管理存储交易和相关配置

2.2.1 lotus-storage-miner storage-deals import-data

Manually import data for a deal

lotus-storage-miner storage-deals import-data <proposal CID> <file>

2.2.2 lotus-storage-miner storage-deals list

List all deals for this miner
这个列举交易的信息很详细,就是信息太多,看起来难

2.2.3 lotus-storage-miner storage-deals selection

配置存储交易建议的接受标准(Configure acceptance criteria for storage deal proposals)

2.2.3.1 lotus-storage-miner storage-deals selection list

List storage deal proposal selection criteria

2.2.3.2 lotus-storage-miner storage-deals selection reset

将存储交易建议选择标准重置为默认值

2.2.3.3 lotus-storage-miner storage-deals selection reject

配置需要自动拒绝的条件

lotus-storage-miner storage-deals selection reject [command options]
  • --online: (default: false)
  • --offline: (default: false)

2.2.4 lotus-storage-miner storage-deals set-ask

Configure the miner’s ask

lotus-storage-miner storage-deals set-ask [command options]
  • --price PRICE:Set the price of the ask (specified as FIL / GiB / Epoch) to PRICE (default: 0)
  • --duration DURATION:Set duration of ask (a quantity of time after which the ask expires) DURATION (default: 720h0m0s)
  • --min-piece-size SIZE: Set minimum piece size (w/bit-padding, in bytes) in ask to SIZE (default: 256B)
  • --max-piece-size SIZE: Set maximum piece size (w/bit-padding, in bytes) in ask to SIZE (default: miner sector size)
    注意:使用这个命令,上面四个参数都要加,不然命令不让执行,而且价格的单位是attoFIL,如
lotus-storage-miner storage-deals set-ask --duration=730h0m0s --price=500000000000000000 --min-piece-size=256B --max-piece-size=31G

2.2.5 lotus-storage-miner storage-deals get-ask

Print the miner’s ask

2.2.6 lotus-storage-miner storage-deals set-blocklist

Set the storage miner’s list of blocklisted piece CIDs

lotus-storage-miner storage-deals set-blocklist [command options] [<path-of-file-containing-newline-delimited-piece-CIDs> (optional, will read from stdin if omitted)]

2.2.7 lotus-storage-miner storage-deals get-blocklist

List the contents of the storage miner’s piece CID blocklist

2.2.8 lotus-storage-miner storage-deals reset-blocklist

Remove all entries from the storage miner’s piece CID blocklist

2.3 lotus-storage-miner retrieval-deals

Manage retrieval deals and related configuration

2.3.1 lotus-storage-miner retrieval-deals selection

配置检索交易建议的接受条件(Configure acceptance criteria for retrieval deal proposals)

2.3.1.1 lotus-storage-miner retrieval-deals selection list

List retrieval deal proposal selection criteria

2.3.1.2 lotus-storage-miner retrieval-deals selection reset

Reset retrieval deal proposal selection criteria to default values

2.3.1.3 lotus-storage-miner retrieval-deals selection reject

Configure criteria which necessitate automatic rejection

2.4 lotus-storage-miner info

Print storage miner info

  • --color:(default: false)

2.5 lotus-storage-miner init

Initialize a lotus storage miner repo

  • --actor value: specify the address of an already created miner actor
  • --create-worker-key create separate worker key (default: false)
  • --worker value, -w value worker key to use (overrides --create-worker-key)
  • --owner value, -o value owner key to use
  • --sector-size value specify sector size to use (default: “512MiB”)
  • --pre-sealed-sectors value specify set of presealed sectors for starting as a genesis miner
  • --pre-sealed-metadata value specify the metadata file for the presealed sectors
  • --nosync don’t check full-node sync status (default: false)
  • --symlink-imported-sectors attempt to symlink to presealed sectors instead of copying them into place (default: false)
  • --no-local-storage don’t use storageminer repo for sector storage (default: false)
  • --gas-price value set gas price for initialization messages in AttoFIL (default: “0”)

2.6 lotus-storage-miner run

Start a lotus storage miner process

  • --api value : 2345
  • --enable-gpu-proving: enable use of GPU for mining operations (default: true)
  • --nosync : don’t check full-node sync status (default: false)
  • --manage-fdlimit : manage open file limit (default: true)

2.7 lotus-storage-miner stop

Stop a running lotus storage miner

2.8 lotus-storage-miner sectors

interact with sector store

2.8.1 lotus-storage-miner sectors status

Get the seal status of a sector by its number

lotus-storage-miner sectors status [command options] <sectorNum>
  • --log:display event log (default: false)

2.8.2 lotus-storage-miner sectors list

List sectors

2.8.3 lotus-storage-miner sectors refs

List References to sectors

2.8.4 lotus-storage-miner sectors update-state

ADVANCED: manually update the state of a sector, this may aid in error recovery

  • --really-do-it:pass this flag if you know what you are doing (default: false)

2.8.5 lotus-storage-miner sectors pledge

store random data in a sector

2.8.6 lotus-storage-miner sectors remove

Forcefully remove a sector (WARNING: This means losing power and collateral for the removed sector)

lotus-storage-miner sectors remove [command options] <sectorNum>
  • --really-do-it: pass this flag if you know what you are doing (default: false)

2.8.7 lotus-storage-miner sectors mark-for-upgrade

Mark a committed capacity sector for replacement by a sector with deals

lotus-storage-miner sectors mark-for-upgrade <sectorNum>

2.8.8 lotus-storage-miner sectors seal

Manually start sealing a sector (filling any unused space with junk)

lotus-storage-miner sectors seal <sectorNum>

2.8.9 lotus-storage-miner sectors set-seal-delay

以分钟为单位,设定一个新sector在开始seal前等待交易的时间

lotus-storage-miner sectors set-seal-delay <minutes>

2.9 lotus-storage-miner storage

manage sector storage

2.9.1 lotus-storage-miner storage attach

attach local storage path

  • --init: initialize the path first (default: false)
  • --weight value: (for init) path weight (default: 10)
  • --seal : (for init) use path for sealing (default: false)
  • --store : (for init) use path for long-term storage (default: false)

2.9.2 lotus-storage-miner storage list

list local storage paths

2.9.3 lotus-storage-miner storage find

find sector in the storage system

lotus-storage-miner storage find [sector number]

2.10 lotus-storage-miner rewards

A new cli application

2.10.1 lotus-storage-miner rewards redeem

Redeem block rewards

  • --gas-limit value set gas limit (default: 100000)

2.11 lotus-storage-miner workers

interact with workers

2.11.1 lotus-storage-miner workers list

list workers

2.12 lotus-storage-miner proving

View proving information

2.12.1 lotus-storage-miner proving info

View current state information

2.12.2 lotus-storage-miner proving deadlines

View the current proving period deadlines information

2.12.3 lotus-storage-miner proving faults

View the currently known proving faulty sectors information

2.13 lotus-storage-miner auth

Manage RPC permissions

2.13.1 lotus-storage-miner auth create-token

Create token

  • --perm value: permission to assign to the token, one of: read, write, sign, admin

2.13.2 lotus-storage-miner auth api-info

Get token with API info required to connect to this node

2.14 lotus-storage-miner log

Manage logging

2.14.1 lotus-storage-miner log list

List log systems

2.14.2 lotus-storage-miner log set-level

Set log level

lotus-storage-miner log set-level [command options] [level]

Set the log level for logging systems:

The system flag can be specified multiple times.

eg) log set-level --system chain --system blocksync debug

Available Levels:
debug
info
warn
error

Environment Variables:
GOLOG_LOG_LEVEL - Default log level for all log systems
GOLOG_LOG_FMT - Change output log format (json, nocolor)
GOLOG_FILE - Write logs to file in addition to stderr

  • --system value: limit to log system

2.15 lotus-storage-miner wait-api

Wait for lotus api to come online

2.16 lotus-storage-miner fetch-params

获取证明参数

lotus-storage-miner fetch-params [sectorSize]

2.17 lotus-storage-miner net

Manage P2P Network

2.17.1 lotus-storage-miner net peers

Print peers

2.17.2 lotus-storage-miner net connect

Connect to a peer

lotus-storage-miner net connect [peerMultiaddr]

2.17.3 lotus-storage-miner net listen

List listen addresses

2.17.4 lotus-storage-miner net id

Get node identity

2.17.5 lotus-storage-miner net findpeer

Find the addresses of a given peerID

3 lotus-seal-worker

远程存储矿工工人(Remote storage miner worker)

  • --worker-repo value: seal-worker运行路径,默认为~/.lotussworker,环境配置参数WORKER_PATH
  • --storagerepo value: 矿工运行路径,默认为~/.lotusstorage,环境变量参数为LOTUS_STORAGE_PATH
  • --enable-gpu-proving: 启用对mining操作使用GPU,默认true

3.1 lotus-seal-worker run

开始lotus worker

  • --address value: 本地可访问地址
  • --no-local-storage: 对于sector storage不使用storageminer repo,默认false
  • --precommit1: 允许precommit1(32G sectors: 1 core, 128GiB Memory),默认true
  • --precommit2: 允许precommit2(32G sectors: all cores, 96GiB Memory),默认true
  • --commit: 允许commit(32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap),默认true
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页