-
Notifications
You must be signed in to change notification settings - Fork 0
/
net.go
31 lines (29 loc) · 793 Bytes
/
net.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cli
import (
"github.com/spf13/cobra"
"github.com/sudachen/smwlt/fu/stdio"
"strings"
)
var cmdNet = &cobra.Command{
Use: "net",
Short: "Display the node status",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
c := newClient()
nfo := c.LuckyNodeInfo()
const format = "%-16s %v\n"
stdio.Printf("Node status:\n"+strings.Repeat("\t"+format, 9),
"Synced:", nfo.Synced,
"Synced layer:", nfo.SyncedLayer,
"Current layer:", nfo.CurrentLayer,
//"Verified layer:", nfo.VerifiedLayer,
"Peers:", nfo.Peers,
"Min peers:", nfo.MinPeers,
"Max peers:", nfo.MaxPeers,
"Data directory:", nfo.DataDir,
"Mining status:", nfo.Status,
"Coinbase:", nfo.Coinbase.Hex(),
//"Remaining bytes:", nfo.SmeshingRemainingBytes,
)
},
}