API add get state

This commit is contained in:
laisolizq
2020-11-06 15:28:17 +01:00
parent 220fd992c5
commit cc6446e019
6 changed files with 234 additions and 9 deletions

View File

@@ -1482,3 +1482,9 @@ func (hdb *HistoryDB) GetAccountsAPI(tokenIDs []common.TokenID, ethAddr *ethComm
LastItem: accounts[0].LastItem,
}, nil
}
// GetMetrics returns metrics
func (hdb *HistoryDB) GetMetrics() (Metrics, error) {
metrics := Metrics{}
return metrics, nil
}

View File

@@ -298,14 +298,6 @@ type BatchAPI struct {
LastItem uint64 `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 []CoordinatorAPI `json:"nextForgers"`
}
// Metrics define metrics of the network
type Metrics struct {
TransactionsPerBatch float64 `json:"transactionsPerBatch"`