MCPcopy
hub / github.com/canopy-network/canopy / Start

Method Start

cmd/rpc/server.go:80–101  ·  view source on GitHub ↗

Start initializes the Canopy RPC servers

()

Source from the content-addressed store, hash-verified

78
79// Start initializes the Canopy RPC servers
80func (s *Server) Start() {
81 // Start the Query and Admin RPC servers concurrently
82 go s.startRPC(createRouter(s), s.config.RPCPort)
83 go s.startRPC(createAdminRouter(s), s.config.AdminPort)
84
85 // Start tasks to update poll results and poll root chain information
86 go s.updatePollResults()
87 go s.rcManager.Start()
88 go s.startEthRPCService()
89
90 // Start heap profiler if enabled (warning: causes GC pauses which may affect RPC latency)
91 if s.config.HeapProfilingEnabled {
92 go s.startHeapProfiler()
93 }
94
95 if s.config.Headless {
96 return
97 }
98
99 // Start in-process HTTP servers for the wallet and explorer
100 s.startStaticFileServers()
101}
102
103// startRPC starts an RPC server with the provided router and port
104func (s *Server) startRPC(router *httprouter.Router, port string) {

Callers 2

StartFunction · 0.95
execCommandFunction · 0.45

Calls 7

startRPCMethod · 0.95
updatePollResultsMethod · 0.95
startEthRPCServiceMethod · 0.95
startHeapProfilerMethod · 0.95
createRouterFunction · 0.85
createAdminRouterFunction · 0.85

Tested by

no test coverage detected