config

package
v0.5.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContractQueryGasLimit   = uint64(3000000)
	DefaultContractDebugMode       = false
	DefaultContractMemoryCacheSize = uint32(100)
)

config default values

View Source
const DefaultConfigTemplate = `` /* 493-byte string literal not displayed */

DefaultConfigTemplate default config template for wasm module

Variables

View Source
var DBDir = "data/wasm"

DBDir used to store wasm data to

Functions

This section is empty.

Types

type Config

type Config struct {
	// The maximum gas amount can be spent for contract query
	// The external query will invoke contract vm on wasm module,
	// so we need to restrict the max usage to prevent DoS attack
	ContractQueryGasLimit uint64 `mapstructure:"contract-query-gas-limit"`

	// The flag to specify whether print contract logs or not
	ContractDebugMode bool `mapstructure:"contract-debug-mode"`

	// The WASM VM memory cache size in MiB not bytes
	ContractMemoryCacheSize uint32 `mapstructure:"contract-memory-cache-size"`
}

Config is the extra config required for wasm

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default settings for WasmConfig

func GetConfig

func GetConfig(appOpts servertypes.AppOptions) *Config

GetConfig load config values from the app options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL