Add struct get state endpoint

This commit is contained in:
laisolizq
2020-10-23 17:46:34 +02:00
parent d17cc57e1d
commit 82ee7c6aa7
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"`
}