@@ -227,8 +227,8 @@ proc cmdBench(conf: DbConf, cfg: RuntimeConfig) =
227227
228228 echo " Opening database..."
229229 let
230- db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
231- dbBenchmark = BeaconChainDB .new (" benchmark" )
230+ db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
231+ dbBenchmark = BeaconChainDB .new (" benchmark" , cfg )
232232 defer :
233233 db.close ()
234234 dbBenchmark.close ()
@@ -390,8 +390,8 @@ proc cmdBench(conf: DbConf, cfg: RuntimeConfig) =
390390 processBlocks (blocks[i])
391391 printTimers (false , timers)
392392
393- proc cmdDumpState (conf: DbConf ) =
394- let db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
393+ proc cmdDumpState (conf: DbConf , cfg: RuntimeConfig ) =
394+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
395395 defer : db.close ()
396396
397397 let
@@ -428,7 +428,7 @@ proc cmdDumpState(conf: DbConf) =
428428 echo " Couldn't load " , stateRoot
429429
430430proc cmdPutState (conf: DbConf , cfg: RuntimeConfig ) =
431- let db = BeaconChainDB .new (conf.databaseDir.string )
431+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg )
432432 defer : db.close ()
433433
434434 for file in conf.stateFile:
@@ -448,8 +448,8 @@ proc cmdPutState(conf: DbConf, cfg: RuntimeConfig) =
448448 withState (state[]):
449449 db.putState (forkyState)
450450
451- proc cmdDumpBlock (conf: DbConf ) =
452- let db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
451+ proc cmdDumpBlock (conf: DbConf , cfg: RuntimeConfig ) =
452+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
453453 defer : db.close ()
454454
455455 for blockRoot in conf.blockRootx:
@@ -469,7 +469,7 @@ proc cmdDumpBlock(conf: DbConf) =
469469 echo " Couldn't load " , blockRoot, " : " , e.msg
470470
471471proc cmdPutBlock (conf: DbConf , cfg: RuntimeConfig ) =
472- let db = BeaconChainDB .new (conf.databaseDir.string )
472+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg )
473473 defer : db.close ()
474474
475475 for file in conf.blckFile:
@@ -521,7 +521,7 @@ proc cmdPutBlob(conf: DbConf, cfg: RuntimeConfig) =
521521
522522proc cmdRewindState (conf: DbConf , cfg: RuntimeConfig ) =
523523 echo " Opening database..."
524- let db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
524+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
525525 defer : db.close ()
526526
527527 if (let v = ChainDAGRef .isInitialized (db); v.isErr ()):
@@ -557,7 +557,7 @@ proc cmdVerifyEra(conf: DbConf, cfg: RuntimeConfig) =
557557 echo root
558558
559559proc cmdExportEra (conf: DbConf , cfg: RuntimeConfig ) =
560- let db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
560+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
561561 defer : db.close ()
562562
563563 if (let v = ChainDAGRef .isInitialized (db); v.isErr ()):
@@ -676,7 +676,7 @@ proc cmdExportEra(conf: DbConf, cfg: RuntimeConfig) =
676676 quit QuitFailure
677677
678678proc cmdImportEra (conf: DbConf , cfg: RuntimeConfig ) =
679- let db = BeaconChainDB .new (conf.databaseDir.string )
679+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg )
680680 defer : db.close ()
681681
682682 type Timers = enum
741741proc cmdValidatorPerf (conf: DbConf , cfg: RuntimeConfig ) =
742742 echo " Opening database..."
743743 let
744- db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
744+ db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
745745 defer :
746746 db.close ()
747747
@@ -978,7 +978,7 @@ proc insertValidators(db: SqStoreRef, state: ForkedHashedBeaconState,
978978proc cmdValidatorDb (conf: DbConf , cfg: RuntimeConfig ) =
979979 # Create a database with performance information for every epoch
980980 info " Opening database..."
981- let db = BeaconChainDB .new (conf.databaseDir.string , readOnly = true )
981+ let db = BeaconChainDB .new (conf.databaseDir.string , cfg, readOnly = true )
982982 defer : db.close ()
983983
984984 if (let v = ChainDAGRef .isInitialized (db); v.isErr ()):
@@ -1214,11 +1214,11 @@ when isMainModule:
12141214 of DbCmd .bench:
12151215 cmdBench (conf, cfg)
12161216 of DbCmd .dumpState:
1217- cmdDumpState (conf)
1217+ cmdDumpState (conf, cfg )
12181218 of DbCmd .putState:
12191219 cmdPutState (conf, cfg)
12201220 of DbCmd .dumpBlock:
1221- cmdDumpBlock (conf)
1221+ cmdDumpBlock (conf, cfg )
12221222 of DbCmd .putBlock:
12231223 cmdPutBlock (conf, cfg)
12241224 of DbCmd .putBlob:
0 commit comments