-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
48 lines (40 loc) · 1.55 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"github.com/HermitMatrixNetwork/HermitMatrixNetwork/x/compute"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
)
// SecretAppConfig terra specify app config
type SecretAppConfig struct {
serverconfig.Config
WASMConfig compute.WasmConfig `mapstructure:"wasm"`
}
// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
func initAppConfig() (string, interface{}) {
// Optionally allow the chain developer to overwrite the SDK's default
// server config.
srvCfg := serverconfig.DefaultConfig()
// The SDK's default minimum gas price is set to "" (empty value) inside
// app.toml. If left empty by validators, the node will halt on startup.
// However, the chain developer can set a default app.toml value for their
// validators here.
//
// In summary:
// - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their
// own app.toml config,
// - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their
// own app.toml to override, or use this default value.
//
// In simapp, we set the min gas prices to 0.
srvCfg.MinGasPrices = "0.0125uGHM"
srvCfg.API.Enable = true
srvCfg.API.Swagger = true
srvCfg.API.EnableUnsafeCORS = true
srvCfg.IAVLCacheSize = 781_250
secretAppConfig := SecretAppConfig{
Config: *srvCfg,
WASMConfig: *compute.DefaultWasmConfig(),
}
secretAppTemplate := serverconfig.DefaultConfigTemplate + compute.DefaultConfigTemplate
return secretAppTemplate, secretAppConfig
}