Skip to content

Commit be2851d

Browse files
committed
fix: UX issues
1 parent fbb99c7 commit be2851d

15 files changed

Lines changed: 200 additions & 193 deletions

File tree

push-validator-manager/cmd/push-validator/cmd_balance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func handleBalance(cfg config.Config, args []string) error {
2121
if addr == "" {
2222
key := os.Getenv("KEY_NAME")
2323
if key == "" {
24-
if flagOutput == "json" { getPrinter().JSON(map[string]any{"ok": false, "error": "address not provided; set KEY_NAME or pass --address"}) } else { fmt.Println("usage: push-validator-manager balance <address> (or set KEY_NAME)") }
24+
if flagOutput == "json" { getPrinter().JSON(map[string]any{"ok": false, "error": "address not provided; set KEY_NAME or pass --address"}) } else { fmt.Println("usage: push-validator balance <address> (or set KEY_NAME)") }
2525
return fmt.Errorf("address not provided")
2626
}
2727
out, err := exec.Command(findPchaind(), "keys", "show", key, "-a", "--keyring-backend", cfg.KeyringBackend, "--home", cfg.HomeDir).Output()

push-validator-manager/cmd/push-validator/cmd_doctor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func checkProcessRunning(cfg config.Config, c *ui.ColorConfig) checkResult {
108108
} else {
109109
result.Status = "fail"
110110
result.Message = "Validator process not running"
111-
result.Details = []string{"Run 'push-validator-manager start' to start the node"}
111+
result.Details = []string{"Run 'push-validator start' to start the node"}
112112
}
113113

114114
printCheck(result, c)
@@ -162,7 +162,7 @@ func checkConfigFiles(cfg config.Config, c *ui.ColorConfig) checkResult {
162162
if len(missing) > 0 {
163163
result.Status = "fail"
164164
result.Message = fmt.Sprintf("Missing configuration files: %s", strings.Join(missing, ", "))
165-
result.Details = []string{"Run 'push-validator-manager init' to initialize configuration"}
165+
result.Details = []string{"Run 'push-validator init' to initialize configuration"}
166166
} else {
167167
result.Status = "pass"
168168
result.Message = "All required configuration files present"

push-validator-manager/cmd/push-validator/cmd_register.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ func handleRegisterValidator(cfg config.Config) {
8383
p.Section("Validator Status")
8484
fmt.Println()
8585
fmt.Println(p.Colors.Info(" Check your validator:"))
86-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager validators"))
86+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator validators"))
8787
fmt.Println()
8888
fmt.Println(p.Colors.Info(" Monitor node status:"))
89-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager status"))
89+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator status"))
9090
fmt.Println()
9191
}
9292
return
@@ -260,7 +260,7 @@ func runRegisterValidator(cfg config.Config, moniker, keyName, amount, commissio
260260
if flagOutput == "json" {
261261
getPrinter().JSON(map[string]any{"ok": false, "error": "node is still syncing"})
262262
} else {
263-
fmt.Println("node is still syncing. Run 'push-validator-manager sync' first")
263+
fmt.Println("node is still syncing. Run 'push-validator sync' first")
264264
}
265265
return
266266
}
@@ -375,10 +375,10 @@ func runRegisterValidator(cfg config.Config, moniker, keyName, amount, commissio
375375
p.Section("Resolution Options")
376376
fmt.Println()
377377
fmt.Println(p.Colors.Info(" 1. Check existing validators:"))
378-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager validators"))
378+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator validators"))
379379
fmt.Println()
380380
fmt.Println(p.Colors.Info(" 2. To register a new validator, reset node data:"))
381-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager reset"))
381+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator reset"))
382382
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " (This will generate new validator keys)"))
383383
fmt.Println()
384384
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " Note: Resetting will create a new validator identity."))
@@ -413,16 +413,16 @@ func runRegisterValidator(cfg config.Config, moniker, keyName, amount, commissio
413413
fmt.Println(p.Colors.Separator(40))
414414
fmt.Println()
415415
fmt.Println(p.Colors.Info(" 1. Check validator status:"))
416-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager validators"))
416+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator validators"))
417417
fmt.Println()
418418
fmt.Println(p.Colors.Info(" 2. Live dashboard:"))
419-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager dashboard"))
419+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator dashboard"))
420420
fmt.Println()
421421
fmt.Println(p.Colors.Info(" 3. Monitor node status:"))
422-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager status"))
422+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator status"))
423423
fmt.Println()
424424
fmt.Println(p.Colors.Info(" 4. View node logs:"))
425-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager logs"))
425+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator logs"))
426426
fmt.Println()
427427
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " Your validator will appear in the active set after the next epoch."))
428428
fmt.Println()

push-validator-manager/cmd/push-validator/cmd_reset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func handleFullReset(cfg config.Config, sup process.Supervisor) error {
151151
p.Success("✓ Full reset complete")
152152
fmt.Println()
153153
fmt.Println(p.Colors.Info("Next steps:"))
154-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager start"))
154+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator start"))
155155
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " (will auto-initialize with new validator keys)"))
156156
}
157157

push-validator-manager/cmd/push-validator/cmd_start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func handleStop(sup process.Supervisor) error {
1818
p.Success("✓ Node stopped")
1919
fmt.Println()
2020
fmt.Println(p.Colors.Info("Next steps:"))
21-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager start"))
21+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator start"))
2222
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " (start the node)"))
2323
}
2424
return nil

push-validator-manager/cmd/push-validator/cmd_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,6 @@ func printStatusText(result statusResult) {
191191

192192
// Add hint when no peers connected
193193
if result.Peers == 0 && result.Running && result.RPCListening {
194-
fmt.Printf("\n%s Check connectivity: push-validator-manager doctor\n", c.Info("ℹ"))
194+
fmt.Printf("\n%s Check connectivity: push-validator doctor\n", c.Info("ℹ"))
195195
}
196196
}

push-validator-manager/cmd/push-validator/cmd_sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ func init() {
6262
if !syncSkipFinal {
6363
out := cmd.OutOrStdout()
6464
if flagQuiet {
65-
fmt.Fprintln(out, "Sync complete.")
65+
fmt.Fprintln(out, " Sync complete.")
6666
} else {
67-
fmt.Fprintln(out, " Sync complete! Node is fully synced.")
67+
fmt.Fprintln(out, " Sync complete! Node is fully synced.")
6868
}
6969
}
7070
return nil

push-validator-manager/cmd/push-validator/cmd_unjail.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func handleUnjail(cfg config.Config) {
6464
fmt.Println(p.Colors.Warning("⚠️ Node is still syncing to latest block"))
6565
fmt.Println()
6666
fmt.Println(p.Colors.Info("Please wait for sync to complete before unjailing."))
67-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager sync"))
67+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator sync"))
6868
fmt.Println()
6969
}
7070
return
@@ -102,7 +102,7 @@ func handleUnjail(cfg config.Config) {
102102
fmt.Println(p.Colors.Warning("⚠️ This node is not registered as a validator"))
103103
fmt.Println()
104104
fmt.Println(p.Colors.Info("Register first using:"))
105-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager register-validator"))
105+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator register-validator"))
106106
fmt.Println()
107107
}
108108
return
@@ -302,13 +302,13 @@ func handleUnjail(cfg config.Config) {
302302
fmt.Println(p.Colors.Separator(40))
303303
fmt.Println()
304304
fmt.Println(p.Colors.Info(" 1. Check validator status:"))
305-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager validators"))
305+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator validators"))
306306
fmt.Println()
307307
fmt.Println(p.Colors.Info(" 2. Monitor node status:"))
308-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager status"))
308+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator status"))
309309
fmt.Println()
310310
fmt.Println(p.Colors.Info(" 3. Live dashboard:"))
311-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager dashboard"))
311+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator dashboard"))
312312
fmt.Println()
313313
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " Your validator will resume block signing and earning rewards."))
314314
fmt.Println()

push-validator-manager/cmd/push-validator/cmd_update.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func runUpdate(cmd *cobra.Command, args []string) error {
5050
p.Warn("Cannot find repository. The update command requires installation from source.")
5151
p.Info("To update:")
5252
p.Info("1. Clone/pull the repository: https://github.com/pushchain/push-chain-node")
53-
p.Info("2. Run: bash push-validator-manager/install.sh --use-local")
53+
p.Info("2. Run: bash push-validator/install.sh --use-local")
5454
return exitcodes.PreconditionError("not installed from repository")
5555
}
5656

@@ -114,7 +114,7 @@ func runUpdate(cmd *cobra.Command, args []string) error {
114114
// Rebuild binaries
115115
p.Info("Rebuilding binaries...")
116116

117-
installScript := filepath.Join(repoDir, "push-validator-manager", "install.sh")
117+
installScript := filepath.Join(repoDir, "push-validator", "install.sh")
118118
if _, err := os.Stat(installScript); os.IsNotExist(err) {
119119
return exitcodes.PreconditionErrorf("install script not found at %s", installScript)
120120
}
@@ -131,7 +131,7 @@ func runUpdate(cmd *cobra.Command, args []string) error {
131131

132132
fmt.Println()
133133
p.Success("Update completed successfully!")
134-
p.Info("Restart the node with: push-validator-manager restart")
134+
p.Info("Restart the node with: push-validator restart")
135135

136136
return nil
137137
}
@@ -144,8 +144,8 @@ func findRepoRoot(startDir string) string {
144144
return dir
145145
}
146146

147-
// Also check for push-validator-manager directory
148-
pvmDir := filepath.Join(dir, "push-validator-manager")
147+
// Also check for push-validator directory
148+
pvmDir := filepath.Join(dir, "push-validator")
149149
if stat, err := os.Stat(pvmDir); err == nil && stat.IsDir() {
150150
return dir
151151
}

push-validator-manager/cmd/push-validator/cmd_withdraw_rewards.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func handleWithdrawRewards(cfg config.Config) {
6767
fmt.Println(p.Colors.Warning("⚠️ Node is still syncing to latest block"))
6868
fmt.Println()
6969
fmt.Println(p.Colors.Info("Please wait for sync to complete before withdrawing rewards."))
70-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager sync"))
70+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator sync"))
7171
fmt.Println()
7272
}
7373
return
@@ -105,7 +105,7 @@ func handleWithdrawRewards(cfg config.Config) {
105105
fmt.Println(p.Colors.Warning("⚠️ This node is not registered as a validator"))
106106
fmt.Println()
107107
fmt.Println(p.Colors.Info("Register first using:"))
108-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager register-validator"))
108+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator register-validator"))
109109
fmt.Println()
110110
}
111111
return
@@ -358,13 +358,13 @@ func handleWithdrawRewards(cfg config.Config) {
358358
fmt.Println(p.Colors.Separator(40))
359359
fmt.Println()
360360
fmt.Println(p.Colors.Info(" 1. Check validator status:"))
361-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager validators"))
361+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator validators"))
362362
fmt.Println()
363363
fmt.Println(p.Colors.Info(" 2. View account balance:"))
364-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager balance"))
364+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator balance"))
365365
fmt.Println()
366366
fmt.Println(p.Colors.Info(" 3. Live dashboard:"))
367-
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator-manager dashboard"))
367+
fmt.Println(p.Colors.Apply(p.Colors.Theme.Command, " push-validator dashboard"))
368368
fmt.Println()
369369
fmt.Println(p.Colors.Apply(p.Colors.Theme.Description, " Your rewards have been transferred to your account."))
370370
fmt.Println()

0 commit comments

Comments
 (0)