Skip to content

Commit c70a787

Browse files
committed
Add the non-native snapshots path to the StdRunNodeArgs
1 parent cafdd04 commit c70a787

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
@@ -1076,6 +1077,10 @@ stdLowLevelRunNodeArgsIO
10761077
ChainDB.updateSnapshotPolicyArgs srnSnapshotPolicyArgs
10771078
. ChainDB.updateQueryBatchSize srnQueryBatchSize
10781079
. ChainDB.updateTracer srnTraceChainDB
1080+
. maybe
1081+
id
1082+
(\fp -> ChainDB.enableNonNativeSnapshots (SomeHasFS $ ioHasFS $ MountPoint fp))
1083+
srnNonNativeSnapshotsPath
10791084
. ( if not srnChainDbValidateOverride
10801085
then id
10811086
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
@@ -261,6 +262,10 @@ enableLedgerEvents args =
261262
}
262263
}
263264

265+
enableNonNativeSnapshots :: SomeHasFS m -> ChainDbArgs f m blk -> ChainDbArgs f m blk
266+
enableNonNativeSnapshots shfs args =
267+
args{cdbLgrDbArgs = (cdbLgrDbArgs args){LedgerDB.lgrNonNativeSnapshotsFS = Just shfs}}
268+
264269
{-------------------------------------------------------------------------------
265270
Relative mount points
266271
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)