diff --git a/Makefile b/Makefile index d1e7d159a..429e93f53 100644 --- a/Makefile +++ b/Makefile @@ -355,7 +355,7 @@ fiximports: ./scripts/fiximports gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci fiximports - @echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli" + @echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO RUN 'make docsgen-cli'" .PHONY: gen jen: gen diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index 39ba487f2..27eeea73e 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -37,7 +37,17 @@ var dbDefs = []string{ )`, `INSERT OR IGNORE INTO _meta (version) VALUES (1)`, } -var dbPragmas = []string{} + +var dbPragmas = []string{ + "PRAGMA synchronous = normal", + "PRAGMA temp_store = memory", + "PRAGMA mmap_size = 30000000000", + "PRAGMA page_size = 32768", + "PRAGMA auto_vacuum = NONE", + "PRAGMA automatic_index = OFF", + "PRAGMA journal_mode = WAL", + "PRAGMA read_uncommitted = ON", +} const ( // prepared stmts diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 883f27a42..6e7e274f2 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -98,9 +98,10 @@ func main() { log.Info("Starting lotus-bench") app := &cli.App{ - Name: "lotus-bench", - Usage: "Benchmark performance of lotus on your hardware", - Version: build.UserVersion(), + Name: "lotus-bench", + Usage: "Benchmark performance of lotus on your hardware", + Version: build.UserVersion(), + DisableSliceFlagSeparator: true, Commands: []*cli.Command{ proveCmd, sealBenchCmd, diff --git a/cmd/lotus-shed/eth.go b/cmd/lotus-shed/eth.go index 1ebe2fb59..fde4f96f6 100644 --- a/cmd/lotus-shed/eth.go +++ b/cmd/lotus-shed/eth.go @@ -9,6 +9,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/types/ethtypes" lcli "github.com/filecoin-project/lotus/cli" ) @@ -23,6 +24,7 @@ var ethCmd = &cli.Command{ }, Subcommands: []*cli.Command{ checkTipsetsCmd, + computeEthHashCmd, }, } @@ -70,3 +72,36 @@ var checkTipsetsCmd = &cli.Command{ return nil }, } + +var computeEthHashCmd = &cli.Command{ + Name: "compute-eth-hash", + Usage: "Compute the eth hash for a given message CID", + Action: func(cctx *cli.Context) error { + if cctx.NArg() != 1 { + return lcli.IncorrectNumArgs(cctx) + } + + msg, err := messageFromString(cctx, cctx.Args().First()) + if err != nil { + return err + } + + switch msg := msg.(type) { + case *types.SignedMessage: + tx, err := ethtypes.EthTxFromSignedEthMessage(msg) + if err != nil { + return fmt.Errorf("failed to convert from signed message: %w", err) + } + + tx.Hash, err = tx.TxHash() + if err != nil { + return fmt.Errorf("failed to call TxHash: %w", err) + } + fmt.Println(tx.Hash) + default: + return fmt.Errorf("not a signed message") + } + + return nil + }, +} diff --git a/cmd/lotus-shed/indexes.go b/cmd/lotus-shed/indexes.go new file mode 100644 index 000000000..24a9a817f --- /dev/null +++ b/cmd/lotus-shed/indexes.go @@ -0,0 +1,337 @@ +package main + +import ( + "database/sql" + "fmt" + "path" + "path/filepath" + "strings" + + "github.com/mitchellh/go-homedir" + "github.com/urfave/cli/v2" + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/crypto" + + "github.com/filecoin-project/lotus/chain/types/ethtypes" + lcli "github.com/filecoin-project/lotus/cli" +) + +func withCategory(cat string, cmd *cli.Command) *cli.Command { + cmd.Category = strings.ToUpper(cat) + return cmd +} + +var indexesCmd = &cli.Command{ + Name: "indexes", + Usage: "Commands related to managing sqlite indexes", + HideHelpCommand: true, + Subcommands: []*cli.Command{ + withCategory("msgindex", backfillMsgIndexCmd), + withCategory("msgindex", pruneMsgIndexCmd), + withCategory("txhash", backfillTxHashCmd), + }, +} + +var backfillMsgIndexCmd = &cli.Command{ + Name: "backfill-msgindex", + Usage: "Backfill the msgindex.db for a number of epochs starting from a specified height", + Flags: []cli.Flag{ + &cli.IntFlag{ + Name: "from", + Value: 0, + Usage: "height to start the backfill; uses the current head if omitted", + }, + &cli.IntFlag{ + Name: "epochs", + Value: 1800, + Usage: "number of epochs to backfill; defaults to 1800 (2 finalities)", + }, + }, + Action: func(cctx *cli.Context) error { + api, closer, err := lcli.GetFullNodeAPI(cctx) + if err != nil { + return err + } + + defer closer() + ctx := lcli.ReqContext(cctx) + + curTs, err := api.ChainHead(ctx) + if err != nil { + return err + } + + startHeight := int64(cctx.Int("from")) + if startHeight == 0 { + startHeight = int64(curTs.Height()) - 1 + } + epochs := cctx.Int("epochs") + + basePath, err := homedir.Expand(cctx.String("repo")) + if err != nil { + return err + } + + dbPath := path.Join(basePath, "sqlite", "msgindex.db") + db, err := sql.Open("sqlite3", dbPath) + if err != nil { + return err + } + + defer func() { + err := db.Close() + if err != nil { + fmt.Printf("ERROR: closing db: %s", err) + } + }() + + insertStmt, err := db.Prepare("INSERT OR IGNORE INTO messages (cid, tipset_cid, epoch) VALUES (?, ?, ?)") + if err != nil { + return err + } + + var nrRowsAffected int64 + for i := 0; i < epochs; i++ { + epoch := abi.ChainEpoch(startHeight - int64(i)) + + if i%100 == 0 { + log.Infof("%d/%d processing epoch:%d, nrRowsAffected:%d", i, epochs, epoch, nrRowsAffected) + } + + ts, err := api.ChainGetTipSetByHeight(ctx, epoch, curTs.Key()) + if err != nil { + return fmt.Errorf("failed to get tipset at epoch %d: %w", epoch, err) + } + + tsCid, err := ts.Key().Cid() + if err != nil { + return fmt.Errorf("failed to get tipset cid at epoch %d: %w", epoch, err) + } + + msgs, err := api.ChainGetMessagesInTipset(ctx, ts.Key()) + if err != nil { + return fmt.Errorf("failed to get messages in tipset at epoch %d: %w", epoch, err) + } + + for _, msg := range msgs { + key := msg.Cid.String() + tskey := tsCid.String() + res, err := insertStmt.Exec(key, tskey, int64(epoch)) + if err != nil { + return fmt.Errorf("failed to insert message cid %s in tipset %s at epoch %d: %w", key, tskey, epoch, err) + } + rowsAffected, err := res.RowsAffected() + if err != nil { + return fmt.Errorf("failed to get rows affected for message cid %s in tipset %s at epoch %d: %w", key, tskey, epoch, err) + } + nrRowsAffected += rowsAffected + } + } + + log.Infof("Done backfilling, nrRowsAffected:%d", nrRowsAffected) + + return nil + }, +} + +var pruneMsgIndexCmd = &cli.Command{ + Name: "prune-msgindex", + Usage: "Prune the msgindex.db for messages included before a given epoch", + Flags: []cli.Flag{ + &cli.IntFlag{ + Name: "from", + Usage: "height to start the prune; if negative it indicates epochs from current head", + }, + }, + Action: func(cctx *cli.Context) error { + api, closer, err := lcli.GetFullNodeAPI(cctx) + if err != nil { + return err + } + + defer closer() + ctx := lcli.ReqContext(cctx) + + startHeight := int64(cctx.Int("from")) + if startHeight < 0 { + curTs, err := api.ChainHead(ctx) + if err != nil { + return err + } + + startHeight += int64(curTs.Height()) + + if startHeight < 0 { + return xerrors.Errorf("bogus start height %d", startHeight) + } + } + + basePath, err := homedir.Expand(cctx.String("repo")) + if err != nil { + return err + } + + dbPath := path.Join(basePath, "sqlite", "msgindex.db") + db, err := sql.Open("sqlite3", dbPath) + if err != nil { + return err + } + + defer func() { + err := db.Close() + if err != nil { + fmt.Printf("ERROR: closing db: %s", err) + } + }() + + tx, err := db.Begin() + if err != nil { + return err + } + + if _, err := tx.Exec("DELETE FROM messages WHERE epoch < ?", startHeight); err != nil { + if err := tx.Rollback(); err != nil { + fmt.Printf("ERROR: rollback: %s", err) + } + return err + } + + if err := tx.Commit(); err != nil { + return err + } + + return nil + }, +} + +var backfillTxHashCmd = &cli.Command{ + Name: "backfill-txhash", + Usage: "Backfills the txhash.db for a number of epochs starting from a specified height", + Flags: []cli.Flag{ + &cli.UintFlag{ + Name: "from", + Value: 0, + Usage: "the tipset height to start backfilling from (0 is head of chain)", + }, + &cli.IntFlag{ + Name: "epochs", + Value: 2000, + Usage: "the number of epochs to backfill", + }, + }, + Action: func(cctx *cli.Context) error { + api, closer, err := lcli.GetFullNodeAPI(cctx) + if err != nil { + return err + } + defer closer() + + ctx := lcli.ReqContext(cctx) + + curTs, err := api.ChainHead(ctx) + if err != nil { + return err + } + + startHeight := int64(cctx.Int("from")) + if startHeight == 0 { + startHeight = int64(curTs.Height()) - 1 + } + + epochs := cctx.Int("epochs") + + basePath, err := homedir.Expand(cctx.String("repo")) + if err != nil { + return err + } + + dbPath := filepath.Join(basePath, "sqlite", "txhash.db") + db, err := sql.Open("sqlite3", dbPath) + if err != nil { + return err + } + + defer func() { + err := db.Close() + if err != nil { + fmt.Printf("ERROR: closing db: %s", err) + } + }() + + insertStmt, err := db.Prepare("INSERT OR IGNORE INTO eth_tx_hashes(hash, cid) VALUES(?, ?)") + if err != nil { + return err + } + + var totalRowsAffected int64 = 0 + for i := 0; i < epochs; i++ { + epoch := abi.ChainEpoch(startHeight - int64(i)) + + select { + case <-cctx.Done(): + fmt.Println("request cancelled") + return nil + default: + } + + curTsk := curTs.Parents() + execTs, err := api.ChainGetTipSet(ctx, curTsk) + if err != nil { + return fmt.Errorf("failed to call ChainGetTipSet for %s: %w", curTsk, err) + } + + if i%100 == 0 { + log.Infof("%d/%d processing epoch:%d", i, epochs, epoch) + } + + for _, blockheader := range execTs.Blocks() { + blkMsgs, err := api.ChainGetBlockMessages(ctx, blockheader.Cid()) + if err != nil { + log.Infof("Could not get block messages at epoch: %d, stopping walking up the chain", epoch) + epochs = i + break + } + + for _, smsg := range blkMsgs.SecpkMessages { + if smsg.Signature.Type != crypto.SigTypeDelegated { + continue + } + + tx, err := ethtypes.EthTxFromSignedEthMessage(smsg) + if err != nil { + return fmt.Errorf("failed to convert from signed message: %w at epoch: %d", err, epoch) + } + + tx.Hash, err = tx.TxHash() + if err != nil { + return fmt.Errorf("failed to calculate hash for ethTx: %w at epoch: %d", err, epoch) + } + + res, err := insertStmt.Exec(tx.Hash.String(), smsg.Cid().String()) + if err != nil { + return fmt.Errorf("error inserting tx mapping to db: %s at epoch: %d", err, epoch) + } + + rowsAffected, err := res.RowsAffected() + if err != nil { + return fmt.Errorf("error getting rows affected: %s at epoch: %d", err, epoch) + } + + if rowsAffected > 0 { + log.Debugf("Inserted txhash %s, cid: %s at epoch: %d", tx.Hash.String(), smsg.Cid().String(), epoch) + } + + totalRowsAffected += rowsAffected + } + } + + curTs = execTs + } + + log.Infof("Done, inserted %d missing txhashes", totalRowsAffected) + + return nil + }, +} diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index a9e06f7c0..13ab6af0d 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -86,7 +86,7 @@ func main() { invariantsCmd, gasTraceCmd, replayOfflineCmd, - msgindexCmd, + indexesCmd, FevmAnalyticsCmd, mismatchesCmd, } diff --git a/cmd/lotus-shed/msgindex.go b/cmd/lotus-shed/msgindex.go deleted file mode 100644 index fae733bbe..000000000 --- a/cmd/lotus-shed/msgindex.go +++ /dev/null @@ -1,221 +0,0 @@ -package main - -import ( - "database/sql" - "fmt" - "path" - - "github.com/ipfs/go-cid" - _ "github.com/mattn/go-sqlite3" - "github.com/mitchellh/go-homedir" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-state-types/abi" - - lcli "github.com/filecoin-project/lotus/cli" -) - -var msgindexCmd = &cli.Command{ - Name: "msgindex", - Usage: "Tools for managing the message index", - Subcommands: []*cli.Command{ - msgindexBackfillCmd, - msgindexPruneCmd, - }, -} - -var msgindexBackfillCmd = &cli.Command{ - Name: "backfill", - Usage: "Backfill the message index for a number of epochs starting from a specified height", - Flags: []cli.Flag{ - &cli.IntFlag{ - Name: "from", - Value: 0, - Usage: "height to start the backfill; uses the current head if omitted", - }, - &cli.IntFlag{ - Name: "epochs", - Value: 1800, - Usage: "number of epochs to backfill; defaults to 1800 (2 finalities)", - }, - &cli.StringFlag{ - Name: "repo", - Value: "~/.lotus", - Usage: "path to the repo", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetFullNodeAPI(cctx) - if err != nil { - return err - } - - defer closer() - ctx := lcli.ReqContext(cctx) - - curTs, err := api.ChainHead(ctx) - if err != nil { - return err - } - - startHeight := int64(cctx.Int("from")) - if startHeight == 0 { - startHeight = int64(curTs.Height()) - 1 - } - epochs := cctx.Int("epochs") - - basePath, err := homedir.Expand(cctx.String("repo")) - if err != nil { - return err - } - - dbPath := path.Join(basePath, "sqlite", "msgindex.db") - db, err := sql.Open("sqlite3", dbPath) - if err != nil { - return err - } - - defer func() { - err := db.Close() - if err != nil { - fmt.Printf("ERROR: closing db: %s", err) - } - }() - - tx, err := db.Begin() - if err != nil { - return err - } - - insertStmt, err := tx.Prepare("INSERT INTO messages VALUES (?, ?, ?)") - if err != nil { - return err - } - - insertMsg := func(cid, tsCid cid.Cid, epoch abi.ChainEpoch) error { - key := cid.String() - tskey := tsCid.String() - if _, err := insertStmt.Exec(key, tskey, int64(epoch)); err != nil { - return err - } - - return nil - } - rollback := func() { - if err := tx.Rollback(); err != nil { - fmt.Printf("ERROR: rollback: %s", err) - } - } - - for i := 0; i < epochs; i++ { - epoch := abi.ChainEpoch(startHeight - int64(i)) - - ts, err := api.ChainGetTipSetByHeight(ctx, epoch, curTs.Key()) - if err != nil { - rollback() - return err - } - - tsCid, err := ts.Key().Cid() - if err != nil { - rollback() - return err - } - - msgs, err := api.ChainGetMessagesInTipset(ctx, ts.Key()) - if err != nil { - rollback() - return err - } - - for _, msg := range msgs { - if err := insertMsg(msg.Cid, tsCid, epoch); err != nil { - rollback() - return err - } - } - } - - if err := tx.Commit(); err != nil { - return err - } - - return nil - }, -} - -var msgindexPruneCmd = &cli.Command{ - Name: "prune", - Usage: "Prune the message index for messages included before a given epoch", - Flags: []cli.Flag{ - &cli.IntFlag{ - Name: "from", - Usage: "height to start the prune; if negative it indicates epochs from current head", - }, - &cli.StringFlag{ - Name: "repo", - Value: "~/.lotus", - Usage: "path to the repo", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetFullNodeAPI(cctx) - if err != nil { - return err - } - - defer closer() - ctx := lcli.ReqContext(cctx) - - startHeight := int64(cctx.Int("from")) - if startHeight < 0 { - curTs, err := api.ChainHead(ctx) - if err != nil { - return err - } - - startHeight += int64(curTs.Height()) - - if startHeight < 0 { - return xerrors.Errorf("bogus start height %d", startHeight) - } - } - - basePath, err := homedir.Expand(cctx.String("repo")) - if err != nil { - return err - } - - dbPath := path.Join(basePath, "sqlite", "msgindex.db") - db, err := sql.Open("sqlite3", dbPath) - if err != nil { - return err - } - - defer func() { - err := db.Close() - if err != nil { - fmt.Printf("ERROR: closing db: %s", err) - } - }() - - tx, err := db.Begin() - if err != nil { - return err - } - - if _, err := tx.Exec("DELETE FROM messages WHERE epoch < ?", startHeight); err != nil { - if err := tx.Rollback(); err != nil { - fmt.Printf("ERROR: rollback: %s", err) - } - return err - } - - if err := tx.Commit(); err != nil { - return err - } - - return nil - }, -} diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 1e319eb33..a6ea67562 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -34,11 +34,10 @@ COMMANDS: GLOBAL OPTIONS: --actor value, -a value specify other actor to query / manipulate --color use color in display output (default: depends on output being a TTY) - --help, -h show help (default: false) --miner-repo value, --storagerepo value Specify miner repo path. flag(storagerepo) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH] - --version, -v print the version (default: false) --vv enables very verbose mode, useful for debugging the CLI (default: false) - + --help, -h show help + --version, -v print the version ``` ## lotus-miner init @@ -50,9 +49,9 @@ USAGE: lotus-miner init command [command options] [arguments...] COMMANDS: - restore Initialize a lotus miner repo from a backup - service Initialize a lotus miner sub-service - help, h Shows a list of commands or help for one command + restore Initialize a lotus miner repo from a backup + service Initialize a lotus miner sub-service + help, h Shows a list of commands or help for one command OPTIONS: --actor value specify the address of an already created miner actor @@ -67,8 +66,7 @@ OPTIONS: --no-local-storage don't use storageminer repo for sector storage (default: false) --gas-premium value set gas premium for initialization messages in AttoFIL (default: "0") --from value select which address to send actor creation message from - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner init restore @@ -80,10 +78,10 @@ USAGE: lotus-miner init restore [command options] [backupFile] OPTIONS: - --config value config file (config.toml) --nosync don't check full-node sync status (default: false) + --config value config file (config.toml) --storage-config value storage paths config (storage.json) - + --help, -h show help ``` ### lotus-miner init service @@ -95,12 +93,12 @@ USAGE: lotus-miner init service [command options] [backupFile] OPTIONS: - --api-sealer value sealer API info (lotus-miner auth api-info --perm=admin) - --api-sector-index value sector Index API info (lotus-miner auth api-info --perm=admin) --config value config file (config.toml) --nosync don't check full-node sync status (default: false) --type value [ --type value ] type of service to be enabled - + --api-sealer value sealer API info (lotus-miner auth api-info --perm=admin) + --api-sector-index value sector Index API info (lotus-miner auth api-info --perm=admin) + --help, -h show help ``` ## lotus-miner run @@ -112,11 +110,11 @@ USAGE: lotus-miner run [command options] [arguments...] OPTIONS: - --enable-gpu-proving enable use of GPU for mining operations (default: true) - --manage-fdlimit manage open file limit (default: true) --miner-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) + --help, -h show help ``` ## lotus-miner stop @@ -128,8 +126,7 @@ USAGE: lotus-miner stop [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ## lotus-miner config @@ -141,13 +138,12 @@ USAGE: lotus-miner config command [command options] [arguments...] COMMANDS: - default Print default node config - updated Print updated node config - help, h Shows a list of commands or help for one command + default Print default node config + updated Print updated node config + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner config default @@ -160,7 +156,7 @@ USAGE: OPTIONS: --no-comment don't comment default values (default: false) - + --help, -h show help ``` ### lotus-miner config updated @@ -173,7 +169,7 @@ USAGE: OPTIONS: --no-comment don't comment default values (default: false) - + --help, -h show help ``` ## lotus-miner backup @@ -186,15 +182,15 @@ USAGE: DESCRIPTION: The backup command writes a copy of node metadata under the specified path - + Online backups: For security reasons, the daemon must be have LOTUS_BACKUP_BASE_PATH env var set to a path where backup files are supposed to be saved, and the path specified in this command must be within this base path OPTIONS: - --offline create backup without the node running (default: false) - + --offline create backup without the node running (default: false) + --help, -h show help ``` ## lotus-miner version @@ -206,8 +202,7 @@ USAGE: lotus-miner version [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ## lotus-miner actor @@ -219,22 +214,21 @@ USAGE: lotus-miner actor command [command options] [arguments...] COMMANDS: - set-addresses, set-addrs set addresses that your miner can be publicly dialed on - withdraw withdraw available balance to beneficiary - repay-debt pay down a miner's debt - set-peer-id set the peer id of your miner - set-owner Set owner address (this command should be invoked twice, first with the old owner as the senderAddress, and then with the new owner) - control Manage control addresses - propose-change-worker Propose a worker address change - confirm-change-worker Confirm a worker address change - compact-allocated compact allocated sectors bitfield - propose-change-beneficiary Propose a beneficiary address change - confirm-change-beneficiary Confirm a beneficiary address change - help, h Shows a list of commands or help for one command + set-addresses, set-addrs set addresses that your miner can be publicly dialed on + withdraw withdraw available balance to beneficiary + repay-debt pay down a miner's debt + set-peer-id set the peer id of your miner + set-owner Set owner address (this command should be invoked twice, first with the old owner as the senderAddress, and then with the new owner) + control Manage control addresses + propose-change-worker Propose a worker address change + confirm-change-worker Confirm a worker address change + compact-allocated compact allocated sectors bitfield + propose-change-beneficiary Propose a beneficiary address change + confirm-change-beneficiary Confirm a beneficiary address change + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner actor set-addresses, set-addrs @@ -250,9 +244,9 @@ USAGE: lotus-miner actor withdraw [command options] [amount (FIL)] OPTIONS: - --beneficiary send withdraw message from the beneficiary address (default: false) --confidence value number of block confirmations to wait for (default: 5) - + --beneficiary send withdraw message from the beneficiary address (default: false) + --help, -h show help ``` ### lotus-miner actor repay-debt @@ -265,7 +259,7 @@ USAGE: OPTIONS: --from value optionally specify the account to send funds from - + --help, -h show help ``` ### lotus-miner actor set-peer-id @@ -278,7 +272,7 @@ USAGE: OPTIONS: --gas-limit value set gas limit (default: 0) - + --help, -h show help ``` ### lotus-miner actor set-owner @@ -291,7 +285,7 @@ USAGE: OPTIONS: --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ### lotus-miner actor control @@ -303,13 +297,12 @@ USAGE: lotus-miner actor control command [command options] [arguments...] COMMANDS: - list Get currently set control addresses - set Set control address(-es) - help, h Shows a list of commands or help for one command + list Get currently set control addresses + set Set control address(-es) + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner actor control list @@ -321,8 +314,8 @@ USAGE: lotus-miner actor control list [command options] [arguments...] OPTIONS: - --verbose (default: false) - + --verbose (default: false) + --help, -h show help ``` #### lotus-miner actor control set @@ -335,7 +328,7 @@ USAGE: OPTIONS: --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ### lotus-miner actor propose-change-worker @@ -348,7 +341,7 @@ USAGE: OPTIONS: --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ### lotus-miner actor confirm-change-worker @@ -361,7 +354,7 @@ USAGE: OPTIONS: --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ### lotus-miner actor compact-allocated @@ -376,7 +369,7 @@ OPTIONS: --mask-last-offset value Mask sector IDs from 0 to 'higest_allocated - offset' (default: 0) --mask-upto-n value Mask sector IDs from 0 to 'n' (default: 0) --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ### lotus-miner actor propose-change-beneficiary @@ -388,10 +381,10 @@ USAGE: lotus-miner actor propose-change-beneficiary [command options] [beneficiaryAddress quota expiration] OPTIONS: - --actor value specify the address of miner actor - --overwrite-pending-change Overwrite the current beneficiary change proposal (default: false) --really-do-it Actually send transaction performing the action (default: false) - + --overwrite-pending-change Overwrite the current beneficiary change proposal (default: false) + --actor value specify the address of miner actor + --help, -h show help ``` ### lotus-miner actor confirm-change-beneficiary @@ -403,10 +396,10 @@ USAGE: lotus-miner actor confirm-change-beneficiary [command options] [minerID] OPTIONS: + --really-do-it Actually send transaction performing the action (default: false) --existing-beneficiary send confirmation from the existing beneficiary address (default: false) --new-beneficiary send confirmation from the new beneficiary address (default: false) - --really-do-it Actually send transaction performing the action (default: false) - + --help, -h show help ``` ## lotus-miner info @@ -418,14 +411,13 @@ USAGE: lotus-miner info command [command options] [arguments...] COMMANDS: - all dump all related miner info - help, h Shows a list of commands or help for one command + all dump all related miner info + help, h Shows a list of commands or help for one command OPTIONS: --hide-sectors-info hide sectors info (default: false) --blocks value Log of produced newest blocks and rewards(Miner Fee excluded) (default: 0) - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner info all @@ -437,8 +429,7 @@ USAGE: lotus-miner info all [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ## lotus-miner auth @@ -450,13 +441,12 @@ USAGE: lotus-miner auth command [command options] [arguments...] COMMANDS: - create-token Create token - api-info Get token with API info required to connect to this node - help, h Shows a list of commands or help for one command + create-token Create token + api-info Get token with API info required to connect to this node + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner auth create-token @@ -469,7 +459,7 @@ USAGE: OPTIONS: --perm value permission to assign to the token, one of: read, write, sign, admin - + --help, -h show help ``` ### lotus-miner auth api-info @@ -482,7 +472,7 @@ USAGE: OPTIONS: --perm value permission to assign to the token, one of: read, write, sign, admin - + --help, -h show help ``` ## lotus-miner log @@ -494,14 +484,13 @@ USAGE: lotus-miner log command [command options] [arguments...] COMMANDS: - list List log systems - set-level Set log level - alerts Get alert states - help, h Shows a list of commands or help for one command + list List log systems + set-level Set log level + alerts Get alert states + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner log list @@ -513,8 +502,7 @@ USAGE: lotus-miner log list [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner log set-level @@ -527,27 +515,27 @@ USAGE: DESCRIPTION: Set the log level for logging systems: - + The system flag can be specified multiple times. - + eg) log set-level --system chain --system chainxchg 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 GOLOG_OUTPUT - Specify whether to output to file, stderr, stdout or a combination, i.e. file+stderr - + OPTIONS: --system value [ --system value ] limit to log system - + --help, -h show help ``` ### lotus-miner log alerts @@ -559,8 +547,8 @@ USAGE: lotus-miner log alerts [command options] [arguments...] OPTIONS: - --all get all (active and inactive) alerts (default: false) - + --all get all (active and inactive) alerts (default: false) + --help, -h show help ``` ## lotus-miner wait-api @@ -576,7 +564,7 @@ CATEGORY: OPTIONS: --timeout value duration to wait till fail (default: 30s) - + --help, -h show help ``` ## lotus-miner fetch-params @@ -591,8 +579,7 @@ CATEGORY: DEVELOPER OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ## lotus-miner sectors @@ -604,32 +591,31 @@ USAGE: lotus-miner sectors command [command options] [arguments...] COMMANDS: - status Get the seal status of a sector by its number - list List sectors - refs List References to sectors - update-state ADVANCED: manually update the state of a sector, this may aid in error recovery - pledge store random data in a sector - numbers manage sector number assignments - precommits Print on-chain precommit info - check-expire Inspect expiring sectors - expired Get or cleanup expired sectors - extend Extend expiring sectors while not exceeding each sector's max life - terminate Terminate sector on-chain then remove (WARNING: This means losing power and collateral for the removed sector) - remove Forcefully remove a sector (WARNING: This means losing power and collateral for the removed sector (use 'terminate' for lower penalty)) - snap-up Mark a committed capacity sector to be filled with deals - abort-upgrade Abort the attempted (SnapDeals) upgrade of a CC sector, reverting it to as before - seal Manually start sealing a sector (filling any unused space with junk) - set-seal-delay Set the time (in minutes) that a new sector waits for deals before sealing starts - get-cc-collateral Get the collateral required to pledge a committed capacity sector - batching manage batch sector operations - match-pending-pieces force a refreshed match of pending pieces to open sectors without manually waiting for more deals - compact-partitions removes dead sectors from partitions and reduces the number of partitions used if possible - unseal unseal a sector - help, h Shows a list of commands or help for one command + status Get the seal status of a sector by its number + list List sectors + refs List References to sectors + update-state ADVANCED: manually update the state of a sector, this may aid in error recovery + pledge store random data in a sector + numbers manage sector number assignments + precommits Print on-chain precommit info + check-expire Inspect expiring sectors + expired Get or cleanup expired sectors + extend Extend expiring sectors while not exceeding each sector's max life + terminate Terminate sector on-chain then remove (WARNING: This means losing power and collateral for the removed sector) + remove Forcefully remove a sector (WARNING: This means losing power and collateral for the removed sector (use 'terminate' for lower penalty)) + snap-up Mark a committed capacity sector to be filled with deals + abort-upgrade Abort the attempted (SnapDeals) upgrade of a CC sector, reverting it to as before + seal Manually start sealing a sector (filling any unused space with junk) + set-seal-delay Set the time (in minutes) that a new sector waits for deals before sealing starts + get-cc-collateral Get the collateral required to pledge a committed capacity sector + batching manage batch sector operations + match-pending-pieces force a refreshed match of pending pieces to open sectors without manually waiting for more deals + compact-partitions removes dead sectors from partitions and reduces the number of partitions used if possible + unseal unseal a sector + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors status @@ -645,7 +631,7 @@ OPTIONS: --on-chain-info, -c show sector on chain info (default: false) --partition-info, -p show partition related info (default: false) --proof print snark proof bytes as hex (default: false) - + --help, -h show help ``` ### lotus-miner sectors list @@ -657,8 +643,8 @@ USAGE: lotus-miner sectors list command [command options] [arguments...] COMMANDS: - upgrade-bounds Output upgrade bounds for available sectors - help, h Shows a list of commands or help for one command + upgrade-bounds Output upgrade bounds for available sectors + help, h Shows a list of commands or help for one command OPTIONS: --show-removed, -r show removed sectors (default: false) @@ -669,8 +655,7 @@ OPTIONS: --states value filter sectors by a comma-separated list of states --unproven, -u only show sectors which aren't in the 'Proving' state (default: false) --check-parallelism value number of parallel requests to make for checking sector states (default: 300) - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors list upgrade-bounds @@ -685,7 +670,7 @@ OPTIONS: --buckets value (default: 25) --csv output machine-readable values (default: false) --deal-terms bucket by how many deal-sectors can start at a given expiration (default: false) - + --help, -h show help ``` ### lotus-miner sectors refs @@ -697,8 +682,7 @@ USAGE: lotus-miner sectors refs [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors update-state @@ -711,7 +695,7 @@ USAGE: OPTIONS: --really-do-it pass this flag if you know what you are doing (default: false) - + --help, -h show help ``` ### lotus-miner sectors pledge @@ -723,8 +707,7 @@ USAGE: lotus-miner sectors pledge [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors numbers @@ -736,15 +719,14 @@ USAGE: lotus-miner sectors numbers command [command options] [arguments...] COMMANDS: - info view sector assigner state - reservations list sector number reservations - reserve create sector number reservations - free remove sector number reservations - help, h Shows a list of commands or help for one command + info view sector assigner state + reservations list sector number reservations + reserve create sector number reservations + free remove sector number reservations + help, h Shows a list of commands or help for one command OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors numbers info @@ -756,8 +738,7 @@ USAGE: lotus-miner sectors numbers info [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors numbers reservations @@ -769,8 +750,7 @@ USAGE: lotus-miner sectors numbers reservations [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors numbers reserve @@ -782,8 +762,8 @@ USAGE: lotus-miner sectors numbers reserve [command options] [reservation name] [reserved ranges] OPTIONS: - --force skip duplicate reservation checks (note: can lead to damaging other reservations on free) (default: false) - + --force skip duplicate reservation checks (note: can lead to damaging other reservations on free) (default: false) + --help, -h show help ``` #### lotus-miner sectors numbers free @@ -795,8 +775,7 @@ USAGE: lotus-miner sectors numbers free [command options] [reservation name] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors precommits @@ -808,8 +787,7 @@ USAGE: lotus-miner sectors precommits [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors check-expire @@ -822,7 +800,7 @@ USAGE: OPTIONS: --cutoff value skip sectors whose current expiration is more than epochs from now, defaults to 60 days (default: 172800) - + --help, -h show help ``` ### lotus-miner sectors expired @@ -834,10 +812,10 @@ USAGE: lotus-miner sectors expired [command options] [arguments...] OPTIONS: - --expired-epoch value epoch at which to check sector expirations (default: WinningPoSt lookback epoch) - --remove-expired remove expired sectors (default: false) --show-removed show removed sectors (default: false) - + --remove-expired remove expired sectors (default: false) + --expired-epoch value epoch at which to check sector expirations (default: WinningPoSt lookback epoch) + --help, -h show help ``` ### lotus-miner sectors extend @@ -849,19 +827,19 @@ USAGE: lotus-miner sectors extend [command options] OPTIONS: - --drop-claims drop claims for sectors that can be extended, but only by dropping some of their verified power claims (default: false) + --from value only consider sectors whose current expiration epoch is in the range of [from, to], defaults to: now + 120 (1 hour) (default: 0) + --to value only consider sectors whose current expiration epoch is in the range of [from, to], defaults to: now + 92160 (32 days) (default: 0) + --sector-file value provide a file containing one sector number in each line, ignoring above selecting criteria --exclude value optionally provide a file containing excluding sectors --extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200) - --from value only consider sectors whose current expiration epoch is in the range of [from, to], defaults to: now + 120 (1 hour) (default: 0) - --max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0") - --max-sectors value the maximum number of sectors contained in each message (default: 0) --new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0) --only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false) - --really-do-it pass this flag to really extend sectors, otherwise will only print out json representation of parameters (default: false) - --sector-file value provide a file containing one sector number in each line, ignoring above selecting criteria - --to value only consider sectors whose current expiration epoch is in the range of [from, to], defaults to: now + 92160 (32 days) (default: 0) + --drop-claims drop claims for sectors that can be extended, but only by dropping some of their verified power claims (default: false) --tolerance value don't try to extend sectors by fewer than this number of epochs, defaults to 7 days (default: 20160) - + --max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0") + --max-sectors value the maximum number of sectors contained in each message (default: 0) + --really-do-it pass this flag to really extend sectors, otherwise will only print out json representation of parameters (default: false) + --help, -h show help ``` ### lotus-miner sectors terminate @@ -873,14 +851,13 @@ USAGE: lotus-miner sectors terminate command [command options] COMMANDS: - flush Send a terminate message if there are sectors queued for termination - pending List sector numbers of sectors pending termination - help, h Shows a list of commands or help for one command + flush Send a terminate message if there are sectors queued for termination + pending List sector numbers of sectors pending termination + help, h Shows a list of commands or help for one command OPTIONS: --really-do-it pass this flag if you know what you are doing (default: false) - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors terminate flush @@ -892,8 +869,7 @@ USAGE: lotus-miner sectors terminate flush [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` #### lotus-miner sectors terminate pending @@ -905,8 +881,7 @@ USAGE: lotus-miner sectors terminate pending [command options] [arguments...] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors remove @@ -919,7 +894,7 @@ USAGE: OPTIONS: --really-do-it pass this flag if you know what you are doing (default: false) - + --help, -h show help ``` ### lotus-miner sectors snap-up @@ -931,8 +906,7 @@ USAGE: lotus-miner sectors snap-up [command options] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors abort-upgrade @@ -945,7 +919,7 @@ USAGE: OPTIONS: --really-do-it pass this flag if you know what you are doing (default: false) - + --help, -h show help ``` ### lotus-miner sectors seal @@ -957,8 +931,7 @@ USAGE: lotus-miner sectors seal [command options] OPTIONS: - --help, -h show help (default: false) - + --help, -h show help ``` ### lotus-miner sectors set-seal-delay @@ -970,8 +943,8 @@ USAGE: lotus-miner sectors set-seal-delay [command options]