config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonFileName   = "config.json"
	ConfigGuideUrl = "Please visit https://github.com/LemoFoundationLtd/lemochain-core#configuration-file for detail"
)

Variables

View Source
var (
	ErrConfigFormat      = fmt.Errorf(`file "%s" format error. %s`, JsonFileName, ConfigGuideUrl)
	ErrSleepTimeInConfig = fmt.Errorf(`file "%s" error: sleepTime can't be larger than timeout`, JsonFileName)
	ErrTimeoutInConfig   = fmt.Errorf(`file "%s" error: timeout must be larger than 3000ms`, JsonFileName)
	ErrChainIDInConfig   = fmt.Errorf(`file "%s" error: chainID must be in [1, 65535]`, JsonFileName)
)

Functions

func WriteConfigFile added in v1.2.0

func WriteConfigFile(dir string, cfg *ConfigFromFile) error

Types

type ConfigFromFile

type ConfigFromFile struct {
	ChainID         uint64 `json:"chainID"        gencodec:"required"`
	DeputyCount     uint64 `json:"deputyCount"    gencodec:"required"`
	SleepTime       uint64 `json:"sleepTime"`
	Timeout         uint64 `json:"timeout"`
	TermDuration    uint64 `json:"termDuration"`
	InterimDuration uint64 `json:"interimDuration"`
	ConnectionLimit uint64 `json:"connectionLimit"`
}

func ReadConfigFile

func ReadConfigFile(dir string) (*ConfigFromFile, error)

func (*ConfigFromFile) Check

func (c *ConfigFromFile) Check()

func (ConfigFromFile) MarshalJSON

func (c ConfigFromFile) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*ConfigFromFile) UnmarshalJSON

func (c *ConfigFromFile) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type ConfigFromFileMarshaling

type ConfigFromFileMarshaling struct {
	ChainID         hexutil.Uint64
	DeputyCount     hexutil.Uint64
	SleepTime       hexutil.Uint64
	Timeout         hexutil.Uint64
	TermDuration    hexutil.Uint64
	InterimDuration hexutil.Uint64
	ConnectionLimit hexutil.Uint64
}

Jump to

Keyboard shortcuts

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