{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package node\n\nPackage node sets up multi-protocol Ethereum nodes.\n\nIn the model exposed by this package, a node is a collection of services which use shared resources to provide RPC APIs. Services can also offer devp2p protocols, which are wired up to the devp2p network when the node instance is started.\n\n### Node Lifecycle {#hdr-Node_Lifecycle}\n\nThe Node object has a lifecycle consisting of three basic states, INITIALIZING, RUNNING and CLOSED.\n\n\t●───────┐\n\t     New()\n\t        │\n\t        ▼\n\t  INITIALIZING ────Start()─┐\n\t        │                  │\n\t        │                  ▼\n\t    Close()             RUNNING\n\t        │                  │\n\t        ▼                  │\n\t     CLOSED ◀──────Close()─┘\n\nCreating a Node allocates basic resources such as the data directory and returns the node in its INITIALIZING state. Lifecycle objects, RPC APIs and peer-to-peer networking protocols can be registered in this state. Basic operations such as opening a key-value database are permitted while initializing.\n\nOnce everything is registered, the node can be started, which moves it into the RUNNING state. Starting the node starts all registered Lifecycle objects and enables RPC and peer-to-peer networking. Note that no additional Lifecycles, APIs or p2p protocols can be registered while the node is running.\n\nClosing the node releases all held resources. The actions performed by Close depend on the state it was in. When closing a node in INITIALIZING state, resources related to the data directory are released. If the node was RUNNING, closing it also stops all Lifecycle objects and shuts down RPC and peer-to-peer networking.\n\nYou must always call Close on Node, even if the node was not started.\n\n### Resources Managed By Node {#hdr-Resources_Managed_By_Node}\n\nAll file-system resources used by a node instance are located in a directory called the data directory. The location of each resource can be overridden through additional node configuration. The data directory is optional. If it is not set and the location of a resource is otherwise unspecified, package node will create the resource in memory.\n\nTo access to the devp2p network, Node configures and starts p2p.Server. Each host on the devp2p network has a unique identifier, the node key. The Node instance persists this key across restarts. Node also loads static and trusted node lists and ensures that knowledge about other hosts is persisted.\n\nJSON-RPC servers which run HTTP, WebSocket or IPC can be started on a Node. RPC modules offered by registered services will be offered on those endpoints. Users can restrict any endpoint to a subset of RPC modules. Node itself offers the \"debug\", \"admin\" and \"web3\" modules.\n\nService implementations can open LevelDB databases through the service context. Package node chooses the file system location of each database. If the node is configured to run without a data directory, databases are opened in memory instead.\n\nNode also creates the shared store of encrypted Ethereum account keys. Services can access the account manager through the service context.\n\n### Sharing Data Directory Among Instances {#hdr-Sharing_Data_Directory_Among_Instances}\n\nMultiple node instances can share a single data directory if they have distinct instance names (set through the Name config option). Sharing behaviour depends on the type of resource.\n\ndevp2p-related resources (node key, static/trusted node lists, known hosts database) are stored in a directory with the same name as the instance. Thus, multiple node instances using the same data directory will store this information in different subdirectories of the data directory.\n\nLevelDB databases are also stored within the instance subdirectory. If multiple node instances use the same data directory, opening the databases with identical names will create one database for each instance.\n\nThe account key store is shared among all node instances using the same data directory unless its location is changed through the KeyStoreDir configuration option.\n\n### Data Directory Sharing Example {#hdr-Data_Directory_Sharing_Example}\n\nIn this example, two node instances named A and B are started with the same data directory. Node instance A opens the database \"db\", node instance B opens the databases \"db\" and \"db-2\". The following files will be created in the data directory:\n\n\tdata-directory/\n\t     A/\n\t         nodekey            -- devp2p node key of instance A\n\t         nodes/             -- devp2p discovery knowledge database of instance A\n\t         db/                -- LevelDB content for \"db\"\n\t     A.ipc                  -- JSON-RPC UNIX domain socket endpoint of instance A\n\t     B/\n\t         nodekey            -- devp2p node key of node B\n\t         nodes/             -- devp2p discovery knowledge database of instance B\n\t         static-nodes.json  -- devp2p static node list of instance B\n\t         db/                -- LevelDB content for \"db\"\n\t         db-2/              -- LevelDB content for \"db-2\"\n\t     B.ipc                  -- JSON-RPC UNIX domain socket endpoint of instance B\n\t     keystore/              -- account key store, used by both instances\n\n## Constants\n\n```go\nconst (\n\tDefaultHTTPHost    = \"localhost\" // Default host interface for the HTTP RPC server\n\tDefaultHTTPPort    = 8545        // Default TCP port for the HTTP RPC server\n\tDefaultWSHost      = \"localhost\" // Default host interface for the websocket RPC server\n\tDefaultWSPort      = 8546        // Default TCP port for the websocket RPC server\n\tDefaultGraphQLHost = \"localhost\" // Default host interface for the GraphQL server\n\tDefaultGraphQLPort = 8547        // Default TCP port for the GraphQL server\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrDatadirUsed    = errors.New(\"datadir already used by another process\")\n\tErrNodeStopped    = errors.New(\"node not started\")\n\tErrNodeRunning    = errors.New(\"node already running\")\n\tErrServiceUnknown = errors.New(\"unknown service\")\n)\n```\n\n```go\nvar DefaultConfig = Config{\n\tDataDir:             DefaultDataDir(),\n\tHTTPPort:            DefaultHTTPPort,\n\tHTTPModules:         []string{\"net\", \"web3\"},\n\tHTTPVirtualHosts:    []string{\"localhost\"},\n\tHTTPTimeouts:        rpc.DefaultHTTPTimeouts,\n\tWSPort:              DefaultWSPort,\n\tWSModules:           []string{\"net\", \"web3\"},\n\tGraphQLVirtualHosts: []string{\"localhost\"},\n\n\tP2P: p2p.Config{\n\t\tListenAddr: \":30303\",\n\t\tMaxPeers:   50,\n\t\tNAT:        nat.Any(),\n\t},\n}\n```\nDefaultConfig contains reasonable default settings. 默认的node.Config对象 默认值里没有指定节点私钥,需要使用者自己指定 默认端口分别为 http 8545,websocket 8546,graphQl 8547\n\n## Functions\n\n```go\nfunc CheckTimeouts(timeouts *rpc.HTTPTimeouts)\n```\nCheckTimeouts ensures that timeout values are meaningful 判断超时时间是不是有效 读取,写入和空闲超时时间任何一个都不能小于一秒,小于一秒就改成默认值\n\n```go\nfunc DefaultDataDir() string\n```\nDefaultDataDir is the default data directory to use for the databases and other persistence requirements. 获取默认的DataDir路径,获取失败返回空字符串 Mac是 $HOME/Library/Ethereum Linux $HOME/.ethereum\n\n```go\nfunc DefaultHTTPEndpoint() string\n```\nDefaultHTTPEndpoint returns the HTTP endpoint used by default.\n\n```go\nfunc DefaultIPCEndpoint(clientIdentifier string) string\n```\nDefaultIPCEndpoint returns the IPC path used by default. 获取默认的ipc文件的路径 就是 DataDir/xxx.ipc\n\n```go\nfunc DefaultWSEndpoint() string\n```\nDefaultWSEndpoint returns the websocket endpoint used by default.\n\n```go\nfunc NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler\n```\nNewHTTPHandlerStack returns wrapped http-related handlers 将输入http.Handler对象封装成支持cors,gzip并能抵抗dns重绑定攻击的http.Handler对象 cors代表允许跨域的域名 [http://xxx.xx](http://xxx.xx) 这种格式的列表,支持\\*通配符 vhosts代表允许请求头Host字段的域名 xxx.xx 格式,没有http://这一段头,支持\\*通配符\n\n```go\nfunc RegisterApis(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error\n```\nRegisterApis checks the given modules' availability, generates an allowlist based on the allowed modules, and then registers all of the APIs exposed by the services. apis包括了所有支持的服务,modules是允许注册的服务 在srv上注册所有modules和apis都有的服务 exposeAll用来控制是不是要直接注册所有apis中的服务\n\n```go\nfunc StartHTTPEndpoint(endpoint string, timeouts rpc.HTTPTimeouts, handler http.Handler) (*http.Server, net.Addr, error)\n```\nStartHTTPEndpoint starts the HTTP RPC endpoint. 在endpoint上启动一个http服务,接收的请求由handler处理 endpoint指定了监听的地址和端口,handler实现了ServeHTTP方法\n\n## Types\n\n```go\ntype Config struct {\n\t// Name sets the instance name of the node. It must not contain the / character and is\n\t// used in the devp2p node identifier. The instance name of geth is \"geth\". If no\n\t// value is specified, the basename of the current executable is used.\n\t// 节点的名称,在devp2p作节点的标识\n\tName string `toml:\"-\"`\n\n\t// UserIdent, if set, is used as an additional component in the devp2p node identifier.\n\t// 如果设置了,作为附加的标识符\n\t// 最终的标识符是 Name/UserIdent 用斜杠连接两个部分\n\tUserIdent string `toml:\",omitempty\"`\n\n\t// Version should be set to the version number of the program. It is used\n\t// in the devp2p node identifier.\n\tVersion string `toml:\"-\"`\n\n\t// DataDir is the file system folder the node should use for any data storage\n\t// requirements. The configured data directory will not be directly shared with\n\t// registered services, instead those can use utility methods to create/access\n\t// databases or flat files. This enables ephemeral nodes which can fully reside\n\t// in memory.\n\tDataDir string\n\n\t// Configuration of peer-to-peer networking.\n\t// 这里p2p.Config中可以不指定私钥,不指定私钥将随机生成\n\tP2P p2p.Config\n\n\t// KeyStoreDir is the file system folder that contains private keys. The directory can\n\t// be specified as a relative path, in which case it is resolved relative to the\n\t// current directory.\n\t//\n\t// If KeyStoreDir is empty, the default location is the \"keystore\" subdirectory of\n\t// DataDir. If DataDir is unspecified and KeyStoreDir is empty, an ephemeral directory\n\t// is created by New and destroyed when the node is stopped.\n\t// 明确指定了keystore保存的位置,如果是空字符串那么就使用默认位置 DataDir/keystore\n\t// 默认位置直接再DataDir下,不在各个节点的专属文件夹,说明keystore被各个节点共享\n\tKeyStoreDir string `toml:\",omitempty\"`\n\n\t// ExternalSigner specifies an external URI for a clef-type signer\n\tExternalSigner string `toml:\",omitempty\"`\n\n\t// UseLightweightKDF lowers the memory and CPU requirements of the key store\n\t// scrypt KDF at the expense of security.\n\tUseLightweightKDF bool `toml:\",omitempty\"`\n\n\t// InsecureUnlockAllowed allows user to unlock accounts in unsafe http environment.\n\tInsecureUnlockAllowed bool `toml:\",omitempty\"`\n\n\t// NoUSB disables hardware wallet monitoring and connectivity.\n\t// Deprecated: USB monitoring is disabled by default and must be enabled explicitly.\n\tNoUSB bool `toml:\",omitempty\"`\n\n\t// USB enables hardware wallet monitoring and connectivity.\n\tUSB bool `toml:\",omitempty\"`\n\n\t// SmartCardDaemonPath is the path to the smartcard daemon's socket\n\tSmartCardDaemonPath string `toml:\",omitempty\"`\n\n\t// IPCPath is the requested location to place the IPC endpoint. If the path is\n\t// a simple file name, it is placed inside the data directory (or on the root\n\t// pipe path on Windows), whereas if it's a resolvable path name (absolute or\n\t// relative), then that specific path is enforced. An empty path disables IPC.\n\t// 可以直接是文件名,代表保存在DataDir下\n\t// 可以是绝对路径\n\t// 可以是空字符串,代表禁用IPC\n\tIPCPath string\n\n\t// HTTPHost is the host interface on which to start the HTTP RPC server. If this\n\t// field is empty, no HTTP API endpoint will be started.\n\t// http rpc使用的网络接口,如果为空说明不启用\n\tHTTPHost string\n\n\t// HTTPPort is the TCP port number on which to start the HTTP RPC server. The\n\t// default zero value is/ valid and will pick a port number randomly (useful\n\t// for ephemeral nodes).\n\tHTTPPort int `toml:\",omitempty\"`\n\n\t// HTTPCors is the Cross-Origin Resource Sharing header to send to requesting\n\t// clients. Please be aware that CORS is a browser enforced security, it's fully\n\t// useless for custom HTTP clients.\n\tHTTPCors []string `toml:\",omitempty\"`\n\n\t// HTTPVirtualHosts is the list of virtual hostnames which are allowed on incoming requests.\n\t// This is by default {'localhost'}. Using this prevents attacks like\n\t// DNS rebinding, which bypasses SOP by simply masquerading as being within the same\n\t// origin. These attacks do not utilize CORS, since they are not cross-domain.\n\t// By explicitly checking the Host-header, the server will not allow requests\n\t// made against the server with a malicious host domain.\n\t// Requests using ip address directly are not affected\n\tHTTPVirtualHosts []string `toml:\",omitempty\"`\n\n\t// HTTPModules is a list of API modules to expose via the HTTP RPC interface.\n\t// If the module list is empty, all RPC API endpoints designated public will be\n\t// exposed.\n\tHTTPModules []string\n\n\t// HTTPTimeouts allows for customization of the timeout values used by the HTTP RPC\n\t// interface.\n\tHTTPTimeouts rpc.HTTPTimeouts\n\n\t// HTTPPathPrefix specifies a path prefix on which http-rpc is to be served.\n\tHTTPPathPrefix string `toml:\",omitempty\"`\n\n\t// WSHost is the host interface on which to start the websocket RPC server. If\n\t// this field is empty, no websocket API endpoint will be started.\n\t// websocket使用的网络接口,为空说明不启用websocket\n\tWSHost string\n\n\t// WSPort is the TCP port number on which to start the websocket RPC server. The\n\t// default zero value is/ valid and will pick a port number randomly (useful for\n\t// ephemeral nodes).\n\tWSPort int `toml:\",omitempty\"`\n\n\t// WSPathPrefix specifies a path prefix on which ws-rpc is to be served.\n\tWSPathPrefix string `toml:\",omitempty\"`\n\n\t// WSOrigins is the list of domain to accept websocket requests from. Please be\n\t// aware that the server can only act upon the HTTP request the client sends and\n\t// cannot verify the validity of the request header.\n\tWSOrigins []string `toml:\",omitempty\"`\n\n\t// WSModules is a list of API modules to expose via the websocket RPC interface.\n\t// If the module list is empty, all RPC API endpoints designated public will be\n\t// exposed.\n\tWSModules []string\n\n\t// WSExposeAll exposes all API modules via the WebSocket RPC interface rather\n\t// than just the public ones.\n\t//\n\t// *WARNING* Only set this if the node is running in a trusted network, exposing\n\t// private APIs to untrusted users is a major security risk.\n\tWSExposeAll bool `toml:\",omitempty\"`\n\n\t// GraphQLCors is the Cross-Origin Resource Sharing header to send to requesting\n\t// clients. Please be aware that CORS is a browser enforced security, it's fully\n\t// useless for custom HTTP clients.\n\tGraphQLCors []string `toml:\",omitempty\"`\n\n\t// GraphQLVirtualHosts is the list of virtual hostnames which are allowed on incoming requests.\n\t// This is by default {'localhost'}. Using this prevents attacks like\n\t// DNS rebinding, which bypasses SOP by simply masquerading as being within the same\n\t// origin. These attacks do not utilize CORS, since they are not cross-domain.\n\t// By explicitly checking the Host-header, the server will not allow requests\n\t// made against the server with a malicious host domain.\n\t// Requests using ip address directly are not affected\n\tGraphQLVirtualHosts []string `toml:\",omitempty\"`\n\n\t// Logger is a custom logger to use with the p2p.Server.\n\tLogger log.Logger `toml:\",omitempty\"`\n\n\t// AllowUnprotectedTxs allows non EIP-155 protected transactions to be send over RPC.\n\tAllowUnprotectedTxs bool `toml:\",omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nConfig represents a small collection of configuration values to fine tune the P2P network layer of a protocol stack. These values can be further extended by all registered services. P2P字段中可以不指定私钥,不指定私钥将随机生成\n\n```go\nfunc (c *Config) ExtRPCEnabled() bool\n```\nExtRPCEnabled returns the indicator whether node enables the external RPC(http, ws or graphql). 判断是否有外部的RPC启用了 外部是指http,ws或者graphql,相对于内部是进程内通信和进程间通信\n\n```go\nfunc (c *Config) HTTPEndpoint() string\n```\nHTTPEndpoint resolves an HTTP endpoint based on the configured host interface and port parameters.\n\n```go\nfunc (c *Config) IPCEndpoint() string\n```\nIPCEndpoint resolves an IPC endpoint based on a configured value, taking into account the set data folders as well as the designated platform we're currently running on. 返回ipc文件的绝对路径\n\n```go\nfunc (c *Config) KeyDirConfig() (string, error)\n```\nKeyDirConfig determines the settings for keydirectory 返回scryptN,scryptP,keydir,err keydir代表keystore保存的目录\n\n```go\nfunc (c *Config) NodeDB() string\n```\nNodeDB returns the path to the discovery node database. 保存节点发现数据的数据库的路径\n\n```go\nfunc (c *Config) NodeKey() *ecdsa.PrivateKey\n```\nNodeKey retrieves the currently configured private key of the node, checking first any manually set key, falling back to the one found in the configured data folder. If no key can be found, a new one is generated. 获取节点的私钥 Config.P2P.PrivateKey不为nil,就使用这个 DataDir为空随机生成一个 DataDir不为空从私钥文件中加载,私钥文件不存在就随机生成一个私钥并把这个私钥保存到私钥文件\n\n```go\nfunc (c *Config) NodeName() string\n```\nNodeName returns the devp2p node identifier. 计算节点的标识符,完整的标识符如下,其中的UserIdent和Version可能会被省略 Geth/Ident/v1.10.4-stable-aa637fd3/linux-amd64/go1.16.4\n\n```go\nfunc (c *Config) ResolvePath(path string) string\n```\nResolvePath resolves path in the instance directory. 将path与节点的专属路径拼接起来,例如: DataDir/name/path 如果path是绝对路径,那么就直接使用path\n\n```go\nfunc (c *Config) StaticNodes() []*enode.Node\n```\nStaticNodes returns a list of node enode URLs configured as static nodes. 获取static-nodes.json中保存的节点列表\n\n```go\nfunc (c *Config) TrustedNodes() []*enode.Node\n```\nTrustedNodes returns a list of node enode URLs configured as trusted nodes. 获取trusted-nodes.json中保存的节点列表\n\n```go\nfunc (c *Config) WSEndpoint() string\n```\nWSEndpoint resolves a websocket endpoint based on the configured host interface and port parameters.\n\n```go\ntype Lifecycle interface {\n\t// Start is called after all services have been constructed and the networking\n\t// layer was also initialized to spawn any goroutines required by the service.\n\tStart() error\n\n\t// Stop terminates all goroutines belonging to the service, blocking until they\n\t// are all terminated.\n\tStop() error\n}\n```\nLifecycle encompasses the behavior of services that can be started and stopped on the node. Lifecycle management is delegated to the node, but it is the responsibility of the service-specific package to configure and register the service on the node using the \\`RegisterLifecycle\\` method.\n\n```go\ntype Node struct {\n\t// contains filtered or unexported fields\n}\n```\n一个node.Node对象内部运行了p2p服务和RPC服务 p2p服务使用p2p.Server实现 RPC服务实现了四种连接方式,分别是进程内,进程间,http,websocket\n\n```go\nfunc New(conf *Config) (*Node, error)\n```\nNew creates a new P2P node, ready for protocol registration. 创建一个p2p节点,等待注册协议 创建一个node.Node主要包括以下步骤 处理配置信息,数据文件夹路径转换成绝对路径,节点名称合法 初始化Node对象,主要创建了p2p.Server对象,在rpcAPIs中添加内置方法 创建四个rpc服务对象,但是没有启动 进程内是rpc.Server,进程间是ipcServer,http和websocket都是httpServer\n\n```go\nfunc (n *Node) AccountManager() *accounts.Manager\n```\nAccountManager retrieves the account manager used by the protocol stack.\n\n```go\nfunc (n *Node) Attach() (*rpc.Client, error)\n```\nAttach creates an RPC client attached to an in-process API handler. 获取一个rpc.Client对象 通信过程是内存中直接通信\n\n```go\nfunc (n *Node) Close() error\n```\nClose stops the Node and releases resources acquired in Node constructor New. 关闭一个节点,处于以下三种状态的不同处理方式 初始化状态: doClose 运行状态: 停止所有服务,doClose 关闭状态: 报错\n\n```go\nfunc (n *Node) Config() *Config\n```\nConfig returns the configuration of node. 获取节点配置\n\n```go\nfunc (n *Node) DataDir() string\n```\nDataDir retrieves the current datadir used by the protocol stack. Deprecated: No files should be stored in this directory, use InstanceDir instead.\n\n```go\nfunc (n *Node) EventMux() *event.TypeMux\n```\nEventMux retrieves the event multiplexer used by all the network services in the current protocol stack.\n\n```go\nfunc (n *Node) HTTPEndpoint() string\n```\nHTTPEndpoint returns the URL of the HTTP server. Note that this URL does not contain the JSON-RPC path prefix set by HTTPPathPrefix. 获取http服务的地址\n\n```go\nfunc (n *Node) IPCEndpoint() string\n```\nIPCEndpoint retrieves the current IPC endpoint used by the protocol stack.\n\n```go\nfunc (n *Node) InstanceDir() string\n```\nInstanceDir retrieves the instance directory used by the protocol stack.\n\n```go\nfunc (n *Node) KeyStoreDir() string\n```\nKeyStoreDir retrieves the key directory\n\n```go\nfunc (n *Node) OpenDatabase(name string, cache, handles int, namespace string, readonly bool) (ethdb.Database, error)\n```\nOpenDatabase opens an existing database with the given name (or creates one if no previous can be found) from within the node's instance directory. If the node is ephemeral, a memory database is returned.\n\n```go\nfunc (n *Node) OpenDatabaseWithFreezer(name string, cache, handles int, freezer, namespace string, readonly bool) (ethdb.Database, error)\n```\nOpenDatabaseWithFreezer opens an existing database with the given name (or creates one if no previous can be found) from within the node's data directory, also attaching a chain freezer to it that moves ancient chain data from the database to immutable append-only files. If the node is an ephemeral one, a memory database is returned.\n\n```go\nfunc (n *Node) RPCHandler() (*rpc.Server, error)\n```\nRPCHandler returns the in-process RPC request handler. 获取处理进程内请求的rpc.Server对象\n\n```go\nfunc (n *Node) RegisterAPIs(apis []rpc.API)\n```\nRegisterAPIs registers the APIs a service provides on the node.\n\n```go\nfunc (n *Node) RegisterHandler(name, path string, handler http.Handler)\n```\nRegisterHandler mounts a handler on the given path on the canonical HTTP server.\n\nThe name of the handler is shown in a log message when the HTTP server starts and should be a descriptive term for the service provided by the handler. 为节点注册某个路径下的处理函数 这个方法必须在节点启动前调用\n\n```go\nfunc (n *Node) RegisterLifecycle(lifecycle Lifecycle)\n```\nRegisterLifecycle registers the given Lifecycle on the node. 为节点注册服务,注册服务时节点必须在初始化状态\n\n```go\nfunc (n *Node) RegisterProtocols(protocols []p2p.Protocol)\n```\nRegisterProtocols adds backend's protocols to the node's p2p server.\n\n```go\nfunc (n *Node) ResolvePath(x string) string\n```\nResolvePath returns the absolute path of a resource in the instance directory.\n\n```go\nfunc (n *Node) Server() *p2p.Server\n```\nServer retrieves the currently running P2P network layer. This method is meant only to inspect fields of the currently running server. Callers should not start or stop the returned server.\n\n```go\nfunc (n *Node) Start() error\n```\nStart starts all registered lifecycles, RPC services and p2p networking. Node can only be started once. 只有刚初始化完成的节点才能调用Start也就是initializingState状态才能启动 启动一个节点,包括三个部分 调用所有服务Start方法 启动四种RPC服务 启动p2p网络\n\n```go\nfunc (n *Node) WSEndpoint() string\n```\nWSEndpoint returns the current JSON-RPC over WebSocket endpoint.\n\n```go\nfunc (n *Node) Wait()\n```\nWait blocks until the node is closed.\n\n```go\ntype StopError struct {\n\tServer   error\n\tServices map[reflect.Type]error\n}\n```\nStopError is returned if a Node fails to stop either any of its registered services or itself. StopError是一个节点停止它注册的服务或者它自己的时候发生的错误\n\n```go\nfunc (e *StopError) Error() string\n```\nError generates a textual representation of the stop error.\n\n","path":"github.com/Evolution404/simcore/node","name":"node","synopsis":"Package node sets up multi-protocol Ethereum nodes.","isRedistributable":true}
