From 221dc7024f763f6d470a4a40101a8b3816a7f632 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 26 Jul 2021 08:47:02 +0300 Subject: [PATCH] add splitstore info command --- cmd/lotus-shed/splitstore.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cmd/lotus-shed/splitstore.go b/cmd/lotus-shed/splitstore.go index ff949fda9..c2363c655 100644 --- a/cmd/lotus-shed/splitstore.go +++ b/cmd/lotus-shed/splitstore.go @@ -30,6 +30,7 @@ var splitstoreCmd = &cli.Command{ Subcommands: []*cli.Command{ splitstoreRollbackCmd, splitstoreCheckCmd, + splitstoreInfoCmd, }, } @@ -281,3 +282,29 @@ var splitstoreCheckCmd = &cli.Command{ return api.ChainCheckBlockstore(ctx) }, } + +var splitstoreInfoCmd = &cli.Command{ + Name: "info", + Description: "prints some basic splitstore information", + Action: func(cctx *cli.Context) error { + api, closer, err := lcli.GetFullNodeAPIV1(cctx) + if err != nil { + return err + } + defer closer() + + ctx := lcli.ReqContext(cctx) + info, err := api.ChainBlockstoreInfo(ctx) + if err != nil { + return err + } + + for k, v := range info { + fmt.Print(k) + fmt.Print(": ") + fmt.Println(v) + } + + return nil + }, +}