Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public constructor(dbPath: string) {
// Make sure that the DB directory exists.
const directory = path.dirname(dbPath);
mkdirp.sync(directory);
// Open/create the blocks LevelDB database.
this.db = levelup.default(leveldown(dbPath));
}
constructor(engineHomeDir: string) {
this.rulesetDir = path.resolve(engineHomeDir, "rulesets");
this.db = level(
encode(leveldown(path.resolve(engineHomeDir, "rulesets-db")), {
keyEncoding: charwise,
valueEncoding: safeJsonCodec
})
);
}