Documentation
¶
Index ¶
- Variables
- type Config
- type DuplicateServiceError
- type NamedServiceConstructor
- type Node
- type Service
- type ServiceConstructor
- type ServiceContext
- func (ctx *ServiceContext) ChainId() prototype.ChainId
- func (ctx *ServiceContext) Config() Config
- func (ctx *ServiceContext) ResetConfig(cfg *Config)
- func (ctx *ServiceContext) ResetServices(s map[string]Service)
- func (ctx *ServiceContext) ResolvePath(path string) string
- func (ctx *ServiceContext) Service(name string) (interface{}, error)
- func (ctx *ServiceContext) UpdateChainId()
- type StopError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ChainId is network id. Builtins are "main", "test" and "dev".
// Nodes with different chain id can't talk with each other.
ChainId string `toml:",omitempty"`
// Name refers the name of node's instance
Name string
// MinDiskSpaceInGB refers the minimum disk space requirement in GB
MinDiskSpaceInGB int
// Version should be set to the version number of the program.
Version string `toml:"-"`
// DataDir is the root folder that store data and service-configs
DataDir string `toml:",omitempty"`
// HTTPHost is the host interface on which to start the HTTP RPC server.
HTTPHost string `toml:",omitempty"`
// HTTPPort is the TCP port number on which to start the HTTP RPC server.
HTTPPort int `toml:",omitempty"`
LogLevel string `toml:",omitempty"`
GRPC service_configs.GRPCConfig
Consensus service_configs.ConsensusConfig
P2P service_configs.P2PConfig
HealthCheck service_configs.HCheck
Database *service_configs.DatabaseConfig
}
func (*Config) ResolvePath ¶
ResolvePath resolves path in the instance directory.
type DuplicateServiceError ¶
type DuplicateServiceError struct {
//Kind reflect.Type
Kind string
}
func (*DuplicateServiceError) Error ¶
func (e *DuplicateServiceError) Error() string
type NamedServiceConstructor ¶
type NamedServiceConstructor struct {
// contains filtered or unexported fields
}
type Node ¶
type Node struct {
MainLoop *eventloop.EventLoop
EvBus EventBus.Bus
//log log.Logger
Log *logrus.Logger
// contains filtered or unexported fields
}
Node is a container and manager of services
type ServiceConstructor ¶
type ServiceConstructor func(ctx *ServiceContext) (Service, error)
type ServiceContext ¶
type ServiceContext struct {
// contains filtered or unexported fields
}
func (*ServiceContext) ChainId ¶ added in v1.0.2
func (ctx *ServiceContext) ChainId() prototype.ChainId
func (*ServiceContext) Config ¶
func (ctx *ServiceContext) Config() Config
func (*ServiceContext) ResetConfig ¶ added in v1.0.2
func (ctx *ServiceContext) ResetConfig(cfg *Config)
func (*ServiceContext) ResetServices ¶ added in v1.0.2
func (ctx *ServiceContext) ResetServices(s map[string]Service)
func (*ServiceContext) ResolvePath ¶
func (ctx *ServiceContext) ResolvePath(path string) string
func (*ServiceContext) Service ¶
func (ctx *ServiceContext) Service(name string) (interface{}, error)
func (*ServiceContext) UpdateChainId ¶ added in v1.0.2
func (ctx *ServiceContext) UpdateChainId()
Click to show internal directories.
Click to hide internal directories.