config

package
v0.5.0-beta3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

config default values

View Source
const (
	FlagContractQueryGasLimit   = "contract-query-gas-limit"
	FlagContractDebugMode       = "contract-debug-mode"
	FlagContractMemoryCacheSize = "contract-memory-cache-size"
)

config flags for wasm module

Variables

View Source
var DBDir = "data/wasm"

DBDir used to store wasm data to

Functions

func AddModuleInitFlags

func AddModuleInitFlags(startCmd *cobra.Command)

AddModuleInitFlags implements servertypes.ModuleInitFlags interface.

func WriteConfigFile

func WriteConfigFile(configFilePath string, config *Config)

WriteConfigFile renders config using the template and writes it to configFilePath.

Types

type BaseConfig

type BaseConfig 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"`

	// Only The logs from the contracts, which are listed in
	// this array or instantiated from the address in this array,
	// are stored in the local storage. To keep all logs,
	// a node operator can set "*" (not recommended).
	ContractLoggingWhitelist string `mapstructure:"contract-logging-whitelist"`

	// 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"`
}

BaseConfig is the extra config required for wasm

type Config

type Config struct {
	BaseConfig `mapstructure:",squash"`
}

Config defines the server's top level configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default settings for WasmConfig

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

ParseConfig retrieves the default environment configuration for the application.

Jump to

Keyboard shortcuts

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