proto: add boot_timestamp to Heartbeat
Allows for precise uptime calculation. Change-Id: I57d022ec10a56df57a4a1f79ae892eb8899f7154
This commit is contained in:
parent
c7662d611e
commit
61a90136ca
|
@ -176,6 +176,8 @@ func Run(obsvC chan *gossipv1.SignedObservation, sendC chan []byte, rawHeartbeat
|
|||
logger.Info("Node has been started", zap.String("peer_id", h.ID().String()),
|
||||
zap.String("addrs", fmt.Sprintf("%v", h.Addrs())))
|
||||
|
||||
bootTime := time.Now()
|
||||
|
||||
go func() {
|
||||
ctr := int64(0)
|
||||
tick := time.NewTicker(15 * time.Second)
|
||||
|
@ -193,12 +195,13 @@ func Run(obsvC chan *gossipv1.SignedObservation, sendC chan []byte, rawHeartbeat
|
|||
}
|
||||
|
||||
heartbeat := &gossipv1.Heartbeat{
|
||||
NodeName: nodeName,
|
||||
Counter: ctr,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Networks: networks,
|
||||
Version: version.Version(),
|
||||
GuardianAddr: DefaultRegistry.guardianAddress,
|
||||
NodeName: nodeName,
|
||||
Counter: ctr,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Networks: networks,
|
||||
Version: version.Version(),
|
||||
GuardianAddr: DefaultRegistry.guardianAddress,
|
||||
BootTimestamp: bootTime.UnixNano(),
|
||||
}
|
||||
|
||||
ourAddr := ethcrypto.PubkeyToAddress(gk.PublicKey)
|
||||
|
|
|
@ -50,6 +50,9 @@ message Heartbeat {
|
|||
|
||||
// Human-readable representation of the guardian key's address.
|
||||
string guardian_addr = 6;
|
||||
|
||||
// UNIX boot timestamp.
|
||||
int64 boot_timestamp = 7;
|
||||
}
|
||||
|
||||
// A SignedObservation is a signed statement by a given guardian node
|
||||
|
|
Loading…
Reference in New Issue