@@ -96,8 +96,19 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
96
96
func initAppConfig () (string , interface {}) {
97
97
// The following code snippet is just for reference.
98
98
99
+ // WASMConfig defines configuration for the wasm module.
100
+ type WASMConfig struct {
101
+ // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
102
+ QueryGasLimit uint64 `mapstructure:"query_gas_limit"`
103
+
104
+ // Address defines the gRPC-web server to listen on
105
+ LruSize uint64 `mapstructure:"lru_size"`
106
+ }
107
+
99
108
type CustomAppConfig struct {
100
109
serverconfig.Config
110
+
111
+ WASM WASMConfig `mapstructure:"wasm"`
101
112
}
102
113
103
114
// Optionally allow the chain developer to overwrite the SDK's default
@@ -120,9 +131,19 @@ func initAppConfig() (string, interface{}) {
120
131
121
132
customAppConfig := CustomAppConfig {
122
133
Config : * srvCfg ,
134
+ WASM : WASMConfig {
135
+ LruSize : 1 ,
136
+ QueryGasLimit : 300000 ,
137
+ },
123
138
}
124
139
125
- customAppTemplate := serverconfig .DefaultConfigTemplate
140
+ customAppTemplate := serverconfig .DefaultConfigTemplate + `
141
+ [wasm]
142
+ # This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
143
+ query_gas_limit = 300000
144
+ # This is the number of wasm vm instances we keep cached in memory for speed-up
145
+ # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
146
+ lru_size = 0`
126
147
127
148
return customAppTemplate , customAppConfig
128
149
}
0 commit comments