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()),
|
logger.Info("Node has been started", zap.String("peer_id", h.ID().String()),
|
||||||
zap.String("addrs", fmt.Sprintf("%v", h.Addrs())))
|
zap.String("addrs", fmt.Sprintf("%v", h.Addrs())))
|
||||||
|
|
||||||
|
bootTime := time.Now()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
ctr := int64(0)
|
ctr := int64(0)
|
||||||
tick := time.NewTicker(15 * time.Second)
|
tick := time.NewTicker(15 * time.Second)
|
||||||
|
@ -199,6 +201,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, sendC chan []byte, rawHeartbeat
|
||||||
Networks: networks,
|
Networks: networks,
|
||||||
Version: version.Version(),
|
Version: version.Version(),
|
||||||
GuardianAddr: DefaultRegistry.guardianAddress,
|
GuardianAddr: DefaultRegistry.guardianAddress,
|
||||||
|
BootTimestamp: bootTime.UnixNano(),
|
||||||
}
|
}
|
||||||
|
|
||||||
ourAddr := ethcrypto.PubkeyToAddress(gk.PublicKey)
|
ourAddr := ethcrypto.PubkeyToAddress(gk.PublicKey)
|
||||||
|
|
|
@ -50,6 +50,9 @@ message Heartbeat {
|
||||||
|
|
||||||
// Human-readable representation of the guardian key's address.
|
// Human-readable representation of the guardian key's address.
|
||||||
string guardian_addr = 6;
|
string guardian_addr = 6;
|
||||||
|
|
||||||
|
// UNIX boot timestamp.
|
||||||
|
int64 boot_timestamp = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A SignedObservation is a signed statement by a given guardian node
|
// A SignedObservation is a signed statement by a given guardian node
|
||||||
|
|
Loading…
Reference in New Issue