Skip to content

Commit

Permalink
update: opt-out state-pruning. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbrumm authored Jan 24, 2024
1 parent 3d7ad46 commit c37a488
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/supervysor/commands/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func init() {
panic(fmt.Errorf("flag 'until-height' should be required: %w", err))
}

pruneCmd.Flags().BoolVar(&statePruning, "state-pruning", true, "state pruning enabled")
pruneCmd.Flags().BoolVar(&statePruning, "state-pruning", true, "enable state pruning")

pruneCmd.Flags().BoolVar(&optOut, "opt-out", false, "disable the collection of anonymous usage data")
}
Expand Down
6 changes: 4 additions & 2 deletions cmd/supervysor/commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
func init() {
startCmd.Flags().StringVar(&cfgFlag, "config", "", "path to config directory (e.g. ~/.supervysor/)")

startCmd.Flags().BoolVar(&statePruning, "state-pruning", true, "enable state pruning")

startCmd.Flags().StringVar(&binaryFlags, "flags", "", "flags for the underlying binary (e.g. '--address, ')")

startCmd.Flags().BoolVar(&optOut, "opt-out", false, "disable the collection of anonymous usage data")
Expand Down Expand Up @@ -130,7 +132,7 @@ var startCmd = &cobra.Command{
}
logger.Info("pruning blocks after node shutdown", "until-height", pruneHeight)

err = e.PruneBlocks(supervysorConfig.HomePath, pruneHeight-1, supervysorConfig.StatePruning, binaryFlags)
err = e.PruneData(supervysorConfig.HomePath, pruneHeight-1, supervysorConfig.StatePruning, binaryFlags)
if err != nil {
logger.Error("could not prune blocks", "err", err)
return err
Expand All @@ -139,7 +141,7 @@ var startCmd = &cobra.Command{
if nodeHeight < poolHeight {
logger.Info("pruning blocks after node shutdown", "until-height", nodeHeight)

err = e.PruneBlocks(supervysorConfig.HomePath, nodeHeight-1, supervysorConfig.StatePruning, binaryFlags)
err = e.PruneData(supervysorConfig.HomePath, nodeHeight-1, supervysorConfig.StatePruning, binaryFlags)
if err != nil {
logger.Error("could not prune blocks", "err", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (e *Executor) EnableNormalMode(flags string) error {
return nil
}

func (e *Executor) PruneBlocks(homePath string, pruneHeight int, statePruning bool, flags string) error {
func (e *Executor) PruneData(homePath string, pruneHeight int, statePruning bool, flags string) error {
if err := e.Shutdown(); err != nil {
e.Logger.Error("could not shutdown node process", "err", err)
return err
Expand Down

0 comments on commit c37a488

Please sign in to comment.