add splitstore info command

This commit is contained in:
vyzo 2021-07-26 08:47:02 +03:00
parent ce528a1293
commit 221dc7024f

View File

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