Skip to content

Commit d6e0b35

Browse files
committed
Add the non-native snapshots path to the StdRunNodeArgs
1 parent 8e75c2e commit d6e0b35

File tree

2 files changed

+10
-0
lines changed
  • ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl

2 files changed

+10
-0
lines changed

ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ data
359359
, srnChainDbValidateOverride :: Bool
360360
-- ^ If @True@, validate the ChainDB on init no matter what
361361
, srnDatabasePath :: NodeDatabasePaths
362+
, srnNonNativeSnapshotsPath :: Maybe FilePath
362363
-- ^ Location of the DBs
363364
, srnDiffusionArguments :: Cardano.Diffusion.CardanoNodeArguments m
364365
, srnDiffusionConfiguration :: Cardano.Diffusion.CardanoConfiguration m
@@ -1062,6 +1063,10 @@ stdLowLevelRunNodeArgsIO
10621063
ChainDB.updateSnapshotPolicyArgs srnSnapshotPolicyArgs
10631064
. ChainDB.updateQueryBatchSize srnQueryBatchSize
10641065
. ChainDB.updateTracer srnTraceChainDB
1066+
. maybe
1067+
id
1068+
(\fp -> ChainDB.enableNonNativeSnapshots (SomeHasFS $ ioHasFS $ MountPoint fp))
1069+
srnNonNativeSnapshotsPath
10651070
. ( if not srnChainDbValidateOverride
10661071
then id
10671072
else ChainDB.ensureValidateAll

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Args.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module Ouroboros.Consensus.Storage.ChainDB.Impl.Args
1313
, completeChainDbArgs
1414
, defaultArgs
1515
, enableLedgerEvents
16+
, enableNonNativeSnapshots
1617
, ensureValidateAll
1718
, updateQueryBatchSize
1819
, updateSnapshotPolicyArgs
@@ -263,6 +264,10 @@ enableLedgerEvents args =
263264
}
264265
}
265266

267+
enableNonNativeSnapshots :: SomeHasFS m -> ChainDbArgs f m blk -> ChainDbArgs f m blk
268+
enableNonNativeSnapshots shfs args =
269+
args{cdbLgrDbArgs = (cdbLgrDbArgs args){LedgerDB.lgrNonNativeSnapshotsFS = Just shfs}}
270+
266271
{-------------------------------------------------------------------------------
267272
Relative mount points
268273
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)