From 0d3aaabd2cc1adf857cb7530608b55b13e4bc77f Mon Sep 17 00:00:00 2001 From: lanzafame Date: Mon, 17 Aug 2020 13:51:04 +1000 Subject: [PATCH] Add config command that prints the default config file for a storage miner --- cmd/lotus-storage-miner/config.go | 22 ++++++++++++++++++++++ cmd/lotus-storage-miner/main.go | 1 + 2 files changed, 23 insertions(+) create mode 100644 cmd/lotus-storage-miner/config.go diff --git a/cmd/lotus-storage-miner/config.go b/cmd/lotus-storage-miner/config.go new file mode 100644 index 000000000..0c843fe23 --- /dev/null +++ b/cmd/lotus-storage-miner/config.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + + "github.com/urfave/cli/v2" + + "github.com/filecoin-project/lotus/node/config" +) + +var configCmd = &cli.Command{ + Name: "config", + Usage: "Output default configuration", + Action: func(cctx *cli.Context) error { + comm, err := config.ConfigComment(config.DefaultStorageMiner()) + if err != nil { + return err + } + fmt.Println(string(comm)) + return nil + }, +} diff --git a/cmd/lotus-storage-miner/main.go b/cmd/lotus-storage-miner/main.go index 5848bb0eb..c4ba2a171 100644 --- a/cmd/lotus-storage-miner/main.go +++ b/cmd/lotus-storage-miner/main.go @@ -32,6 +32,7 @@ func main() { initCmd, runCmd, stopCmd, + configCmd, lcli.WithCategory("chain", actorCmd), lcli.WithCategory("chain", rewardsCmd), lcli.WithCategory("chain", infoCmd),