Merge pull request #267 from hermeznetwork/feature/api-state

API add get state
This commit is contained in:
a_bennassar
2020-11-09 14:13:01 +01:00
committed by GitHub
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"`