Merge PR #5090: feat: add pruning config to toml

This commit is contained in:
Maciej Krüger 2019-10-03 20:15:38 +02:00 committed by Alexander Bezobchuk
parent f84d9fa078
commit 639dad2e15
3 changed files with 11 additions and 0 deletions

View File

@ -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:

View File

@ -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",
},
}
}

View File

@ -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