Attach creates an RPC client attached to an in-process API handler.
()
| 471 | |
| 472 | // Attach creates an RPC client attached to an in-process API handler. |
| 473 | func (n *Node) Attach() (*rpc.Client, error) { |
| 474 | n.lock.RLock() |
| 475 | defer n.lock.RUnlock() |
| 476 | |
| 477 | if n.server == nil { |
| 478 | return nil, ErrNodeStopped |
| 479 | } |
| 480 | return rpc.DialInProc(n.inprocHandler), nil |
| 481 | } |
| 482 | |
| 483 | // RPCHandler returns the in-process RPC request handler. |
| 484 | func (n *Node) RPCHandler() (*rpc.Server, error) { |
no outgoing calls