Restart terminates a running node and boots up a new one in its place. If the node isn't running, an error is returned.
()
| 460 | // Restart terminates a running node and boots up a new one in its place. If the |
| 461 | // node isn't running, an error is returned. |
| 462 | func (n *Node) Restart() error { |
| 463 | if err := n.Stop(); err != nil { |
| 464 | return err |
| 465 | } |
| 466 | if err := n.Start(); err != nil { |
| 467 | return err |
| 468 | } |
| 469 | return nil |
| 470 | } |
| 471 | |
| 472 | // Attach creates an RPC client attached to an in-process API handler. |
| 473 | func (n *Node) Attach() (*rpc.Client, error) { |