Add pruning option to application (#113)

This commit is contained in:
Austin Abell 2019-09-26 11:50:55 -04:00 committed by GitHub
parent 7f1eb4b0cf
commit 46e5278355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,22 +4,25 @@ import (
"encoding/json"
"io"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/genaccounts"
genaccscli "github.com/cosmos/cosmos-sdk/x/genaccounts/client/cli"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"
"github.com/spf13/viper"
sdk "github.com/cosmos/cosmos-sdk/types"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
emintapp "github.com/cosmos/ethermint/app"
abci "github.com/tendermint/tendermint/abci/types"
dbm "github.com/tendermint/tm-db"
"github.com/tendermint/tendermint/libs/cli"
tmlog "github.com/tendermint/tendermint/libs/log"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
)
func main() {
@ -64,7 +67,8 @@ func main() {
}
func newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer) abci.Application {
return emintapp.NewEthermintApp(logger, db, true, 0)
return emintapp.NewEthermintApp(logger, db, true, 0,
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))))
}
func exportAppStateAndTMValidators(