mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
node info should show worker counts
This commit is contained in:
parent
c9be69ba28
commit
61179c13a0
@ -988,3 +988,14 @@ func (e *DataClockConsensusEngine) createParallelDataClientsFromBaseMultiaddr(
|
||||
)
|
||||
return clients, nil
|
||||
}
|
||||
|
||||
func (e *DataClockConsensusEngine) GetWorkerCount() uint32 {
|
||||
count := uint32(0)
|
||||
for _, client := range e.clients {
|
||||
if client != nil {
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
return count
|
||||
}
|
||||
|
||||
@ -20,4 +20,5 @@ type ExecutionEngine interface {
|
||||
GetSeniority() *big.Int
|
||||
GetRingPosition() int
|
||||
AnnounceProverJoin()
|
||||
GetWorkerCount() uint32
|
||||
}
|
||||
|
||||
@ -1540,3 +1540,7 @@ func (e *TokenExecutionEngine) getAddressFromSignature(
|
||||
|
||||
return altAddr.FillBytes(make([]byte, 32)), nil
|
||||
}
|
||||
|
||||
func (e *TokenExecutionEngine) GetWorkerCount() uint32 {
|
||||
return e.clock.GetWorkerCount()
|
||||
}
|
||||
|
||||
@ -1275,5 +1275,6 @@ func printNodeInfo(cfg *config.Config) {
|
||||
fmt.Println("Seniority: " + new(big.Int).SetBytes(
|
||||
nodeInfo.PeerSeniority,
|
||||
).String())
|
||||
fmt.Println("Active Workers:", nodeInfo.Workers)
|
||||
printBalance(cfg)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -63,6 +63,7 @@ message NodeInfoResponse {
|
||||
bytes version = 4;
|
||||
bytes peer_seniority = 5;
|
||||
int32 prover_ring = 6;
|
||||
uint32 workers = 7;
|
||||
}
|
||||
|
||||
message PutPeerInfoRequest {
|
||||
|
||||
@ -184,6 +184,7 @@ func (r *RPCServer) GetNodeInfo(
|
||||
),
|
||||
PeerSeniority: seniority.FillBytes(make([]byte, 32)),
|
||||
ProverRing: int32(ring),
|
||||
Workers: r.executionEngines[0].GetWorkerCount(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user