Skip to content

Commit c37a488

Browse files
update: opt-out state-pruning. (#8)
1 parent 3d7ad46 commit c37a488

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

cmd/supervysor/commands/prune.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func init() {
2020
panic(fmt.Errorf("flag 'until-height' should be required: %w", err))
2121
}
2222

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

2525
pruneCmd.Flags().BoolVar(&optOut, "opt-out", false, "disable the collection of anonymous usage data")
2626
}

cmd/supervysor/commands/start.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
func init() {
2121
startCmd.Flags().StringVar(&cfgFlag, "config", "", "path to config directory (e.g. ~/.supervysor/)")
2222

23+
startCmd.Flags().BoolVar(&statePruning, "state-pruning", true, "enable state pruning")
24+
2325
startCmd.Flags().StringVar(&binaryFlags, "flags", "", "flags for the underlying binary (e.g. '--address, ')")
2426

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

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

142-
err = e.PruneBlocks(supervysorConfig.HomePath, nodeHeight-1, supervysorConfig.StatePruning, binaryFlags)
144+
err = e.PruneData(supervysorConfig.HomePath, nodeHeight-1, supervysorConfig.StatePruning, binaryFlags)
143145
if err != nil {
144146
logger.Error("could not prune blocks", "err", err)
145147
return err

executor/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (e *Executor) EnableNormalMode(flags string) error {
9494
return nil
9595
}
9696

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

0 commit comments

Comments
 (0)