()
| 11 | ) |
| 12 | |
| 13 | func 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 | } |
nothing calls this directly
no test coverage detected