diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e3707620e..cf47fd4237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,8 @@ to the new keyring. ### Improvements +* (server) [\#4215](https://github.com/cosmos/cosmos-sdk/issues/4215) The `--pruning` flag +has been moved to the configuration file, to allow easier node configuration. * (cli) [\#5116](https://github.com/cosmos/cosmos-sdk/issues/5116) The `CLIContext` now supports multiple verifiers when connecting to multiple chains. The connecting chain's `CLIContext` will have to have the correct chain ID and node URI or client set. To use a `CLIContext` with a verifier for another chain: diff --git a/server/config/config.go b/server/config/config.go index a368df17bb..abb43a9b11 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -35,6 +35,8 @@ type BaseConfig struct { // InterBlockCache enables inter-block caching. InterBlockCache bool `mapstructure:"inter-block-cache"` + + Pruning string `mapstructure:"pruning"` } // Config defines the server's top level configuration @@ -75,6 +77,7 @@ func DefaultConfig() *Config { BaseConfig{ MinGasPrices: defaultMinGasPrices, InterBlockCache: true, + Pruning: "syncable", }, } } diff --git a/server/config/toml.go b/server/config/toml.go index 4034201831..45f76ee13a 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -35,6 +35,12 @@ halt-time = {{ .BaseConfig.HaltTime }} # InterBlockCache enables inter-block caching. inter-block-cache = {{ .BaseConfig.InterBlockCache }} + +# Pruning sets the pruning strategy: syncable, nothing, everything +# syncable: only those states not needed for state syncing will be deleted (keeps last 100 + every 10000th) +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: all saved states will be deleted, storing only the current state +pruning = {{ .BaseConfig.Pruning }} ` var configTemplate *template.Template