refactor miner info command.
This commit is contained in:
parent
7d6eb250ea
commit
d9c6a32b8e
@ -128,7 +128,6 @@ var AuthApiInfoToken = &cli.Command{
|
||||
|
||||
// TODO: Log in audit log when it is implemented
|
||||
|
||||
// WARN: this is unable to tell
|
||||
currentEnv, _ := cliutil.EnvsForRepo(t)
|
||||
fmt.Printf("%s=%s:%s\n", currentEnv, string(token), ainfo.Addr)
|
||||
return nil
|
||||
|
@ -1,30 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var dagstoreCmd = &cli.Command{
|
||||
Name: "dagstore",
|
||||
Usage: "Manage the DAG store",
|
||||
Subcommands: []*cli.Command{
|
||||
dagstoreListShardsCmd,
|
||||
dagstoreGarbageCollectCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var dagstoreListShardsCmd = &cli.Command{
|
||||
Name: "list-shards",
|
||||
Usage: "List shards known to the DAG store",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var dagstoreGarbageCollectCmd = &cli.Command{
|
||||
Name: "gc",
|
||||
Usage: "Garbage collect the DAG store",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
return nil
|
||||
},
|
||||
}
|
@ -50,7 +50,13 @@ var infoCmd = &cli.Command{
|
||||
}
|
||||
|
||||
func infoCmdAct(cctx *cli.Context) error {
|
||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
marketsApi, closer, err := lcli.GetMarketsAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -64,12 +70,19 @@ func infoCmdAct(cctx *cli.Context) error {
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
subsystems, err := nodeApi.RuntimeSubsystems(ctx)
|
||||
subsystems, err := minerApi.RuntimeSubsystems(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("Enabled subsystems:", subsystems)
|
||||
fmt.Println("Enabled subsystems (from miner API):", subsystems)
|
||||
|
||||
subsystems, err = marketsApi.RuntimeSubsystems(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println("Enabled subsystems (from markets API):", subsystems)
|
||||
|
||||
fmt.Print("Chain: ")
|
||||
|
||||
@ -103,19 +116,15 @@ func infoCmdAct(cctx *cli.Context) error {
|
||||
|
||||
fmt.Println()
|
||||
|
||||
if subsystems.Has(api.SubsystemSectorStorage) {
|
||||
err := handleMiningInfo(ctx, cctx, fullapi, nodeApi)
|
||||
err = handleMiningInfo(ctx, cctx, fullapi, minerApi)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if subsystems.Has(api.SubsystemMarkets) {
|
||||
err := handleMarketsInfo(ctx, nodeApi)
|
||||
err = handleMarketsInfo(ctx, marketsApi)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user