Merge pull request #229 from hermeznetwork/feature/api-getstate

Add struct get state endpoint
This commit is contained in:
a_bennassar
2020-10-27 12:30:40 +01:00
committed by GitHub
7 changed files with 292 additions and 151 deletions

View File

@@ -154,3 +154,21 @@ type BatchAPI struct {
FirstItem int `json:"-" meddler:"first_item"`
LastItem int `json:"-" meddler:"last_item"`
}
// Network define status of the network
type Network struct {
LastBlock int64 `json:"lastBlock"`
LastBatch BatchAPI `json:"lastBatch"`
CurrentSlot int64 `json:"currentSlot"`
NextForgers []HistoryCoordinator `json:"nextForgers"`
}
// Metrics define metrics of the network
type Metrics struct {
TransactionsPerBatch float64 `json:"transactionsPerBatch"`
BatchFrequency float64 `json:"batchFrequency"`
TransactionsPerSecond float64 `json:"transactionsPerSecond"`
TotalAccounts int64 `json:"totalAccounts"`
TotalBJJs int64 `json:"totalBJJs"`
AvgTransactionFee float64 `json:"avgTransactionFee"`
}