diff --git a/CHANGELOG.md b/CHANGELOG.md index 0604271e67..1099afaddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Updated Cosmos-SDK to v0.46.3-pio-4 (from v0.46.3-pio-1) [PR 1211](https://github.com/provenance-io/provenance/pull/1211). * Improve CodeQL workflow to run on Go file changes only [#1225](https://github.com/provenance-io/provenance/issues/1225) +* Add prune command available though cosmos sdk to provenanced.[#1208](https://github.com/provenance-io/provenance/issues/1208). ### Bug Fixes diff --git a/cmd/provenanced/cmd/root.go b/cmd/provenanced/cmd/root.go index e693730ca6..e546ccdd0f 100644 --- a/cmd/provenanced/cmd/root.go +++ b/cmd/provenanced/cmd/root.go @@ -15,11 +15,11 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/provenance-io/provenance/app" "github.com/provenance-io/provenance/app/params" "github.com/provenance-io/provenance/cmd/provenanced/config" "github.com/provenance-io/provenance/internal/pioconfig" - "github.com/rs/zerolog" "github.com/spf13/cast" "github.com/spf13/cobra" @@ -172,7 +172,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { // Add Rosetta command rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler)) - + rootCmd.AddCommand(pruning.PruningCmd(newApp)) // Disable usage when the start command returns an error. startCmd, _, err := rootCmd.Find([]string{"start"}) if err != nil { @@ -271,24 +271,6 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty panic(err) } - // Validate min-gas-price is a single coin. - if fee, err := sdk.ParseCoinNormalized(cast.ToString(appOpts.Get(server.FlagMinGasPrices))); err == nil { - if int(sdk.GetConfig().GetCoinType()) == app.CoinTypeMainNet { - // require the fee denom to match the bond denom on mainnet(still applies) - if fee.Denom != pioconfig.GetProvenanceConfig().FeeDenom { - panic(fmt.Errorf("invalid min-gas-price fee denom, must be: %s", pioconfig.GetProvenanceConfig().FeeDenom)) - } - } - } else { - // panic if there was a parse error (for example more than one coin was passed in for required fee). - if err != nil { - panic(fmt.Errorf("invalid min-gas-price value, expected single decimal coin value such as '%s', got '%s';\n\n %w", - pioconfig.GetProvenanceConfig().ProvenanceMinGasPrices, - appOpts.Get(server.FlagMinGasPrices), - err)) - } - } - snapshotOptions := snapshottypes.NewSnapshotOptions( cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)),