Skip to content

Commit

Permalink
Added type field to the node query result
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Feb 20, 2023
1 parent 5775955 commit 94cd991
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/node/client/cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ var (
"Latency",
"Peers",
"Handshake",
"Type",
"Version",
"Status",
}
nodeTypes = map[uint64]string{
1: "WireGuard",
2: "V2Ray",
}
)

func fetchNodeInfo(remote string, timeout time.Duration) (info types.Info, err error) {
Expand Down Expand Up @@ -127,6 +132,7 @@ func QueryNode() *cobra.Command {
item.Latency.Truncate(1 * time.Millisecond).String(),
fmt.Sprintf("%d", item.Peers),
fmt.Sprintf("%t", item.Handshake.Enable),
nodeTypes[item.Type],
item.Version,
item.Status,
},
Expand Down Expand Up @@ -245,6 +251,7 @@ func QueryNodes() *cobra.Command {
item.Latency.Truncate(1 * time.Millisecond).String(),
fmt.Sprintf("%d", item.Peers),
fmt.Sprintf("%t", item.Handshake.Enable),
nodeTypes[item.Type],
item.Version,
item.Status,
},
Expand Down

0 comments on commit 94cd991

Please sign in to comment.