startIPC initializes and starts the IPC RPC endpoint.
(apis []rpc.API)
| 298 | |
| 299 | // startIPC initializes and starts the IPC RPC endpoint. |
| 300 | func (n *Node) startIPC(apis []rpc.API) error { |
| 301 | if n.ipcEndpoint == "" { |
| 302 | return nil // IPC disabled. |
| 303 | } |
| 304 | listener, handler, err := rpc.StartIPCEndpoint(n.ipcEndpoint, apis) |
| 305 | if err != nil { |
| 306 | return err |
| 307 | } |
| 308 | n.ipcListener = listener |
| 309 | n.ipcHandler = handler |
| 310 | n.log.Info("IPC endpoint opened", "url", n.ipcEndpoint) |
| 311 | return nil |
| 312 | } |
| 313 | |
| 314 | // stopIPC terminates the IPC RPC endpoint. |
| 315 | func (n *Node) stopIPC() { |