make lotus-miner info all more robust

This commit is contained in:
Łukasz Magiera 2021-03-12 12:23:43 +01:00
parent 06aaa668d6
commit a373fc4c4c

View File

@ -35,80 +35,80 @@ var infoAllCmd = &cli.Command{
fmt.Println("#: Version") fmt.Println("#: Version")
if err := lcli.VersionCmd.Action(cctx); err != nil { if err := lcli.VersionCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Miner Info") fmt.Println("\n#: Miner Info")
if err := infoCmdAct(cctx); err != nil { if err := infoCmdAct(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
// Verbose info // Verbose info
fmt.Println("\n#: Storage List") fmt.Println("\n#: Storage List")
if err := storageListCmd.Action(cctx); err != nil { if err := storageListCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Worker List") fmt.Println("\n#: Worker List")
if err := sealingWorkersCmd.Action(cctx); err != nil { if err := sealingWorkersCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: PeerID") fmt.Println("\n#: PeerID")
if err := lcli.NetId.Action(cctx); err != nil { if err := lcli.NetId.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Listen Addresses") fmt.Println("\n#: Listen Addresses")
if err := lcli.NetListen.Action(cctx); err != nil { if err := lcli.NetListen.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Reachability") fmt.Println("\n#: Reachability")
if err := lcli.NetReachability.Action(cctx); err != nil { if err := lcli.NetReachability.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
// Very Verbose info // Very Verbose info
fmt.Println("\n#: Peers") fmt.Println("\n#: Peers")
if err := lcli.NetPeers.Action(cctx); err != nil { if err := lcli.NetPeers.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Sealing Jobs") fmt.Println("\n#: Sealing Jobs")
if err := sealingJobsCmd.Action(cctx); err != nil { if err := sealingJobsCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Sched Diag") fmt.Println("\n#: Sched Diag")
if err := sealingSchedDiagCmd.Action(cctx); err != nil { if err := sealingSchedDiagCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Storage Ask") fmt.Println("\n#: Storage Ask")
if err := getAskCmd.Action(cctx); err != nil { if err := getAskCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Storage Deals") fmt.Println("\n#: Storage Deals")
if err := dealsListCmd.Action(cctx); err != nil { if err := dealsListCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Retrieval Deals") fmt.Println("\n#: Retrieval Deals")
if err := retrievalDealsListCmd.Action(cctx); err != nil { if err := retrievalDealsListCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Sector List") fmt.Println("\n#: Sector List")
if err := sectorsListCmd.Action(cctx); err != nil { if err := sectorsListCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
fmt.Println("\n#: Sector Refs") fmt.Println("\n#: Sector Refs")
if err := sectorsRefsCmd.Action(cctx); err != nil { if err := sectorsRefsCmd.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
// Very Very Verbose info // Very Very Verbose info
@ -116,7 +116,7 @@ var infoAllCmd = &cli.Command{
list, err := nodeApi.SectorsList(ctx) list, err := nodeApi.SectorsList(ctx)
if err != nil { if err != nil {
return err fmt.Println("ERROR: ", err)
} }
sort.Slice(list, func(i, j int) bool { sort.Slice(list, func(i, j int) bool {
@ -129,11 +129,11 @@ var infoAllCmd = &cli.Command{
fs := &flag.FlagSet{} fs := &flag.FlagSet{}
for _, f := range sectorsStatusCmd.Flags { for _, f := range sectorsStatusCmd.Flags {
if err := f.Apply(fs); err != nil { if err := f.Apply(fs); err != nil {
return err fmt.Println("ERROR: ", err)
} }
} }
if err := fs.Parse([]string{"--log", "--on-chain-info", fmt.Sprint(s)}); err != nil { if err := fs.Parse([]string{"--log", "--on-chain-info", fmt.Sprint(s)}); err != nil {
return err fmt.Println("ERROR: ", err)
} }
if err := sectorsStatusCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { if err := sectorsStatusCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil {
@ -144,7 +144,7 @@ var infoAllCmd = &cli.Command{
fs = &flag.FlagSet{} fs = &flag.FlagSet{}
if err := fs.Parse([]string{fmt.Sprint(s)}); err != nil { if err := fs.Parse([]string{fmt.Sprint(s)}); err != nil {
return err fmt.Println("ERROR: ", err)
} }
if err := storageFindCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { if err := storageFindCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil {
@ -155,7 +155,7 @@ var infoAllCmd = &cli.Command{
if !_test { if !_test {
fmt.Println("\n#: Goroutines") fmt.Println("\n#: Goroutines")
if err := lcli.PprofGoroutines.Action(cctx); err != nil { if err := lcli.PprofGoroutines.Action(cctx); err != nil {
return err fmt.Println("ERROR: ", err)
} }
} }