MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / main

Function main

rpc/_example/tracker/main.go:13–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func main() {
14 //log.SetLevel(log.DebugLevel)
15 conf.GConf, _ = conf.LoadConfig(os.Args[1])
16 log.Debugf("GConf: %#v", conf.GConf)
17
18 // Init Key Management System
19 route.InitKMS(conf.GConf.PubKeyStoreFile)
20
21 // Creating DHT RPC with simple persistence layer
22 dht, err := route.NewDHTService(conf.GConf.DHTFileName, new(consistent.KMSStorage), true)
23 if err != nil {
24 log.Fatalf("init dht failed: %v", err)
25 }
26
27 // Register DHT service
28 server, err := rpc.NewServerWithService(rpc.ServiceMap{route.DHTRPCName: dht})
29 if err != nil {
30 log.Fatal(err)
31 }
32
33 // Init RPC server with an empty master key, which is not recommend
34 addr := conf.GConf.ListenAddr
35 masterKey := []byte("")
36 server.InitRPCServer(addr, conf.GConf.PrivateKeyFile, masterKey)
37 server.Serve()
38}

Callers

nothing calls this directly

Calls 9

LoadConfigFunction · 0.92
DebugfFunction · 0.92
InitKMSFunction · 0.92
NewDHTServiceFunction · 0.92
FatalfFunction · 0.92
NewServerWithServiceFunction · 0.92
FatalFunction · 0.92
InitRPCServerMethod · 0.80
ServeMethod · 0.45

Tested by

no test coverage detected