Rework discovery
peer discovery happens now based on vault ids not the general token "pentapass". It also happens periodically instead of just once
This commit is contained in:
@@ -50,9 +50,6 @@ func main() {
|
||||
Logger.Panic(err)
|
||||
}
|
||||
|
||||
Logger.Info("Starting peer discovery...")
|
||||
go storage.DiscoverPeers(ctx, h, dht)
|
||||
|
||||
Logger.Info("Initializing datastore...")
|
||||
store, err := badger.NewDatastore(data, &badger.DefaultOptions)
|
||||
if err != nil {
|
||||
@@ -74,6 +71,9 @@ func main() {
|
||||
Key: key,
|
||||
}
|
||||
|
||||
Logger.Info("Starting peer discovery...")
|
||||
go storageHandler.RunBackground(ctx, h, dht)
|
||||
|
||||
configPath := *dbPath + "/config.json"
|
||||
Logger.Infof("Loading config from: %s", configPath)
|
||||
Cfg, err := storageHandler.NewConfig(configPath)
|
||||
@@ -93,6 +93,7 @@ func main() {
|
||||
}
|
||||
|
||||
Logger.Infof("Initialization complete!")
|
||||
Logger.Infof("Serving RPC for ppass cli")
|
||||
rpc.StorageHandler = &storageHandler
|
||||
rpc.Serve(*dbPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user