@@ -2,6 +2,8 @@ package main
22
33import (
44 "context"
5+ "crypto/ed25519"
6+ "encoding/base64"
57 "flag"
68 "fmt"
79 "os"
@@ -57,7 +59,7 @@ func main() {
5759 flag .IntVar (& interval , "interval" , 600 , "interval in seconds between update checks, default to 600" )
5860 flag .BoolVar (& ver , "v" , false , "show version and exit" )
5961 flag .BoolVar (& debug , "d" , false , "when set, no self update is done before upgrading" )
60- flag .BoolVar (& id , "id" , false , "[deprecated] prints the node ID and exits" )
62+ flag .BoolVar (& id , "id" , false , "prints the node ID/pubkey and exits needed for loki service " )
6163 flag .BoolVar (& net , "net" , false , "prints the node network and exits" )
6264 flag .BoolVar (& farm , "farm" , false , "prints the node farm id and exits" )
6365
@@ -82,7 +84,11 @@ func main() {
8284 log .Fatal ().Err (err ).Msg ("failed to connect to zbus" )
8385 }
8486 stub := stubs .NewIdentityManagerStub (client )
85- fmt .Println (stub .NodeID (ctx ))
87+ sk := ed25519 .PrivateKey (stub .PrivateKey (ctx ))
88+ pubKey := sk .Public ().(ed25519.PublicKey )
89+
90+ // fmt.Println(stub.NodeID(ctx))
91+ fmt .Println (base64 .StdEncoding .EncodeToString (pubKey ))
8692
8793 os .Exit (0 )
8894 }
0 commit comments