mirror of
https://github.com/gravitl/netmaker.git
synced 2026-04-22 16:07:11 +08:00
node debug
This commit is contained in:
@@ -80,6 +80,7 @@ func (s *NodeServiceServer) CreateNode(ctx context.Context, req *nodepb.Object)
|
||||
node.NetworkSettings.DefaultServerAddrs = serverAddrs
|
||||
key, keyErr := logic.RetrieveTrafficKey()
|
||||
if keyErr != nil {
|
||||
logger.Log(0, "error retrieving key: ", keyErr.Error())
|
||||
return nil, keyErr
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"encoding/gob"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -221,12 +222,14 @@ func initializeUUID() error {
|
||||
if err = gob.NewEncoder(&rsaKey).Encode(rsaPrivKey); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("adding key %v \n", rsaPrivKey)
|
||||
|
||||
telemetry := models.Telemetry{UUID: uuid.NewString(), TrafficKey: rsaKey}
|
||||
telJSON, err := json.Marshal(&telemetry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("added key %v \n", rsaKey)
|
||||
|
||||
return Insert(SERVER_UUID_RECORD_KEY, string(telJSON), SERVER_UUID_TABLE_NAME)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user