From cadf52bb0ae444897a642fd5273171cf354d4276 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 29 Jul 2020 16:34:01 -0400 Subject: [PATCH] Include listen addresses in CLI miner info --- cli/state.go | 10 ++++++++++ cmd/lotus-storage-miner/actor.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cli/state.go b/cli/state.go index d1b9f9b71..3495b4301 100644 --- a/cli/state.go +++ b/cli/state.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/multiformats/go-multiaddr" "html/template" "io" "os" @@ -105,6 +106,15 @@ var stateMinerInfo = &cli.Command{ fmt.Printf("Worker:\t%s\n", mi.Worker) fmt.Printf("PeerID:\t%s\n", mi.PeerId) fmt.Printf("SectorSize:\t%s (%d)\n", types.SizeStr(types.NewInt(uint64(mi.SectorSize))), mi.SectorSize) + fmt.Printf("Multiaddrs: \t") + for _, addr := range mi.Multiaddrs { + a, err := multiaddr.NewMultiaddrBytes(addr) + if err != nil { + return xerrors.Errorf("undecodable listen address: %w", err) + } + fmt.Printf("%s ", a) + } + fmt.Println() return nil }, diff --git a/cmd/lotus-storage-miner/actor.go b/cmd/lotus-storage-miner/actor.go index 4e756d2f8..7874cb19d 100644 --- a/cmd/lotus-storage-miner/actor.go +++ b/cmd/lotus-storage-miner/actor.go @@ -24,7 +24,7 @@ var actorCmd = &cli.Command{ var actorSetAddrsCmd = &cli.Command{ Name: "set-addrs", - Usage: "set addresses that your miner can be publically dialed on", + Usage: "set addresses that your miner can be publicly dialed on", Flags: []cli.Flag{ &cli.Int64Flag{ Name: "gas-limit",