Set peer id event as string in lotus trace event

This commit is contained in:
Matija Petrunic 2021-09-17 12:11:14 +02:00
parent dc79ea363d
commit a91ffa60d6

View File

@ -29,7 +29,7 @@ const (
type LotusTraceEvent struct { type LotusTraceEvent struct {
Type pubsub_pb.TraceEvent_Type `json:"type,omitempty"` Type pubsub_pb.TraceEvent_Type `json:"type,omitempty"`
PeerID []byte `json:"peerID,omitempty"` PeerID string `json:"peerID,omitempty"`
Timestamp *int64 `json:"timestamp,omitempty"` Timestamp *int64 `json:"timestamp,omitempty"`
PeerScores *TraceEvent_PeerScores `json:"peerScores,omitempty"` PeerScores *TraceEvent_PeerScores `json:"peerScores,omitempty"`
} }
@ -49,7 +49,7 @@ func (lt *lotusTracer) PeerScores(scores map[peer.ID]*pubsub.PeerScoreSnapshot)
now := time.Now().UnixNano() now := time.Now().UnixNano()
evt := &LotusTraceEvent{ evt := &LotusTraceEvent{
Type: *TraceEvent_PEER_SCORES.Enum(), Type: *TraceEvent_PEER_SCORES.Enum(),
PeerID: []byte(lt.pid), PeerID: string(lt.pid),
Timestamp: &now, Timestamp: &now,
PeerScores: &TraceEvent_PeerScores{ PeerScores: &TraceEvent_PeerScores{
Scores: scores, Scores: scores,