Documentation ¶
Index ¶
Constants ¶
View Source
const ( JsonFileName = "config.json" ConfigGuideUrl = "Please visit https://github.com/LemoFoundationLtd/lemochain-core#configuration-file for more 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"` SleepTime uint64 `json:"sleepTime"` Timeout uint64 `json:"timeout"` TermDuration uint64 `json:"termDuration"` InterimDuration uint64 `json:"interimDuration"` ConnectionLimit uint64 `json:"connectionLimit"` AlarmUrl string `json:"alarmUrl"` }
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.
Click to show internal directories.
Click to hide internal directories.