diff --git a/tests/e2e/chain/config.go b/tests/e2e/chain/config.go index a834f981a23..945090b0162 100644 --- a/tests/e2e/chain/config.go +++ b/tests/e2e/chain/config.go @@ -266,7 +266,7 @@ func initNodes(c *internalChain, numVal int) error { return nil } -func initValidatorConfigs(c *internalChain) error { +func initValidatorConfigs(c *internalChain, pruning string, pruningKeepRecent string, pruningInterval string, snapshotInterval uint64, snapshotKeepRecent uint32, telemetryEnabled bool, telemetryRetentionTime int64, prometheusEnabled bool) error { for i, val := range c.validators { tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") @@ -287,6 +287,7 @@ func initValidatorConfigs(c *internalChain) error { valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" valConfig.StateSync.Enable = false valConfig.LogLevel = "info" + valConfig.Instrumentation.Prometheus = prometheusEnabled var peers []string @@ -308,8 +309,15 @@ func initValidatorConfigs(c *internalChain) error { appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") appConfig := srvconfig.DefaultConfig() + appConfig.BaseConfig.Pruning = pruning + appConfig.BaseConfig.PruningKeepRecent = pruningKeepRecent + appConfig.BaseConfig.PruningInterval = pruningInterval appConfig.API.Enable = true appConfig.MinGasPrices = fmt.Sprintf("%s%s", MinGasPrice, OsmoDenom) + appConfig.StateSync.SnapshotInterval = snapshotInterval + appConfig.StateSync.SnapshotKeepRecent = snapshotKeepRecent + appConfig.Telemetry.Enabled = telemetryEnabled + appConfig.Telemetry.PrometheusRetentionTime = telemetryRetentionTime srvconfig.WriteConfigFile(appCfgPath, appConfig) } diff --git a/tests/e2e/chain/main.go b/tests/e2e/chain/main.go index d90186aa4d7..02976b60316 100644 --- a/tests/e2e/chain/main.go +++ b/tests/e2e/chain/main.go @@ -1,6 +1,6 @@ package chain -func Init(id, dataDir string, numVal int) (*Chain, error) { +func Init(id, dataDir string, numVal int, pruning string, pruningKeepRecent string, pruningInterval string, snapshotInterval uint64, snapshotKeepRecent uint32, telemetryEnabled bool, telemetryRetentionTime int64, prometheusEnabled bool) (*Chain, error) { chain, err := new(id, dataDir) if err != nil { return nil, err @@ -11,7 +11,7 @@ func Init(id, dataDir string, numVal int) (*Chain, error) { if err := initGenesis(chain); err != nil { return nil, err } - if err := initValidatorConfigs(chain); err != nil { + if err := initValidatorConfigs(chain, pruning, pruningKeepRecent, pruningInterval, snapshotInterval, snapshotKeepRecent, telemetryEnabled, telemetryRetentionTime, prometheusEnabled); err != nil { return nil, err } return chain.export(), nil diff --git a/tests/e2e/chain_init/main.go b/tests/e2e/chain_init/main.go index af93e7715c9..aa71269f243 100644 --- a/tests/e2e/chain_init/main.go +++ b/tests/e2e/chain_init/main.go @@ -11,14 +11,30 @@ import ( func main() { var ( - dataDir string - chainId string - numVal int + dataDir string + chainId string + numVal int + pruning string + pruningKeepRecent string + pruningInterval string + snapshotInterval uint64 + snapshotKeepRecent uint + telemetryEnabled bool + telemetryRetentionTime int64 + prometheusEnabled bool ) flag.StringVar(&dataDir, "data-dir", "", "chain data directory") flag.StringVar(&chainId, "chain-id", "", "chain ID") flag.IntVar(&numVal, "num-val", 2, "number of validators for each chain") + flag.StringVar(&pruning, "pruning", "default", "pruning config") + flag.StringVar(&pruningKeepRecent, "pruning-keep-recent", "0", "pruning keep recent config") + flag.StringVar(&pruningInterval, "pruning-interval", "0", "pruning interval config") + flag.Uint64Var(&snapshotInterval, "snapshot-interval", 1500, "state sync snapshot interval") + flag.UintVar(&snapshotKeepRecent, "snapshot-keep-recent", 2, "number of state sync snapshots to keep and serve") + flag.BoolVar(&telemetryEnabled, "telemetry-enabled", false, "enable telemetry in app.toml") + flag.Int64Var(&telemetryRetentionTime, "telemetry-retention-time", 0, "retention time for telemetry in app.toml") + flag.BoolVar(&prometheusEnabled, "prometheus-enabled", false, "enable prometheus in config.toml") flag.Parse() if len(dataDir) == 0 { @@ -29,7 +45,7 @@ func main() { panic(err) } - createdChain, err := chain.Init(chainId, dataDir, numVal) + createdChain, err := chain.Init(chainId, dataDir, numVal, pruning, pruningKeepRecent, pruningInterval, snapshotInterval, uint32(snapshotKeepRecent), telemetryEnabled, telemetryRetentionTime, prometheusEnabled) if err != nil { panic(err) }