From adba595350f1847c5831b5e98b5dccd3e4a8d67a Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Thu, 22 Jul 2021 18:41:57 +0200 Subject: [PATCH 1/9] commit from @dirkmc - initial export cmd for martkers related metadata --- cmd/lotus-shed/market.go | 136 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/cmd/lotus-shed/market.go b/cmd/lotus-shed/market.go index e2e322784..cde66191d 100644 --- a/cmd/lotus-shed/market.go +++ b/cmd/lotus-shed/market.go @@ -2,6 +2,16 @@ package main import ( "fmt" + "io/ioutil" + "os" + "path" + + "github.com/filecoin-project/lotus/lib/backupds" + + "github.com/filecoin-project/lotus/node/repo" + "github.com/ipfs/go-datastore" + dsq "github.com/ipfs/go-datastore/query" + logging "github.com/ipfs/go-log/v2" lcli "github.com/filecoin-project/lotus/cli" @@ -18,6 +28,7 @@ var marketCmd = &cli.Command{ Flags: []cli.Flag{}, Subcommands: []*cli.Command{ marketDealFeesCmd, + marketExportDatastoreCmd, }, } @@ -100,3 +111,128 @@ var marketDealFeesCmd = &cli.Command{ return xerrors.New("must provide either --provider or --dealId flag") }, } + +var marketExportDatastoreCmd = &cli.Command{ + Name: "export-datastore", + Description: "export datastore to a file", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "repo", + Usage: "path to the repo", + }, + &cli.StringFlag{ + Name: "backup-dir", + Usage: "path to the backup directory", + }, + }, + Action: func(cctx *cli.Context) error { + logging.SetLogLevel("badger", "ERROR") // nolint:errcheck + + backupDir := cctx.String("backup-dir") + if backupDir == "" { + backupDir = os.TempDir() + } + + r, err := repo.NewFS(cctx.String("repo")) + if err != nil { + return xerrors.Errorf("opening fs repo: %w", err) + } + + exists, err := r.Exists() + if err != nil { + return err + } + if !exists { + return xerrors.Errorf("lotus repo doesn't exist") + } + + lr, err := r.Lock(repo.StorageMiner) + if err != nil { + return err + } + defer lr.Close() //nolint:errcheck + + namespace := "metadata" + ds, err := lr.Datastore(cctx.Context, datastore.NewKey(namespace).String()) + if err != nil { + return err + } + + backupRepoDir, err := ioutil.TempDir("", "backup-repo-dir") + if err != nil { + return err + } + + backupRepo, err := repo.NewFS(cctx.String(backupRepoDir)) + if err != nil { + return xerrors.Errorf("opening backup repo: %w", err) + } + + lockedBackupRepo, err := backupRepo.Lock(repo.StorageMiner) + if err != nil { + return err + } + defer lockedBackupRepo.Close() //nolint:errcheck + + backupDs, err := lockedBackupRepo.Datastore(cctx.Context, datastore.NewKey(namespace).String()) + if err != nil { + return err + } + + prefixes := []string{ + "/deals/provider", + "/retrievals/provider", + "/storagemarket", + } + for _, prefix := range prefixes { + err := exportPrefix(prefix, ds, backupDs) + if err != nil { + return err + } + } + + bds, err := backupds.Wrap(backupDs, "") + if err != nil { + return xerrors.Errorf("opening backupds: %w", err) + } + + fpath := path.Join(backupDir, "datastore.backup") + out, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + return xerrors.Errorf("open %s: %w", fpath, err) + } + if err := bds.Backup(out); err != nil { + if cerr := out.Close(); cerr != nil { + log.Errorw("error closing backup file while handling backup error", "closeErr", cerr, "backupErr", err) + } + return xerrors.Errorf("backup error: %w", err) + } + if err := out.Close(); err != nil { + return xerrors.Errorf("closing backup file: %w", err) + } + + fmt.Println("Wrote backup file to " + fpath) + + return nil + }, +} + +func exportPrefix(prefix string, ds datastore.Batching, backupDs datastore.Batching) error { + q, err := ds.Query(dsq.Query{ + Prefix: prefix, + }) + if err != nil { + return xerrors.Errorf("datastore query: %w", err) + } + defer q.Close() //nolint:errcheck + + for res := range q.Next() { + fmt.Println("Exporting key " + res.Key) + err := backupDs.Put(datastore.NewKey(res.Key), res.Value) + if err != nil { + return xerrors.Errorf("putting %s to backup datastore: %w", res.Key, err) + } + } + + return nil +} From 7ef167b04f719941ac1bbf91faa9d9b932dfd5f0 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Fri, 23 Jul 2021 09:33:26 +0200 Subject: [PATCH 2/9] refactor: simplify market datastore backup --- cmd/lotus-shed/market.go | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/cmd/lotus-shed/market.go b/cmd/lotus-shed/market.go index cde66191d..10d71bbf2 100644 --- a/cmd/lotus-shed/market.go +++ b/cmd/lotus-shed/market.go @@ -2,10 +2,12 @@ package main import ( "fmt" - "io/ioutil" "os" "path" + levelds "github.com/ipfs/go-ds-leveldb" + ldbopts "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/filecoin-project/lotus/lib/backupds" "github.com/filecoin-project/lotus/node/repo" @@ -128,16 +130,19 @@ var marketExportDatastoreCmd = &cli.Command{ Action: func(cctx *cli.Context) error { logging.SetLogLevel("badger", "ERROR") // nolint:errcheck + // If the backup dir is not specified, just use the OS temp dir backupDir := cctx.String("backup-dir") if backupDir == "" { backupDir = os.TempDir() } + // Create a new repo at the repo path r, err := repo.NewFS(cctx.String("repo")) if err != nil { return xerrors.Errorf("opening fs repo: %w", err) } + // Make sure the repo exists exists, err := r.Exists() if err != nil { return err @@ -146,39 +151,30 @@ var marketExportDatastoreCmd = &cli.Command{ return xerrors.Errorf("lotus repo doesn't exist") } + // Lock the repo lr, err := r.Lock(repo.StorageMiner) if err != nil { return err } defer lr.Close() //nolint:errcheck + // Open the metadata datastore on the repo namespace := "metadata" ds, err := lr.Datastore(cctx.Context, datastore.NewKey(namespace).String()) if err != nil { return err } - backupRepoDir, err := ioutil.TempDir("", "backup-repo-dir") - if err != nil { - return err - } - - backupRepo, err := repo.NewFS(cctx.String(backupRepoDir)) - if err != nil { - return xerrors.Errorf("opening backup repo: %w", err) - } - - lockedBackupRepo, err := backupRepo.Lock(repo.StorageMiner) - if err != nil { - return err - } - defer lockedBackupRepo.Close() //nolint:errcheck - - backupDs, err := lockedBackupRepo.Datastore(cctx.Context, datastore.NewKey(namespace).String()) - if err != nil { - return err - } + // Create a tmp datastore that we'll add the exported key / values to + // and then backup + backupDs, err := levelds.NewDatastore(backupDir, &levelds.Options{ + Compression: ldbopts.NoCompression, + NoSync: false, + Strict: ldbopts.StrictAll, + ReadOnly: false, + }) + // Export the key / values prefixes := []string{ "/deals/provider", "/retrievals/provider", @@ -191,16 +187,20 @@ var marketExportDatastoreCmd = &cli.Command{ } } + // Wrap the datastore in a backup datastore bds, err := backupds.Wrap(backupDs, "") if err != nil { return xerrors.Errorf("opening backupds: %w", err) } - fpath := path.Join(backupDir, "datastore.backup") + // Create a file for the backup + fpath := path.Join(backupDir, "markets.datastore.backup") out, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY, 0644) if err != nil { return xerrors.Errorf("open %s: %w", fpath, err) } + + // Write the backup to the file if err := bds.Backup(out); err != nil { if cerr := out.Close(); cerr != nil { log.Errorw("error closing backup file while handling backup error", "closeErr", cerr, "backupErr", err) From 52498f78a1da96e8f9a62c2e6ce9a354c556b7ef Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Fri, 23 Jul 2021 10:30:58 +0200 Subject: [PATCH 3/9] feat: add import market datastore cmd --- cmd/lotus-shed/market.go | 117 +++++++++++++++++++++++++++++++-------- 1 file changed, 94 insertions(+), 23 deletions(-) diff --git a/cmd/lotus-shed/market.go b/cmd/lotus-shed/market.go index 10d71bbf2..eb1b56a94 100644 --- a/cmd/lotus-shed/market.go +++ b/cmd/lotus-shed/market.go @@ -31,6 +31,7 @@ var marketCmd = &cli.Command{ Subcommands: []*cli.Command{ marketDealFeesCmd, marketExportDatastoreCmd, + marketImportDatastoreCmd, }, } @@ -114,9 +115,11 @@ var marketDealFeesCmd = &cli.Command{ }, } +const mktsMetadataNamespace = "metadata" + var marketExportDatastoreCmd = &cli.Command{ Name: "export-datastore", - Description: "export datastore to a file", + Description: "export markets datastore key/values to a file", Flags: []cli.Flag{ &cli.StringFlag{ Name: "repo", @@ -136,43 +139,37 @@ var marketExportDatastoreCmd = &cli.Command{ backupDir = os.TempDir() } - // Create a new repo at the repo path - r, err := repo.NewFS(cctx.String("repo")) - if err != nil { - return xerrors.Errorf("opening fs repo: %w", err) - } - - // Make sure the repo exists - exists, err := r.Exists() - if err != nil { - return err - } - if !exists { - return xerrors.Errorf("lotus repo doesn't exist") - } - - // Lock the repo - lr, err := r.Lock(repo.StorageMiner) + // Open the repo at the repo path + repoPath := cctx.String("repo") + lr, err := openLockedRepo(repoPath) if err != nil { return err } defer lr.Close() //nolint:errcheck // Open the metadata datastore on the repo - namespace := "metadata" - ds, err := lr.Datastore(cctx.Context, datastore.NewKey(namespace).String()) + ds, err := lr.Datastore(cctx.Context, datastore.NewKey(mktsMetadataNamespace).String()) if err != nil { - return err + return xerrors.Errorf("opening datastore %s on repo %s: %w", mktsMetadataNamespace, repoPath, err) } // Create a tmp datastore that we'll add the exported key / values to // and then backup - backupDs, err := levelds.NewDatastore(backupDir, &levelds.Options{ + backupDsDir := path.Join(backupDir, "markets-backup-datastore") + if err := os.MkdirAll(backupDsDir, 0775); err != nil { //nolint:gosec + return xerrors.Errorf("creating tmp datastore directory: %w", err) + } + defer os.RemoveAll(backupDsDir) //nolint:errcheck + + backupDs, err := levelds.NewDatastore(backupDsDir, &levelds.Options{ Compression: ldbopts.NoCompression, NoSync: false, Strict: ldbopts.StrictAll, ReadOnly: false, }) + if err != nil { + return xerrors.Errorf("opening backup datastore at %s: %w", backupDir, err) + } // Export the key / values prefixes := []string{ @@ -197,7 +194,7 @@ var marketExportDatastoreCmd = &cli.Command{ fpath := path.Join(backupDir, "markets.datastore.backup") out, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY, 0644) if err != nil { - return xerrors.Errorf("open %s: %w", fpath, err) + return xerrors.Errorf("opening backup file %s: %w", fpath, err) } // Write the backup to the file @@ -236,3 +233,77 @@ func exportPrefix(prefix string, ds datastore.Batching, backupDs datastore.Batch return nil } + +var marketImportDatastoreCmd = &cli.Command{ + Name: "import-datastore", + Description: "import markets datastore key/values from a backup file", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "repo", + Usage: "path to the repo", + }, + &cli.StringFlag{ + Name: "backup-path", + Usage: "path to the backup directory", + Required: true, + }, + }, + Action: func(cctx *cli.Context) error { + logging.SetLogLevel("badger", "ERROR") // nolint:errcheck + + backupPath := cctx.String("backup-path") + + // Open the repo at the repo path + lr, err := openLockedRepo(cctx.String("repo")) + if err != nil { + return err + } + defer lr.Close() //nolint:errcheck + + // Open the metadata datastore on the repo + repoDs, err := lr.Datastore(cctx.Context, datastore.NewKey(mktsMetadataNamespace).String()) + if err != nil { + return err + } + + r, err := os.Open(backupPath) + if err != nil { + return xerrors.Errorf("opening backup path %s: %w", backupPath, err) + } + + fmt.Println("Importing from backup file " + backupPath) + err = backupds.RestoreInto(r, repoDs) + if err != nil { + return xerrors.Errorf("restoring backup from path %s: %w", backupPath, err) + } + + fmt.Println("Completed importing from backup file " + backupPath) + + return nil + }, +} + +func openLockedRepo(path string) (repo.LockedRepo, error) { + // Open the repo at the repo path + rpo, err := repo.NewFS(path) + if err != nil { + return nil, xerrors.Errorf("could not open repo %s: %w", path, err) + } + + // Make sure the repo exists + exists, err := rpo.Exists() + if err != nil { + return nil, xerrors.Errorf("checking repo %s exists: %w", path, err) + } + if !exists { + return nil, xerrors.Errorf("repo does not exist: %s", path) + } + + // Lock the repo + lr, err := rpo.Lock(repo.StorageMiner) + if err != nil { + return nil, xerrors.Errorf("locking repo %s: %w", path, err) + } + + return lr, nil +} From 9d61f91cdf8a431f167ddbfffeee22c6ebf9cb4e Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 26 Jul 2021 16:41:22 +0200 Subject: [PATCH 4/9] Update cmd/lotus-shed/market.go Co-authored-by: Aayush Rajasekaran --- cmd/lotus-shed/market.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lotus-shed/market.go b/cmd/lotus-shed/market.go index eb1b56a94..8221e53eb 100644 --- a/cmd/lotus-shed/market.go +++ b/cmd/lotus-shed/market.go @@ -244,7 +244,7 @@ var marketImportDatastoreCmd = &cli.Command{ }, &cli.StringFlag{ Name: "backup-path", - Usage: "path to the backup directory", + Usage: "path to the backup file", Required: true, }, }, From 0dd325866d435d208f3373810f60a801ce65ede2 Mon Sep 17 00:00:00 2001 From: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> Date: Mon, 26 Jul 2021 23:15:09 -0400 Subject: [PATCH 5/9] Update RELEASE_ISSUE_TEMPLATE.md --- documentation/misc/RELEASE_ISSUE_TEMPLATE.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md index 8adab9671..8eec88f88 100644 --- a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md +++ b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md @@ -64,23 +64,19 @@ Testing an RC: - [ ] **Stage 2 - Community Testing** - [ ] Inform beta miners (@lotus-early-testers-miner in Filecoin Slack #fil-lotus) - - [ ] Ask close ecosystem partners to test their projects (@lotus-early-testers-eco-dev in Filecoin slack #fil-lotus) + - [ ] Inform close ecosystem partners to test their projects (@lotus-early-testers-eco-dev in Filecoin slack #fil-lotus-dev) - [ ] Powergate - [ ] Glif - - [ ] Zondax - [ ] Stats dashboard - - [ ] Community dashboards - - [ ] Infura - [ ] Sentinel - [ ] Protofire - - [ ] Fleek - [ ] **Stage 3 - Community Prod Testing** - [ ] Documentation - [ ] Ensure that [CHANGELOG.md](https://github.com/filecoin-project/lotus/blob/master/CHANGELOG.md) is up to date - [ ] Check if any [config](https://docs.filecoin.io/get-started/lotus/configuration-and-advanced-usage/#configuration) updates are needed - [ ] Invite the wider community through (link to the release issue): - - [ ] Check `Create a discussion for this release` when tagging for the major rcs(new features, hot-fixes) release + - [ ] Check `Create a discussion for this release` when tagging for the major/close-to-final rcs(new features, hot-fixes) release - [ ] Link the disucssion in #fil-lotus on Filecoin slack - [ ] **Stage 4 - Release** @@ -91,11 +87,10 @@ Testing an RC: - [ ] Merge `release-vX.Y.Z` into the `releases` branch. - [ ] Tag this merge commit (on the `releases` branch) with `vX.Y.Z` - [ ] Cut the release [here](https://github.com/filecoin-project/lotus/releases/new?prerelease=true&target=releases). - - [ ] Check `Create a discussion for this release` when tagging the release - [ ] Final announcements - [ ] Update network.filecoin.io for mainnet, calib and nerpa. - - [ ] repost in #fil-lotus in filecoin slack - - [ ] Inform node provides (Protofire, Digital Ocean..) + - [ ] repost in #fil-lotus-announcement in filecoin slack + - [ ] Inform node providers (Protofire, Digital Ocean..) - [ ] **Post-Release** - [ ] Merge the `releases` branch back into `master`, ignoring the changes to `version.go` (keep the `-dev` version from master). Do NOT delete the `releases` branch when doing so! @@ -104,11 +99,7 @@ Testing an RC: ## ❤️ Contributors -< list generated by scripts/mkreleaselog > - -Would you like to contribute to Lotus and don't know how? Well, there are a few places you can get started: - -- TODO +See the final release notes! ## ⁉️ Do you have questions? From 48cddd3644f93a7f5069dc82893498b22f798ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 27 Jul 2021 14:25:28 +0100 Subject: [PATCH 6/9] add a super verbose -vv flag to lotus and lotus-miner. --- cli/util/api.go | 28 ++++++++++++++++++++++++++++ cli/util/verbose.go | 16 ++++++++++++++++ cmd/lotus-miner/main.go | 2 ++ cmd/lotus/main.go | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 cli/util/verbose.go diff --git a/cli/util/api.go b/cli/util/api.go index ecd2e927f..b7210a18f 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -146,6 +146,10 @@ func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http. return "", nil, xerrors.Errorf("could not get DialArgs: %w", err) } + if IsSuperVerbose { + _, _ = fmt.Fprintf(ctx.App.Writer, "using raw API %s endpoint: %s\n", version, addr) + } + return addr, ainfo.AuthHeader(), nil } @@ -185,6 +189,10 @@ func GetFullNodeAPI(ctx *cli.Context) (v0api.FullNode, jsonrpc.ClientCloser, err return nil, nil, err } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v0 endpoint:", addr) + } + return client.NewFullNodeRPCV0(ctx.Context, addr, headers) } @@ -198,6 +206,10 @@ func GetFullNodeAPIV1(ctx *cli.Context) (v1api.FullNode, jsonrpc.ClientCloser, e return nil, nil, err } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v1 endpoint:", addr) + } + return client.NewFullNodeRPCV1(ctx.Context, addr, headers) } @@ -242,6 +254,10 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St addr = u.String() } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using miner API v0 endpoint:", addr) + } + return client.NewStorageMinerRPCV0(ctx.Context, addr, headers) } @@ -251,6 +267,10 @@ func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) { return nil, nil, err } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using worker API v0 endpoint:", addr) + } + return client.NewWorkerRPCV0(ctx.Context, addr, headers) } @@ -260,6 +280,10 @@ func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) return nil, nil, err } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v1 endpoint:", addr) + } + return client.NewGatewayRPCV1(ctx.Context, addr, headers) } @@ -269,6 +293,10 @@ func GetGatewayAPIV0(ctx *cli.Context) (v0api.Gateway, jsonrpc.ClientCloser, err return nil, nil, err } + if IsSuperVerbose { + _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v0 endpoint:", addr) + } + return client.NewGatewayRPCV0(ctx.Context, addr, headers) } diff --git a/cli/util/verbose.go b/cli/util/verbose.go new file mode 100644 index 000000000..b1eb1a9be --- /dev/null +++ b/cli/util/verbose.go @@ -0,0 +1,16 @@ +package cliutil + +import "github.com/urfave/cli/v2" + +// IsSuperVerbose is a global var signalling if we're running in super verbose +// mode or not (default: false). +var IsSuperVerbose bool + +// FlagSuperVerbose enables super verbose mode, which is useful when debugging +// the CLI itself. It should be included as a flag on the top-level command +// (e.g. lotus -vv, lotus-miner -vv). +var FlagSuperVerbose = &cli.BoolFlag{ + Name: "vv", + Usage: "enables super verbose mode, useful for debugging the CLI", + Destination: &IsSuperVerbose, +} diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index c555531d6..c14f85b93 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/fatih/color" + cliutil "github.com/filecoin-project/lotus/cli/util" logging "github.com/ipfs/go-log/v2" "github.com/urfave/cli/v2" "go.opencensus.io/trace" @@ -105,6 +106,7 @@ func main() { Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME Usage: fmt.Sprintf("Specify miner repo path. flag(%s) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON", FlagMinerRepoDeprecation), }, + cliutil.FlagSuperVerbose, }, Commands: append(local, lcli.CommonCommands...), diff --git a/cmd/lotus/main.go b/cmd/lotus/main.go index d803cce1e..6719116ce 100644 --- a/cmd/lotus/main.go +++ b/cmd/lotus/main.go @@ -12,6 +12,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" lcli "github.com/filecoin-project/lotus/cli" + cliutil "github.com/filecoin-project/lotus/cli/util" "github.com/filecoin-project/lotus/lib/lotuslog" "github.com/filecoin-project/lotus/lib/tracing" "github.com/filecoin-project/lotus/node/repo" @@ -81,6 +82,7 @@ func main() { Name: "force-send", Usage: "if true, will ignore pre-send checks", }, + cliutil.FlagSuperVerbose, }, Commands: append(local, lcli.Commands...), From 3451acbc0313df454aa0cf97108624ca72dfeb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 27 Jul 2021 15:28:10 +0100 Subject: [PATCH 7/9] docgen. --- documentation/en/cli-lotus-miner.md | 1 + documentation/en/cli-lotus.md | 1 + 2 files changed, 2 insertions(+) diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 2ba693bff..9884edf27 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -43,6 +43,7 @@ GLOBAL OPTIONS: --actor value, -a value specify other actor to check state for (read only) --color use color in display output (default: depends on output being a TTY) --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] + --vv enables super verbose mode, useful for debugging the CLI (default: false) --help, -h show help (default: false) --version, -v print the version (default: false) ``` diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index cae648a0d..7418f433d 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -39,6 +39,7 @@ COMMANDS: GLOBAL OPTIONS: --interactive setting to false will disable interactive functionality of commands (default: false) --force-send if true, will ignore pre-send checks (default: false) + --vv enables super verbose mode, useful for debugging the CLI (default: false) --help, -h show help (default: false) --version, -v print the version (default: false) ``` From 2f03b456de77509bc7d4fe1d1b286bf6e2388869 Mon Sep 17 00:00:00 2001 From: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> Date: Tue, 27 Jul 2021 12:00:08 -0400 Subject: [PATCH 8/9] Update RELEASE_ISSUE_TEMPLATE.md --- documentation/misc/RELEASE_ISSUE_TEMPLATE.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md index 8eec88f88..53cfd0418 100644 --- a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md +++ b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md @@ -63,13 +63,8 @@ Testing an RC: - [ ] (optional) let a sector go faulty, and see it be recovered - [ ] **Stage 2 - Community Testing** - - [ ] Inform beta miners (@lotus-early-testers-miner in Filecoin Slack #fil-lotus) - - [ ] Inform close ecosystem partners to test their projects (@lotus-early-testers-eco-dev in Filecoin slack #fil-lotus-dev) - - [ ] Powergate - - [ ] Glif - - [ ] Stats dashboard - - [ ] Sentinel - - [ ] Protofire + - [ ] Inform beta lotus users (@lotus-early-testers in Filecoin Slack #fil-lotus) + - [ ] **Stage 3 - Community Prod Testing** - [ ] Documentation From b04fb75a924370c81423de62f24036cb5da4ad47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 27 Jul 2021 20:46:02 +0100 Subject: [PATCH 9/9] rename flag to very verbose. --- cli/util/api.go | 14 +++++++------- cli/util/verbose.go | 14 +++++++------- cmd/lotus-miner/main.go | 2 +- cmd/lotus/main.go | 2 +- documentation/en/cli-lotus-miner.md | 2 +- documentation/en/cli-lotus.md | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cli/util/api.go b/cli/util/api.go index b7210a18f..730b75d9d 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -146,7 +146,7 @@ func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http. return "", nil, xerrors.Errorf("could not get DialArgs: %w", err) } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintf(ctx.App.Writer, "using raw API %s endpoint: %s\n", version, addr) } @@ -189,7 +189,7 @@ func GetFullNodeAPI(ctx *cli.Context) (v0api.FullNode, jsonrpc.ClientCloser, err return nil, nil, err } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v0 endpoint:", addr) } @@ -206,7 +206,7 @@ func GetFullNodeAPIV1(ctx *cli.Context) (v1api.FullNode, jsonrpc.ClientCloser, e return nil, nil, err } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v1 endpoint:", addr) } @@ -254,7 +254,7 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St addr = u.String() } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using miner API v0 endpoint:", addr) } @@ -267,7 +267,7 @@ func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) { return nil, nil, err } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using worker API v0 endpoint:", addr) } @@ -280,7 +280,7 @@ func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) return nil, nil, err } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v1 endpoint:", addr) } @@ -293,7 +293,7 @@ func GetGatewayAPIV0(ctx *cli.Context) (v0api.Gateway, jsonrpc.ClientCloser, err return nil, nil, err } - if IsSuperVerbose { + if IsVeryVerbose { _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v0 endpoint:", addr) } diff --git a/cli/util/verbose.go b/cli/util/verbose.go index b1eb1a9be..efcad0962 100644 --- a/cli/util/verbose.go +++ b/cli/util/verbose.go @@ -2,15 +2,15 @@ package cliutil import "github.com/urfave/cli/v2" -// IsSuperVerbose is a global var signalling if we're running in super verbose -// mode or not (default: false). -var IsSuperVerbose bool +// IsVeryVerbose is a global var signalling if the CLI is running in very +// verbose mode or not (default: false). +var IsVeryVerbose bool -// FlagSuperVerbose enables super verbose mode, which is useful when debugging +// FlagVeryVerbose enables very verbose mode, which is useful when debugging // the CLI itself. It should be included as a flag on the top-level command // (e.g. lotus -vv, lotus-miner -vv). -var FlagSuperVerbose = &cli.BoolFlag{ +var FlagVeryVerbose = &cli.BoolFlag{ Name: "vv", - Usage: "enables super verbose mode, useful for debugging the CLI", - Destination: &IsSuperVerbose, + Usage: "enables very verbose mode, useful for debugging the CLI", + Destination: &IsVeryVerbose, } diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index c14f85b93..c697de0c9 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -106,7 +106,7 @@ func main() { Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME Usage: fmt.Sprintf("Specify miner repo path. flag(%s) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON", FlagMinerRepoDeprecation), }, - cliutil.FlagSuperVerbose, + cliutil.FlagVeryVerbose, }, Commands: append(local, lcli.CommonCommands...), diff --git a/cmd/lotus/main.go b/cmd/lotus/main.go index 6719116ce..66eae0f1e 100644 --- a/cmd/lotus/main.go +++ b/cmd/lotus/main.go @@ -82,7 +82,7 @@ func main() { Name: "force-send", Usage: "if true, will ignore pre-send checks", }, - cliutil.FlagSuperVerbose, + cliutil.FlagVeryVerbose, }, Commands: append(local, lcli.Commands...), diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 9884edf27..29593fbd4 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -43,7 +43,7 @@ GLOBAL OPTIONS: --actor value, -a value specify other actor to check state for (read only) --color use color in display output (default: depends on output being a TTY) --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] - --vv enables super verbose mode, useful for debugging the CLI (default: false) + --vv enables very verbose mode, useful for debugging the CLI (default: false) --help, -h show help (default: false) --version, -v print the version (default: false) ``` diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 7418f433d..5faf5c58b 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -39,7 +39,7 @@ COMMANDS: GLOBAL OPTIONS: --interactive setting to false will disable interactive functionality of commands (default: false) --force-send if true, will ignore pre-send checks (default: false) - --vv enables super verbose mode, useful for debugging the CLI (default: false) + --vv enables very verbose mode, useful for debugging the CLI (default: false) --help, -h show help (default: false) --version, -v print the version (default: false) ```