diff --git a/cmd/client/wallet/main.go b/cmd/client/wallet/main.go index f7c8f621a..6b6975022 100644 --- a/cmd/client/wallet/main.go +++ b/cmd/client/wallet/main.go @@ -296,7 +296,11 @@ func CreateWalletNode() *node.Node { response := bcClient.GetLeaders() for _, leader := range response.Leaders { - shardIDLeaderMap[leader.ShardId] = p2p.Peer{IP: leader.Ip, Port: leader.Port, PeerID: peer.ID(leader.PeerID)} + peerID, err := peer.IDB58Decode(leader.PeerID) + if err != nil { + panic(err) + } + shardIDLeaderMap[leader.ShardId] = p2p.Peer{IP: leader.Ip, Port: leader.Port, PeerID: peerID} } // dummy host for wallet diff --git a/internal/beaconchain/rpc/server.go b/internal/beaconchain/rpc/server.go index 38cf13c4f..4542918f8 100644 --- a/internal/beaconchain/rpc/server.go +++ b/internal/beaconchain/rpc/server.go @@ -23,7 +23,7 @@ func (s *Server) FetchLeaders(ctx context.Context, request *proto.FetchLeadersRe leaders := []*proto.FetchLeadersResponse_Leader{} for shardID, leader := range s.shardLeaderMap() { - leaders = append(leaders, &proto.FetchLeadersResponse_Leader{Ip: leader.IP, Port: leader.Port, ShardId: uint32(shardID), PeerID: string(leader.PeerID)}) + leaders = append(leaders, &proto.FetchLeadersResponse_Leader{Ip: leader.IP, Port: leader.Port, ShardId: uint32(shardID), PeerID: leader.PeerID.Pretty()}) } log.Println(leaders) return &proto.FetchLeadersResponse{Leaders: leaders}, nil