启动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
停止守护进程
打印版本
钱包管理
创建一个新的bls钱包地址(t3)
如果没有加bls,是生成一个t1开头的钱包地址
列出所有钱包地址(密钥)
获取钱包总额
后面加钱包地址,可以查看指定钱包地址余额,不局限于本地钱包哦!
导出地址
lotus wallet export [address]
导出地址的密钥一般存在在文件中,所以要导出命令使用以下命令格式:
lotus wallet export [address] > filename
导入地址
lotus wallet import [command options] [ (optional, will read from stdin if omitted)]
--format value
: 指定地址(密钥)的输入格式导入地址,直接指定上面命令导出的钱包地址密钥文件,如下:
lotus wallet import filename
打印出默认钱包地址(密钥)
设置默认钱包地址(密钥)
lotus wallet set-default [address]
签署消息
lotus wallet sign
hexMessage:Hex编码/解码
验证消息的签名
lotus wallet verify
sign和verify以我的理解,是为了安全交易而使用的,如果有A和B两个矿工进行资金转移,可以用此命令来确认对方是否本人。A给B发送hexMessage,B通过自己的钱包地址和hexMessage生成一串密钥发送给A,A通过验证B的钱包地址、hexMessage和密钥是否有效来判断B是否本人。
删除钱包地址(密钥)
lotus wallet delete
在帐户之间发送资金
lotus send [command options] [targetAddress] [amount]
--source value
: 可以选择指定要从中发送资金的帐户--gas-price value
: 指定要在AttoFIL中使用的gas价格,默认值为0--nonce value
: 指定要使用的nonce,默认值为-1与一个multisig钱包互动
multisig是一个t2开头的钱包,通过多个t3钱包生成的一个可以相互限制的钱包地址。
创建一个新的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钱包
检查multisig钱包
lotus msig inspect [address]
提出一个multisig事务
lotus msig propose [command options] [multisigAddress destinationAddress value (optional)]
--source value
: 设置发送建议消息的帐户提交一个从msig转账到t3的事务,这个事务必须要其它钱包地址同意才能执行成功。
批准multisig消息
lotus msig approve [command options] [multisigAddress messageId proposerAddress destination value (optional)]
--source value
: 设置发送批准消息的帐户通过其它钱包提出的事务
lotus msig approve --source=本地钱包地址 multisigAddress messageId 提出者的钱包地址 目标的钱包地址 数额
messageId可以用lotus msig inspect multisigAddress查看到
管理支付渠道
创建新的付款渠道或获取现有的付款渠道
lotus paych get [fromAddress toAddress amount]
列出所有本地注册的付款渠道
与支付渠道凭证交互
创建已签名的付款渠道凭证
lotus paych voucher create [channelAddress amount]
--lane value
: 指定要使用的付款渠道通道检查付款渠道凭证的有效性
lotus paych voucher check [channelAddress voucher]
向本地数据存储添加付款渠道凭证
lotus paych voucher add [channelAddress voucher]
列出给定付款渠道的存储凭证
lotus paych voucher list [command options] [channelAddress]
--export
: 打印导出字符串打印当前可消费的最高值凭证
lotus paych voucher best-spendable [channelAddress]
向链提交凭证以更新付款渠道状态
lotus paych voucher submit [channelAddress voucher]
管理RPC权限
创建token
lotus auth create-token [command options]
--perm value
: 分配给令牌的权限(value: read, write, sign, admin)获取连接到此节点所需的API信息的令牌
lotus auth api-info
--perm value
: 分配给令牌的权限(value: read, write, sign, admin)管理消息池
获取挂起的信息
从Subscibe到mpool的更改
打印mpool统计
与filecoin链状态交互并查询
查询网络或矿工的算力(power)
不加minerAddress,就是全网的算力
lotus state power [ (optional)]
查询矿工的sector
lotus state sectors [minerAddress]
查询一个矿工的proving
lotus state proving [minerAddress]
获得最低矿工抵押担保
列出网络中的所有参与者
列出网络中的所有矿工
获取网络中某个参与者的信息
lotus state get-actor [actorrAddress]
查找对应的ID地址(输入钱包地址,获取miner矿工号)
lotus state lookup [command options] [address]
--reverse, -r
: 执行反向查找在一个tipset中重播特定消息
lotus state replay [tipsetKey messageCid]
查看矿工sector大小
lotus state sector-size [minerAddress]
查看参与者状态的json
lotus state read-state [actorAddress]
列出与给定条件匹配的链上消息
lotus state list-messages [command options]
--to value
: 将消息返回到给定地址--from value
: 从给定地址返回消息--toheight value
: 在给定的块高度之前不要查看--cids
: 打印CIDs消息而不是messages执行状态计算
lotus state compute-state [command options]
--height value
: 将高度设置为计算状态--apply-mpool-messages
: 将来自mempool的消息应用于计算状态--show-trace
: 打印给定tipset的完整执行跟踪--html
: 生成html报表在本地调用参与者的方法
lotus state call [toAddress methodId (optional)]
--from value
: 默认值为t00--value value
: 指定要调用的值字段,默认值为0--ret value
: 指定如何分析输出(auto, raw, addr, big),默认值为auto查看on-chain交易信息
lotus state get-deal [dealId]
等待消息出现在链上
lotus state wait-msg [command options] [messageCid]
--timeout value
: 默认值为1搜索以查看消息是否已出现在链上
lotus state search-msg [messageCid]
检索矿工信息
lotus state miner-info [minerAddress]
与filecoin区块链互动
打印链头
获取一个块并打印其详细信息
lotus chain getblock [command options] [blockCid]
--raw
: 只打印原始块标题读取对象的原始字节
lotus chain read-obj [objectCid]
收集对象的对象大小和ipld链接计数
当提供一个基时,它将首先被遍历,当传入对象被遍历时,所有访问的链接都将被忽略。
lotus chain stat-obj [command options] [cid]
--base value
: 忽略此对象中找到的链接通过cid获取并打印消息
lotus chain getmessage [messageCid]
手动设置本地节点头tipset(注意:通常仅用于恢复)
lotus chain sethead [command options] [tipsetkey]
--genesis
: 重置头部去为genesis--epoch value
: 重置头部为给定的纪元查看链的一段
lotus chain list [command options]
--height value
: 默认为0--count value
: 默认为30--format value
: 指定打印提示集的格式,默认为": () "按路径获取链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数组)事件的对分链
lotus chain bisect [minHeight maxHeight path shellCommand ]
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
将链导出到car文件
lotus chain export [outputPath]
报告一致性错误
lotus chain slash-consensus [command options] [blockCid1 blockCid2]
--miner value
: Miner address--extra value
: 额外的block cid管理日志记录
列出日志系统
设置日志级别
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
: 日志系统限制等待lotus api上线
获取证明参数
lotus fetch-params [sectorSize]
管理P2P网络
打印peers
连接一个peer
lotus net connect [peerMultiaddr]
列出监听的地址
获取节点标识
查找给定peerID的地址
lotus net findpeer [peerId]
打印peer的pubsub scores
检查或与链同步器交互
检查同步状态
等待同步完成
将给定块标记为坏块,将阻止与包含它的链同步
lotus sync mark-bad [blockCid]
检查给定的块是否标记为坏,以及原因
lotus sync check-bad [blockCid]
做交易,存储数据,检索数据
导入数据
lotus client import [command options] [inputPath]
--car
: 从一个car文件而不是常规文件去导入计算CAR文件的piece-cid
lotus client commP [inputFile minerAddress]
列出本地导入的数据
与矿工初始化存储交易
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在网络中查找数据
lotus client find [dataCid]
从网络检索数据
lotus client retrieve [command options] [dataCid outputPath]
--address value
: 用于交易的地址--car
: 从一个car文件而不是常规文件去导出,默认false找个矿工问一问
lotus client query-ask [command options] [minerAddress]
--peerid value
: 指定要查询的节点peer ID--size value
: 数据大小(字节),默认为0--duration value
: 交易持续时间,默认为0列出存储市场交易
从输入中生成一个car文件
lotus client generate-car [inputPath outputPath]
--actor value, -a value
: specify other actor to check state for (read only)--storagerepo value
: (default: “~/.lotusstorage_32”) [$LOTUS_STORAGE_PATH]操纵the miner actor
set addresses that your miner can be publically dialed on
--gas-limit value
: set gas limit (default: 100000)管理存储交易和相关配置
Manually import data for a deal
lotus-storage-miner storage-deals import-data
List all deals for this miner
这个列举交易的信息很详细,就是信息太多,看起来难
配置存储交易建议的接受标准(Configure acceptance criteria for storage deal proposals)
List storage deal proposal selection criteria
将存储交易建议选择标准重置为默认值
配置需要自动拒绝的条件
lotus-storage-miner storage-deals selection reject [command options]
--online
: (default: false)--offline
: (default: false)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)lotus-storage-miner storage-deals set-ask --duration=730h0m0s --price=500000000000000000 --min-piece-size=256B --max-piece-size=31G
Print the miner’s ask
Set the storage miner’s list of blocklisted piece CIDs
lotus-storage-miner storage-deals set-blocklist [command options] [ (optional, will read from stdin if omitted)]
List the contents of the storage miner’s piece CID blocklist
Remove all entries from the storage miner’s piece CID blocklist
Manage retrieval deals and related configuration
配置检索交易建议的接受条件(Configure acceptance criteria for retrieval deal proposals)
List retrieval deal proposal selection criteria
Reset retrieval deal proposal selection criteria to default values
Configure criteria which necessitate automatic rejection
Print storage miner info
--color
:(default: false)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”)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)Stop a running lotus storage miner
interact with sector store
Get the seal status of a sector by its number
lotus-storage-miner sectors status [command options]
--log
:display event log (default: false)List sectors
List References to sectors
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)store random data in a sector
Forcefully remove a sector (WARNING: This means losing power and collateral for the removed sector)
lotus-storage-miner sectors remove [command options]
--really-do-it
: pass this flag if you know what you are doing (default: false)Mark a committed capacity sector for replacement by a sector with deals
lotus-storage-miner sectors mark-for-upgrade
Manually start sealing a sector (filling any unused space with junk)
lotus-storage-miner sectors seal
以分钟为单位,设定一个新sector在开始seal前等待交易的时间
lotus-storage-miner sectors set-seal-delay
manage sector storage
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)list local storage paths
find sector in the storage system
lotus-storage-miner storage find [sector number]
A new cli application
Redeem block rewards
--gas-limit value
set gas limit (default: 100000)interact with workers
list workers
View proving information
View current state information
View the current proving period deadlines information
View the currently known proving faulty sectors information
Manage RPC permissions
Create token
--perm value
: permission to assign to the token, one of: read, write, sign, adminGet token with API info required to connect to this node
Manage logging
List log systems
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 systemWait for lotus api to come online
获取证明参数
lotus-storage-miner fetch-params [sectorSize]
Manage P2P Network
Print peers
Connect to a peer
lotus-storage-miner net connect [peerMultiaddr]
List listen addresses
Get node identity
Find the addresses of a given peerID
远程存储矿工工人(Remote storage miner worker)
--worker-repo value
: seal-worker运行路径,默认为~/.lotussworker,环境配置参数WORKER_PATH--storagerepo value
: 矿工运行路径,默认为~/.lotusstorage,环境变量参数为LOTUS_STORAGE_PATH--enable-gpu-proving
: 启用对mining操作使用GPU,默认true开始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