Versions in this module Expand all Collapse all v1 v1.7.2 Oct 14, 2017 v1.7.1 Oct 3, 2017 Changes in this version + func RegisterServices(services Services) + type DockerAdapter struct + func NewDockerAdapter() (*DockerAdapter, error) + func (d *DockerAdapter) Name() string + func (d *DockerAdapter) NewNode(config *NodeConfig) (Node, error) + type DockerNode struct + 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 discover.NodeID + 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 net.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(net.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 + ID discover.NodeID + Name string + PrivateKey *ecdsa.PrivateKey + Services []string + func RandomNodeConfig() *NodeConfig + func (n *NodeConfig) MarshalJSON() ([]byte, error) + func (n *NodeConfig) UnmarshalJSON(data []byte) error + type RPCDialer interface + DialRPC func(id discover.NodeID) (*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 (s *SimAdapter) Dial(dest *discover.Node) (conn net.Conn, err error) + func (s *SimAdapter) DialRPC(id discover.NodeID) (*rpc.Client, error) + func (s *SimAdapter) GetNode(id discover.NodeID) (*SimNode, bool) + func (s *SimAdapter) Name() string + func (s *SimAdapter) NewNode(config *NodeConfig) (Node, error) + type SimNode struct + ID discover.NodeID + func (self *SimNode) Addr() []byte + func (self *SimNode) Client() (*rpc.Client, error) + func (self *SimNode) Node() *discover.Node + func (self *SimNode) NodeInfo() *p2p.NodeInfo + func (self *SimNode) ServeRPC(conn net.Conn) error + func (self *SimNode) Server() *p2p.Server + func (self *SimNode) Services() []node.Service + func (self *SimNode) Snapshots() (map[string][]byte, error) + func (self *SimNode) Start(snapshots map[string][]byte) error + func (self *SimNode) Stop() error + func (self *SimNode) SubscribeEvents(ch chan *p2p.PeerEvent) event.Subscription + type SnapshotAPI struct + func (api SnapshotAPI) Snapshot() (map[string][]byte, error)