Versions in this module Expand all Collapse all v1 v1.0.0 Nov 13, 2020 Changes in this version + func RegisterServices(services Services) + type ExecAdapter struct + BaseDir string + func NewExecAdapter(baseDir string) *ExecAdapter + func (e *ExecAdapter) Name() string + func (e *ExecAdapter) NewNode(config *NodeConfig) (Node, error) + type ExecNode struct + Cmd *exec.Cmd + Config *execNodeConfig + Dir string + ID enode.ID + Info *p2p.NodeInfo + func (n *ExecNode) Addr() []byte + func (n *ExecNode) Client() (*rpc.Client, error) + func (n *ExecNode) NodeInfo() *p2p.NodeInfo + func (n *ExecNode) ServeRPC(clientConn *websocket.Conn) error + func (n *ExecNode) Snapshots() (map[string][]byte, error) + func (n *ExecNode) Start(snapshots map[string][]byte) (err error) + func (n *ExecNode) Stop() error + type Node interface + Addr func() []byte + Client func() (*rpc.Client, error) + NodeInfo func() *p2p.NodeInfo + ServeRPC func(*websocket.Conn) error + Snapshots func() (map[string][]byte, error) + Start func(snapshots map[string][]byte) error + Stop func() error + type NodeAdapter interface + Name func() string + NewNode func(config *NodeConfig) (Node, error) + type NodeConfig struct + DataDir string + EnableMsgEvents bool + ID enode.ID + Name string + Port uint16 + PrivateKey *ecdsa.PrivateKey + Properties []string + Reachable func(id enode.ID) bool + Record enr.Record + Services []string + func RandomNodeConfig() *NodeConfig + func (n *NodeConfig) MarshalJSON() ([]byte, error) + func (n *NodeConfig) Node() *enode.Node + func (n *NodeConfig) UnmarshalJSON(data []byte) error + type RPCDialer interface + DialRPC func(id enode.ID) (*rpc.Client, error) + type ServiceContext struct + Config *NodeConfig + NodeContext *node.ServiceContext + Snapshot []byte + type ServiceFunc func(ctx *ServiceContext) (node.Service, error) + type Services map[string]ServiceFunc + type SimAdapter struct + func NewSimAdapter(services map[string]ServiceFunc) *SimAdapter + func NewTCPAdapter(services map[string]ServiceFunc) *SimAdapter + func (s *SimAdapter) Dial(dest *enode.Node) (conn net.Conn, err error) + func (s *SimAdapter) DialRPC(id enode.ID) (*rpc.Client, error) + func (s *SimAdapter) GetNode(id enode.ID) (*SimNode, bool) + func (s *SimAdapter) Name() string + func (s *SimAdapter) NewNode(config *NodeConfig) (Node, error) + type SimNode struct + ID enode.ID + func (sn *SimNode) Addr() []byte + func (sn *SimNode) Client() (*rpc.Client, error) + func (sn *SimNode) Close() error + func (sn *SimNode) Node() *enode.Node + func (sn *SimNode) NodeInfo() *p2p.NodeInfo + func (sn *SimNode) ServeRPC(conn *websocket.Conn) error + func (sn *SimNode) Server() *p2p.Server + func (sn *SimNode) Service(name string) node.Service + func (sn *SimNode) ServiceMap() map[string]node.Service + func (sn *SimNode) Services() []node.Service + func (sn *SimNode) Snapshots() (map[string][]byte, error) + func (sn *SimNode) Start(snapshots map[string][]byte) error + func (sn *SimNode) Stop() error + func (sn *SimNode) SubscribeEvents(ch chan *p2p.PeerEvent) event.Subscription + type SnapshotAPI struct + func (api SnapshotAPI) Snapshot() (map[string][]byte, error)