Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigGuideUrl = "" NodeKeyFileName = "nodekey" JsonFileName = "distribution-config.json" DefaultHttpPort = 8001 DefaultHttpVirtualHosts = "localhost" DefaultWSPort = 8002 )
Variables ¶
View Source
var ( ErrConfigFormat = fmt.Errorf(`file "%s" format error. %s`, JsonFileName, ConfigGuideUrl) ErrChainIDInConfig = fmt.Errorf(`file "%s" error: chainID must be in [1, 65535]`, JsonFileName) ErrLogLevelInConfig = fmt.Errorf(`file "%s" error: logLevel must be in [1, 5]`, JsonFileName) ErrHttpPortInConfig = fmt.Errorf(`file "%s" error: http port must be less than 65535`, JsonFileName) ErrWebSocketPortInConfig = fmt.Errorf(`file "%s" error: websocket port must be less than 65535`, JsonFileName) ErrCoreNodeInConfig = fmt.Errorf(`file "%s" error: coreNode must be like: 5e3600755f9b512a65603b38e30885c98cbac70259c3235c9b3f42ee563b480edea351ba0ff5748a638fe0aeff5d845bf37a3b437831871b48fd32f33cd9a3c0@127.0.0.1:60001`, JsonFileName) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ChainID uint32 `json:"chainID" gencodec:"required"`
DeputyCount uint32 `json:"deputyCount" gencodec:"required"`
TermDuration uint64 `json:"termDuration"`
InterimDuration uint64 `json:"interimDuration"`
DbUri string `json:"dbUri" gencodec:"required"` // sample: root:123123@tcp(localhost:3306)/lemochain?charset=utf8mb4
DbDriver string `json:"dbDriver" gencodec:"required"`
LogLevel uint32 `json:"logLevel"`
CoreNode string `json:"coreNode" gencodec:"required"`
Http RpcHttp `json:"http"`
WebSocket RpcWS `json:"webSocket"`
DataDir string
// contains filtered or unexported fields
}
func ReadConfigFile ¶
func (*Config) CoreEndpoint ¶
func (*Config) CoreNodeID ¶
func (Config) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Config) NodeKey ¶
func (c *Config) NodeKey() *ecdsa.PrivateKey
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type ConfigMarshaling ¶
type RpcHttp ¶
type RpcHttp struct {
Disable bool `json:"disable"`
Port uint32 `json:"port" gencodec:"required"`
CorsDomain string `json:"corsDomain"`
VirtualHosts string `json:"virtualHosts"`
}
func (RpcHttp) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*RpcHttp) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type RpcMarshaling ¶
type RpcWS ¶
type RpcWS struct {
Disable bool `json:"disable"`
Port uint32 `json:"port" gencodec:"required"`
CorsDomain string `json:"corsDomain"`
}
func (RpcWS) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*RpcWS) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
Click to show internal directories.
Click to hide internal directories.