MCPcopy Create free account
hub / github.com/CPChain/chain / StopRPC

Method StopRPC

node/api.go:154–163  ·  view source on GitHub ↗

StopRPC terminates an already running HTTP RPC API endpoint.

()

Source from the content-addressed store, hash-verified

152
153// StopRPC terminates an already running HTTP RPC API endpoint.
154func (api *PrivateAdminAPI) StopRPC() (bool, error) {
155 api.node.lock.Lock()
156 defer api.node.lock.Unlock()
157
158 if api.node.httpHandler == nil {
159 return false, fmt.Errorf("HTTP RPC not running")
160 }
161 api.node.stopHTTP()
162 return true, nil
163}
164
165// StartWS starts the websocket RPC API server.
166func (api *PrivateAdminAPI) StartWS(host *string, port *int, allowedOrigins *string, apis *string) (bool, error) {

Callers

nothing calls this directly

Calls 3

LockMethod · 0.80
UnlockMethod · 0.80
stopHTTPMethod · 0.80

Tested by

no test coverage detected