From 5861332f409ee4914a1b65eec021862dfe15edee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 12 Oct 2019 01:47:29 +0200 Subject: [PATCH] sminer: info command --- cmd/lotus-storage-miner/info.go | 34 +++++++++++++++++++++++++++++++++ cmd/lotus-storage-miner/main.go | 1 + 2 files changed, 35 insertions(+) create mode 100644 cmd/lotus-storage-miner/info.go diff --git a/cmd/lotus-storage-miner/info.go b/cmd/lotus-storage-miner/info.go new file mode 100644 index 000000000..702af2c2b --- /dev/null +++ b/cmd/lotus-storage-miner/info.go @@ -0,0 +1,34 @@ +package main + +import ( + "fmt" + + "gopkg.in/urfave/cli.v2" + + lcli "github.com/filecoin-project/go-lotus/cli" +) + +var infoCmd = &cli.Command{ + Name: "info", + Usage: "Print storage miner info", + Action: func(cctx *cli.Context) error { + nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer closer() + ctx := lcli.ReqContext(cctx) + + aaddr, err := nodeApi.ActorAddresses(ctx) + if err != nil { + return err + } + + fmt.Printf("actor address: %s\n", aaddr) + // TODO: grab actr state / info + // * Sector size + // * Sealed sectors (count / bytes) + // * Power + return nil + }, +} diff --git a/cmd/lotus-storage-miner/main.go b/cmd/lotus-storage-miner/main.go index 131a4b42d..b7360f7e8 100644 --- a/cmd/lotus-storage-miner/main.go +++ b/cmd/lotus-storage-miner/main.go @@ -21,6 +21,7 @@ func main() { local := []*cli.Command{ runCmd, initCmd, + infoCmd, storeGarbageCmd, sectorsCmd, }