mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
wip
This commit is contained in:
@@ -71,7 +71,7 @@ type NodeInfo struct {
|
||||
func (hdb *HistoryDB) GetNodeInfo() (*NodeInfo, error) {
|
||||
ni := &NodeInfo{}
|
||||
err := meddler.QueryRow(
|
||||
hdb.dbRead, ni, `SELECT * FROM node_info WHERE;`,
|
||||
hdb.dbRead, ni, `SELECT * FROM node_info ORDER BY item_id DESC LIMIT 1;`,
|
||||
)
|
||||
return ni, tracerr.Wrap(err)
|
||||
}
|
||||
@@ -354,7 +354,7 @@ func (hdb *HistoryDB) UpdateMetrics() error {
|
||||
txn, p, `SELECT
|
||||
COALESCE (MIN(batch.batch_num), 0) as from_batch_num,
|
||||
COALESCE (MIN(block.timestamp), NOW()) AS from_timestamp,
|
||||
COALESCE (MAX(block.timestamp), NOW()) AS to_timestamp,
|
||||
COALESCE (MAX(block.timestamp), NOW()) AS to_timestamp
|
||||
FROM batch INNER JOIN block ON batch.eth_block_num = block.eth_block_num
|
||||
WHERE block.timestamp >= NOW() - INTERVAL '24 HOURS';`,
|
||||
); err != nil {
|
||||
|
||||
@@ -662,11 +662,12 @@ CREATE TABLE account_creation_auth (
|
||||
);
|
||||
|
||||
CREATE TABLE node_info (
|
||||
item_id SERIAL PRIMARY KEY,
|
||||
state BYTEA, -- object returned by GET /state
|
||||
pool_max_txs BIGINT, -- L2DB config
|
||||
max_pool_txs BIGINT, -- L2DB config
|
||||
min_fee NUMERIC, -- L2DB config
|
||||
constants BYTEA -- info of the network that is constant
|
||||
)
|
||||
constants BYTEA -- info of the network that is constant
|
||||
);
|
||||
|
||||
-- +migrate Down
|
||||
-- triggers
|
||||
|
||||
Reference in New Issue
Block a user