Skip to content

Commit 9ed761a

Browse files
committed
fix: Update validator profile details and update read me
1 parent 1d7e4a8 commit 9ed761a

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ push-validator logs # View logs
6868

6969
### Validator Operations
7070
```bash
71+
push-validator update-details # Update validator profile (moniker, website, identity, etc.)
7172
push-validator increase-stake # Increase validator stake and voting power
7273
push-validator unjail # Restore jailed validator to active status
7374
push-validator withdraw-rewards # Withdraw validator rewards and commission
@@ -105,6 +106,10 @@ push-validator update # Update CLI to latest version
105106
- **Smart Detection**: Monitors for sync stalls and network issues
106107
- **Reliable Snapshots**: Uses trusted RPC nodes for recovery
107108
- **Multiple Outputs**: JSON, YAML, or text format support
109+
- **Automatic Peer Refresh**: Background cron job discovers and updates peers every minute
110+
- **Resumable Downloads**: Snapshot downloads resume from where they left off on interruption
111+
- **Streaming Checksum Verification**: SHA-256 computed during download — no re-read needed
112+
- **Disk Space Pre-checks**: Validates free space before snapshot download and extraction
108113

109114
## 🔄 Automatic Upgrades (Cosmovisor)
110115

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"github.com/pushchain/push-validator-cli/internal/validator"
1010
)
1111

12-
// handleEditValidator orchestrates editing a validator's profile fields:
12+
// handleEditValidator orchestrates updating a validator's profile details:
1313
// - verify node is running and validator is registered
1414
// - auto-derive key name
1515
// - prompt for fields to update
16-
// - submit edit-validator transaction
16+
// - submit update-details transaction
1717
func handleEditValidator(d *Deps) error {
1818
if err := checkNodeRunning(d.Sup); err != nil {
1919
return err
@@ -85,7 +85,7 @@ func handleEditValidator(d *Deps) error {
8585
// Step 3: Prompt for fields
8686
if flagOutput != "json" {
8787
fmt.Println()
88-
p.Section("Edit Validator Profile")
88+
p.Section("Update Validator Details")
8989
fmt.Println()
9090
if myVal.Moniker != "" {
9191
fmt.Printf(" Current moniker: %s\n", p.Colors.Apply(p.Colors.Theme.Value, myVal.Moniker))
@@ -172,7 +172,7 @@ func handleEditValidator(d *Deps) error {
172172
// Step 4: Submit transaction
173173
if flagOutput != "json" {
174174
fmt.Println()
175-
fmt.Print(p.Colors.Apply(p.Colors.Theme.Prompt, p.Colors.Emoji("📤")+" Submitting edit-validator transaction..."))
175+
fmt.Print(p.Colors.Apply(p.Colors.Theme.Prompt, p.Colors.Emoji("📤")+" Submitting update-details transaction..."))
176176
}
177177

178178
txCtx, txCancel := context.WithTimeout(context.Background(), 90*time.Second)
@@ -184,12 +184,12 @@ func handleEditValidator(d *Deps) error {
184184
getPrinter().JSON(map[string]any{"ok": false, "error": err.Error()})
185185
} else {
186186
fmt.Println()
187-
fmt.Println(p.Colors.Error(p.Colors.Emoji("❌") + " Edit validator failed"))
187+
fmt.Println(p.Colors.Error(p.Colors.Emoji("❌") + " Update details failed"))
188188
fmt.Println()
189189
fmt.Printf("Error: %v\n", err)
190190
fmt.Println()
191191
}
192-
return fmt.Errorf("edit validator failed: %w", err)
192+
return fmt.Errorf("update details failed: %w", err)
193193
}
194194

195195
if flagOutput != "json" {

cmd/push-validator/cmd_edit_validator_test.go renamed to cmd/push-validator/cmd_update_details_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestHandleEditValidator_EditValidatorFails(t *testing.T) {
168168
if err == nil {
169169
t.Fatal("expected error")
170170
}
171-
if !containsSubstr(err.Error(), "edit validator failed") {
171+
if !containsSubstr(err.Error(), "update details failed") {
172172
t.Errorf("unexpected error: %v", err)
173173
}
174174
}
@@ -188,7 +188,7 @@ func TestHandleEditValidator_EditValidatorFails_JSON(t *testing.T) {
188188
if err == nil {
189189
t.Fatal("expected error")
190190
}
191-
if !containsSubstr(err.Error(), "edit validator failed") {
191+
if !containsSubstr(err.Error(), "update details failed") {
192192
t.Errorf("unexpected error: %v", err)
193193
}
194194
}
@@ -218,7 +218,7 @@ func TestHandleEditValidator_EditValidatorFails_Text(t *testing.T) {
218218
if err == nil {
219219
t.Fatal("expected error")
220220
}
221-
if !containsSubstr(err.Error(), "edit validator failed") {
221+
if !containsSubstr(err.Error(), "update details failed") {
222222
t.Errorf("unexpected error: %v", err)
223223
}
224224
}

cmd/push-validator/root_cobra.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func init() {
156156
fmt.Fprintln(w, c.FormatCommandAligned("validators", "List validators", cmdWidth))
157157
fmt.Fprintln(w, c.FormatCommandAligned("balance [address]", "Check account balance", cmdWidth))
158158
fmt.Fprintln(w, c.FormatCommandAligned("register-validator", "Register this node as a validator", cmdWidth))
159-
fmt.Fprintln(w, c.FormatCommandAligned("edit-validator", "Edit validator profile", cmdWidth))
159+
fmt.Fprintln(w, c.FormatCommandAligned("update-details", "Update validator profile details", cmdWidth))
160160
fmt.Fprintln(w, c.FormatCommandAligned("increase-stake", "Increase validator stake", cmdWidth))
161161
fmt.Fprintln(w, c.FormatCommandAligned("unjail", "Restore jailed validator to active status", cmdWidth))
162162
fmt.Fprintln(w, c.FormatCommandAligned("withdraw-rewards", "Withdraw rewards and commission", cmdWidth))
@@ -285,16 +285,16 @@ func init() {
285285
regCmd.Flags().BoolVar(&flagRegisterCheckOnly, "check-only", false, "Exit after reporting validator registration status")
286286
rootCmd.AddCommand(regCmd)
287287

288-
// edit-validator command
289-
editValCmd := &cobra.Command{
290-
Use: "edit-validator",
291-
Aliases: []string{"edit"},
292-
Short: "Edit validator profile (moniker, website, identity, etc.)",
288+
// update-details command
289+
updateDetailsCmd := &cobra.Command{
290+
Use: "update-details",
291+
Aliases: []string{"edit-validator", "edit"},
292+
Short: "Update validator profile details (moniker, website, identity, etc.)",
293293
RunE: func(cmd *cobra.Command, args []string) error {
294294
return handleEditValidator(newDeps())
295295
},
296296
}
297-
rootCmd.AddCommand(editValCmd)
297+
rootCmd.AddCommand(updateDetailsCmd)
298298

299299
// unjail command
300300
unjailCmd := &cobra.Command{

0 commit comments

Comments
 (0)