Mise à jour de GitLab prévue ce samedi 23 octobre 2021 à partir de 9h00 CET

Commit 7a401afb authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Gather LevelDB data into a new `data/` dir

parent b4f82f2c
......@@ -118,7 +118,7 @@ export const MemFS = (initialTree:{ [folder:string]: { [file:string]: string }}
export const Directory = {
DATA_FILES: ['mindex.db', 'c_mindex.db', 'iindex.db', 'cindex.db', 'sindex.db', 'wallet.db', 'dividend.db', 'txs.db', 'peers.db'],
DATA_DIRS: ['level_dividend', 'level_bindex', 'level_blockchain', 'level_sindex', 'level_cindex', 'level_iindex', 'level_mindex', 'level_wallet'],
DATA_DIRS: ['data'],
INSTANCE_NAME: getDomain(opts.mdb),
INSTANCE_HOME: getHomePath(opts.mdb, opts.home),
......@@ -145,7 +145,9 @@ export const Directory = {
return LevelDBDriver.newMemoryInstance()
// Or file
const levelDBPath = path.join(home || Directory.INSTANCE_HOME, dbName)
const levelDbRootPath = path.join(home, 'data', 'leveldb')
await RealFS().fsMakeDirectory(levelDbRootPath)
const levelDBPath = path.join(levelDbRootPath, dbName)
return LevelDBDriver.newFileInstance(levelDBPath)
......@@ -453,7 +453,8 @@ export class Server extends stream.Duplex implements HookableServer {
await this.dal.cleanCaches();
const files = ['stats', 'cores', 'current', Directory.DUNITER_DB_NAME, Directory.DUNITER_DB_NAME + '.db', Directory.DUNITER_DB_NAME + '.log'];
const dirs = ['loki', 'blocks', 'ud_history', 'branches', 'certs', 'txs', 'cores', 'sources', 'links', 'ms', 'identities', 'peers', 'indicators', 'leveldb'];
const dirs = ['loki', 'blocks', 'ud_history', 'branches', 'certs', 'txs', 'cores', 'sources', 'links', 'ms', 'identities', 'peers', 'indicators', 'leveldb']
return this.resetFiles(files, dirs);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment