-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See PR #529
- Loading branch information
Showing
5 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package cmd | ||
|
||
// DONTCOVER | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
srvconfig "github.com/cosmos/cosmos-sdk/server/config" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
cosmosgenutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" | ||
) | ||
|
||
// initCmd returns a command that initializes all files needed for Tendermint | ||
// and the respective application. | ||
func initCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { | ||
cmd := cosmosgenutilcli.InitCmd(mbm, defaultNodeHome) | ||
defaultRun := cmd.RunE | ||
cmd.RunE = func(cmd *cobra.Command, args []string) error { | ||
clientCtx := client.GetClientContextFromCmd(cmd) | ||
err := defaultRun(cmd, args) | ||
if err != nil { | ||
return err | ||
} | ||
// Set app.toml file | ||
appConfig := srvconfig.DefaultConfig() | ||
appConfig.Pruning = "custom" | ||
appConfig.PruningKeepRecent = "100" | ||
appConfig.PruningKeepEvery = "500" | ||
appConfig.PruningInterval = "10" | ||
|
||
appConfig.StateSync.SnapshotInterval = 500 | ||
srvconfig.WriteConfigFile(filepath.Join(clientCtx.HomeDir, "config", "app.toml"), appConfig) | ||
return nil | ||
} | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters