mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-20 09:50:28 +00:00
output DB version in info command
This commit is contained in:
@ -23,5 +23,18 @@ void cmd_info(const std::vector<std::string> &subArgs) {
|
|||||||
|
|
||||||
auto txn = env.txn_ro();
|
auto txn = env.txn_ro();
|
||||||
|
|
||||||
|
uint64_t dbVersion;
|
||||||
|
|
||||||
|
{
|
||||||
|
auto s = env.lookup_Meta(txn, 1);
|
||||||
|
|
||||||
|
if (s) {
|
||||||
|
dbVersion = s->dbVersion();
|
||||||
|
} else {
|
||||||
|
dbVersion = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "DB version: " << dbVersion << "\n";
|
||||||
std::cout << "merkle root: " << to_hex(qdb.root(txn)) << "\n";
|
std::cout << "merkle root: " << to_hex(qdb.root(txn)) << "\n";
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
const uint64_t CURR_DB_VERSION = 1;
|
||||||
const size_t MAX_SUBID_SIZE = 71; // Statically allocated size in SubId
|
const size_t MAX_SUBID_SIZE = 71; // Statically allocated size in SubId
|
||||||
const uint64_t MAX_TIMESTAMP = 17179869184; // Safety limit to ensure it can fit in quadrable key. Good until year 2514.
|
const uint64_t MAX_TIMESTAMP = 17179869184; // Safety limit to ensure it can fit in quadrable key. Good until year 2514.
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
#include "golpe.h"
|
#include "golpe.h"
|
||||||
|
|
||||||
const size_t CURR_DB_VERSION = 1;
|
#include "constants.h"
|
||||||
|
|
||||||
|
|
||||||
static void dbCheck(lmdb::txn &txn, const std::string &cmd) {
|
static void dbCheck(lmdb::txn &txn, const std::string &cmd) {
|
||||||
auto dbTooOld = [&](uint64_t ver) {
|
auto dbTooOld = [&](uint64_t ver) {
|
||||||
|
Reference in New Issue
Block a user