Merge pull request #345 from filecoin-project/feat/sminer-info

sminer: Info command
This commit is contained in:
Łukasz Magiera 2019-10-12 02:11:52 +02:00 committed by GitHub
commit 63fa2f1ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -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
},
}

View File

@ -21,6 +21,7 @@ func main() {
local := []*cli.Command{
runCmd,
initCmd,
infoCmd,
storeGarbageCmd,
sectorsCmd,
}