Skip to content

Commit

Permalink
Add recursive check back
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Apr 19, 2024
1 parent ec214a8 commit 3eede8c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/client/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,17 +487,23 @@ function initDBs(config: Config): {
} {
// Chain DB
const chainDataDir = config.getDataDirectory(DataDirectory.Chain)
mkdirSync(chainDataDir)
mkdirSync(chainDataDir, {
recursive: true,
})
const chainDB = new Level<string | Uint8Array, string | Uint8Array>(chainDataDir)

// State DB
const stateDataDir = config.getDataDirectory(DataDirectory.State)
mkdirSync(stateDataDir)
mkdirSync(stateDataDir, {
recursive: true,
})
const stateDB = new Level<string | Uint8Array, string | Uint8Array>(stateDataDir)

// Meta DB (receipts, logs, indexes, skeleton chain)
const metaDataDir = config.getDataDirectory(DataDirectory.Meta)
mkdirSync(metaDataDir)
mkdirSync(metaDataDir, {
recursive: true,
})
const metaDB = new Level<string | Uint8Array, string | Uint8Array>(metaDataDir)

return { chainDB, stateDB, metaDB }
Expand Down Expand Up @@ -1010,7 +1016,9 @@ async function run() {
const datadir = args.dataDir ?? Config.DATADIR_DEFAULT
const networkDir = `${datadir}/${common.chainName()}`
const configDirectory = `${networkDir}/config`
mkdirSync(configDirectory)
mkdirSync(configDirectory, {
recursive: true,
})
const key = await Config.getClientKey(datadir, common)

// logFile is either filename or boolean true or false to enable (with default) or disable
Expand Down

0 comments on commit 3eede8c

Please sign in to comment.