Versions in this module Expand all Collapse all v0 v0.0.1 Jun 11, 2020 Changes in this version + var ErrDatadirUsed = errors.New("datadir already used by another process") + var ErrNodeRunning = errors.New("node already running") + var ErrNodeStopped = errors.New("node not started") + var ErrServiceUnknown = errors.New("unknown service") + type Config struct + DataDir string + HTTPCors []string + HTTPHost string + HTTPModules []string + HTTPPort int + HTTPVirtualHosts []string + IPCPath string + Logger log.Logger + Name string + P2PBootNodes string + P2PConfig *p2p.Config + P2PNodeDatabase string + P2PStaticNodes string + P2PTrustNodes string + WSExposeAll bool + WSHost string + WSModules []string + WSOrigins []string + WSPort int + func NewConfig(name, datadir string) *Config + func (c *Config) BootNodes() []*enode.Node + func (c *Config) HTTPEndpoint() string + func (c *Config) IPCEndpoint() string + func (c *Config) NodeDB() string + func (c *Config) NodeKey() *ecdsa.PrivateKey + func (c *Config) StaticNodes() []*enode.Node + func (c *Config) TrustedNodes() []*enode.Node + func (c *Config) WSEndpoint() string + type Node struct + func New(conf *Config) (*Node, error) + func (n *Node) GetNodeConfig() *ServiceContext + func (n *Node) Register(constructor ServiceConstructor) error + func (n *Node) Restart() error + func (n *Node) Service(service interface{}) error + func (n *Node) Start() error + func (n *Node) Stop() error + func (n *Node) Wait() + type Service interface + APIs func() []rpc.API + Protocols func() []p2p.Protocol + Start func() error + Stop func() error + type ServiceConstructor func(ctx *ServiceContext) (Service, error) + type ServiceContext struct + P2P *adaptor.ProtoAdaptor + func (ctx *ServiceContext) AppendBootNodes(nodes []string) + func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (fdb.Database, error) + func (ctx *ServiceContext) ResolvePath(path string) string + func (ctx *ServiceContext) Service(service interface{}) error + func (ctx *ServiceContext) SetGenesisHash(genesisHash common.Hash) + type StopError struct + Server error + Services map[reflect.Type]error + func (e *StopError) Error() string