@@ -2,6 +2,8 @@ package main
2
2
3
3
import (
4
4
"context"
5
+ "crypto/ed25519"
6
+ "encoding/base64"
5
7
"flag"
6
8
"fmt"
7
9
"os"
@@ -57,7 +59,7 @@ func main() {
57
59
flag .IntVar (& interval , "interval" , 600 , "interval in seconds between update checks, default to 600" )
58
60
flag .BoolVar (& ver , "v" , false , "show version and exit" )
59
61
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 " )
61
63
flag .BoolVar (& net , "net" , false , "prints the node network and exits" )
62
64
flag .BoolVar (& farm , "farm" , false , "prints the node farm id and exits" )
63
65
@@ -82,7 +84,11 @@ func main() {
82
84
log .Fatal ().Err (err ).Msg ("failed to connect to zbus" )
83
85
}
84
86
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 ))
86
92
87
93
os .Exit (0 )
88
94
}
0 commit comments