Skip to content

Commit

Permalink
Merge branch 'fix-statesync' of https://github.com/faddat/gaia into f…
Browse files Browse the repository at this point in the history
…ix-statesync
  • Loading branch information
faddat committed Jan 25, 2023
2 parents e656c6f + 2612dcc commit c3ea326
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions app/params/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package params

import (
"strings"

serverconfig "github.com/cosmos/cosmos-sdk/server/config"
)

Expand All @@ -10,9 +12,8 @@ var (
//nolint: gosec
BypassMinFeeMsgTypesKey = "bypass-min-fee-msg-types"

// CustomConfigTemplate defines Gaia's custom application configuration TOML
// template. It extends the core SDK template.
CustomConfigTemplate = serverconfig.DefaultConfigTemplate + `
// customGaiaConfigTemplate defines Gaia's custom application configuration TOML template.
customGaiaConfigTemplate = `
###############################################################################
### Custom Gaia Configuration ###
###############################################################################
Expand All @@ -25,6 +26,16 @@ bypass-min-fee-msg-types = [{{ range .BypassMinFeeMsgTypes }}{{ printf "%q, " .
`
)

// CustomConfigTemplate defines Gaia's custom application configuration TOML
// template. It extends the core SDK template.
func CustomConfigTemplate() string {
config := serverconfig.DefaultConfigTemplate
lines := strings.Split(config, "\n")
// add the Gaia config at the second line of the file
lines[2] += customGaiaConfigTemplate
return strings.Join(lines, "\n")
}

// CustomAppConfig defines Gaia's custom application configuration.
type CustomAppConfig struct {
serverconfig.Config
Expand Down
2 changes: 1 addition & 1 deletion cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func initAppConfig() (string, interface{}) {
srvCfg.StateSync.SnapshotInterval = 1000
srvCfg.StateSync.SnapshotKeepRecent = 10

return params.CustomConfigTemplate, params.CustomAppConfig{
return params.CustomConfigTemplate(), params.CustomAppConfig{
Config: *srvCfg,
BypassMinFeeMsgTypes: []string{
sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}),
Expand Down

0 comments on commit c3ea326

Please sign in to comment.