diff --git a/Makefile b/Makefile index 30ca352..5dff6d3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := v0.3.3 +VERSION := v0.3.5 ldflags := $(LDFLAGS) ldflags += -X main.version=$(VERSION) diff --git a/cmd/supervysor/commands/prune.go b/cmd/supervysor/commands/prune.go index 756c04b..37236f6 100644 --- a/cmd/supervysor/commands/prune.go +++ b/cmd/supervysor/commands/prune.go @@ -15,7 +15,7 @@ func init() { panic(fmt.Errorf("flag 'home' should be required: %w", err)) } - pruneCmd.Flags().Int64Var(&untilHeight, "until-height", 0, "prune blocks until specified height (excluding)") + pruneCmd.Flags().Int64Var(&untilHeight, "until-height", 0, "prune until specified height (excluding)") if err := pruneCmd.MarkFlagRequired("until-height"); err != nil { panic(fmt.Errorf("flag 'until-height' should be required: %w", err)) } diff --git a/cmd/supervysor/commands/start.go b/cmd/supervysor/commands/start.go index 809c380..89d38a3 100644 --- a/cmd/supervysor/commands/start.go +++ b/cmd/supervysor/commands/start.go @@ -130,20 +130,20 @@ var startCmd = &cobra.Command{ if nodeHeight < poolHeight { pruneHeight = nodeHeight } - logger.Info("pruning blocks after node shutdown", "until-height", pruneHeight) + logger.Info("pruning after node shutdown", "until-height", pruneHeight) err = e.PruneData(supervysorConfig.HomePath, pruneHeight-1, supervysorConfig.StatePruning, binaryFlags) if err != nil { - logger.Error("could not prune blocks", "err", err) + logger.Error("could not prune", "err", err) return err } } else { if nodeHeight < poolHeight { - logger.Info("pruning blocks after node shutdown", "until-height", nodeHeight) + logger.Info("pruning after node shutdown", "until-height", nodeHeight) err = e.PruneData(supervysorConfig.HomePath, nodeHeight-1, supervysorConfig.StatePruning, binaryFlags) if err != nil { - logger.Error("could not prune blocks", "err", err) + logger.Error("could not prune", "err", err) return err } } diff --git a/executor/executor.go b/executor/executor.go index fa7ec8d..baa60b0 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -101,10 +101,12 @@ func (e *Executor) PruneData(homePath string, pruneHeight int, statePruning bool } err := store.Prune(homePath, int64(pruneHeight)-1, statePruning, e.Logger) if err != nil { - e.Logger.Error("could not prune blocks, exiting") + e.Logger.Error("could not prune, exiting") return err } + time.Sleep(time.Second * time.Duration(10)) + if e.Process.GhostMode { process, err := node.StartGhostNode(e.Cfg, e.Logger, &e.Process, true, flags) if err != nil { @@ -113,7 +115,7 @@ func (e *Executor) PruneData(homePath string, pruneHeight int, statePruning bool if process != nil && process.Pid > 0 { e.Process.Id = process.Pid e.Process.GhostMode = true - e.Logger.Info("node started in GhostMode after pruning blocks") + e.Logger.Info("node started in GhostMode after pruning") } else { return fmt.Errorf("enabling Ghost Mode failed: process is not defined") } @@ -126,7 +128,7 @@ func (e *Executor) PruneData(homePath string, pruneHeight int, statePruning bool if process != nil && process.Pid > 0 { e.Process.Id = process.Pid e.Process.GhostMode = false - e.Logger.Info("Node started in Normal Mode after pruning blocks", "pId", process.Pid) + e.Logger.Info("Node started in Normal Mode after pruning", "pId", process.Pid) } else { return fmt.Errorf("GhostMode disabling failed: process is not defined") }