MCPcopy Create free account
hub / github.com/DNAProject/DNA / initRpc

Function initRpc

main.go:345–367  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

343}
344
345func initRpc(ctx *cli.Context) error {
346 if !config.DefConfig.Rpc.EnableHttpJsonRpc {
347 return nil
348 }
349 var err error
350 exitCh := make(chan interface{}, 0)
351 go func() {
352 err = jsonrpc.StartRPCServer()
353 close(exitCh)
354 }()
355
356 flag := false
357 select {
358 case <-exitCh:
359 if !flag {
360 return err
361 }
362 case <-time.After(time.Millisecond * 5):
363 flag = true
364 }
365 log.Infof("Rpc init success")
366 return nil
367}
368
369func initLocalRpc(ctx *cli.Context) error {
370 if !ctx.GlobalBool(utils.GetFlagName(utils.RPCLocalEnableFlag)) {

Callers 1

startDNAFunction · 0.85

Calls 2

StartRPCServerFunction · 0.92
InfofMethod · 0.80

Tested by

no test coverage detected