From 94cd99159f72dddb98c7ee33fced238dbac943c5 Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Mon, 20 Feb 2023 19:50:30 +0530 Subject: [PATCH] Added type field to the node query result --- x/node/client/cmd/query.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/x/node/client/cmd/query.go b/x/node/client/cmd/query.go index 12b16ca..658be7c 100644 --- a/x/node/client/cmd/query.go +++ b/x/node/client/cmd/query.go @@ -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) { @@ -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, }, @@ -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, },