Skip to content

Commit d8cb40c

Browse files
committed
send logs of the node with pubkey instead of accountid
Signed-off-by: Ashraf Fouda <ashraf.m.fouda@gmail.com>
1 parent 0bbd7fa commit d8cb40c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cmds/identityd/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package main
22

33
import (
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
}

pkg/stubs/registrar-gateway.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ package stubs
66

77
import (
88
"context"
9+
"time"
10+
911
types1 "github.com/centrifuge/go-substrate-rpc-client/v4/types"
1012
tfchainclientgo "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
1113
zbus "github.com/threefoldtech/zbus"
1214
types "github.com/threefoldtech/zos4/pkg/types"
1315
pkg "github.com/threefoldtech/zosbase/pkg"
14-
"time"
1516
)
1617

1718
type RegistrarGatewayStub struct {

0 commit comments

Comments
 (0)