node/cmd: rename list-nodes to list-nodes-stream

Change-Id: I07df1c0bb7634f6a9f65db150d353e30a681d2bc
This commit is contained in:
Leo 2021-08-07 21:00:17 +02:00 committed by Leopold Schabel
parent 24e5406e84
commit aa608b9396
2 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,7 @@ func init() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
pf = AdminClientListNodes.Flags() pf = AdminClientListNodesStream.Flags()
clientSocketPath = pf.String("socket", "", "gRPC admin server socket to connect to") clientSocketPath = pf.String("socket", "", "gRPC admin server socket to connect to")
err = cobra.MarkFlagRequired(pf, "socket") err = cobra.MarkFlagRequired(pf, "socket")
if err != nil { if err != nil {
@ -34,7 +34,7 @@ func init() {
AdminCmd.AddCommand(AdminClientInjectGuardianSetUpdateCmd) AdminCmd.AddCommand(AdminClientInjectGuardianSetUpdateCmd)
AdminCmd.AddCommand(AdminClientGovernanceVAAVerifyCmd) AdminCmd.AddCommand(AdminClientGovernanceVAAVerifyCmd)
AdminCmd.AddCommand(AdminClientListNodes) AdminCmd.AddCommand(AdminClientListNodesStream)
} }
var AdminCmd = &cobra.Command{ var AdminCmd = &cobra.Command{

View File

@ -14,13 +14,13 @@ import (
// How to test in container: // How to test in container:
// kubectl exec guardian-0 -- /guardiand admin list-nodes --socket /tmp/admin.sock // kubectl exec guardian-0 -- /guardiand admin list-nodes --socket /tmp/admin.sock
var AdminClientListNodes = &cobra.Command{ var AdminClientListNodesStream = &cobra.Command{
Use: "list-nodes", Use: "list-nodes-stream",
Short: "Listens to heartbeats and displays an aggregated list of nodes (UNTRUSTED)", Short: "Listens to heartbeats and displays an aggregated real-time list of guardian nodes",
Run: runListNodes, Run: runListNodesStream,
} }
func runListNodes(cmd *cobra.Command, args []string) { func runListNodesStream(cmd *cobra.Command, args []string) {
ctx := context.Background() ctx := context.Background()
conn, err, c := getPublicrpcClient(ctx, *clientSocketPath) conn, err, c := getPublicrpcClient(ctx, *clientSocketPath)
defer conn.Close() defer conn.Close()