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

Method startInProc

node/node.go:275–289  ·  view source on GitHub ↗

startInProc initializes an in-process RPC endpoint.

(apis []rpc.API)

Source from the content-addressed store, hash-verified

273
274// startInProc initializes an in-process RPC endpoint.
275func (n *Node) startInProc(apis []rpc.API) error {
276 // Register all the APIs exposed by the services
277 handler := rpc.NewServer()
278 for _, api := range apis {
279 if api.Namespace == "admission" {
280 api.Service.(admission.ApiBackend).RegisterInProcHandler(handler)
281 }
282 if err := handler.RegisterName(api.Namespace, api.Service); err != nil {
283 return err
284 }
285 n.log.Debug("InProc registered", "service", api.Service, "namespace", api.Namespace)
286 }
287 n.inprocHandler = handler
288 return nil
289}
290
291// stopInProc terminates the in-process RPC endpoint.
292func (n *Node) stopInProc() {

Callers 1

startRPCMethod · 0.95

Calls 3

RegisterNameMethod · 0.95
DebugMethod · 0.80
RegisterInProcHandlerMethod · 0.65

Tested by

no test coverage detected