@@ -100,7 +100,7 @@ cardanoTestnetDefault testnetOptions shelleyOptions conf = do
100
100
AnyShelleyBasedEra sbe <- pure cardanoNodeEra
101
101
alonzoGenesis <- getDefaultAlonzoGenesis sbe
102
102
shelleyGenesis <- getDefaultShelleyGenesis cardanoNodeEra cardanoMaxSupply shelleyOptions
103
- cardanoTestnet testnetOptions conf shelleyGenesis alonzoGenesis Defaults. defaultConwayGenesis
103
+ cardanoTestnet testnetOptions conf UserNodeConfigNotSubmitted shelleyGenesis alonzoGenesis Defaults. defaultConwayGenesis
104
104
where
105
105
CardanoTestnetOptions {cardanoNodeEra, cardanoMaxSupply} = testnetOptions
106
106
@@ -194,13 +194,14 @@ cardanoTestnet :: ()
194
194
=> HasCallStack
195
195
=> CardanoTestnetOptions -- ^ The options to use
196
196
-> Conf
197
+ -> UserNodeConfig -- ^ The node configuration file to use. If omitted it's generated.
197
198
-> ShelleyGenesis StandardCrypto -- ^ The shelley genesis to use, for example 'getDefaultShelleyGenesis' from this module.
198
199
-- Some fields are overridden by the accompanying 'CardanoTestnetOptions'.
199
200
-> AlonzoGenesis -- ^ The alonzo genesis to use, for example 'getDefaultAlonzoGenesis' from this module.
200
201
-> ConwayGenesis StandardCrypto -- ^ The conway genesis to use, for example 'Defaults.defaultConwayGenesis'.
201
202
-> H. Integration TestnetRuntime
202
203
cardanoTestnet
203
- testnetOptions Conf {tempAbsPath= TmpAbsolutePath tmpAbsPath}
204
+ testnetOptions Conf {tempAbsPath= TmpAbsolutePath tmpAbsPath} mNodeConfigFile
204
205
shelleyGenesis alonzoGenesis conwayGenesis = do
205
206
let CardanoTestnetOptions
206
207
{ cardanoNodeEra= asbe
@@ -232,8 +233,6 @@ cardanoTestnet
232
233
writeGenesisSpecFile " alonzo" alonzoGenesis
233
234
writeGenesisSpecFile " conway" conwayGenesis
234
235
235
- configurationFile <- H. noteShow . File $ tmpAbsPath </> " configuration.yaml"
236
-
237
236
_ <- createSPOGenesisAndFiles nPools nDReps maxSupply asbe shelleyGenesis alonzoGenesis conwayGenesis (TmpAbsolutePath tmpAbsPath)
238
237
239
238
-- TODO: This should come from the configuration!
@@ -272,12 +271,18 @@ cardanoTestnet
272
271
}
273
272
}
274
273
275
- -- Add Byron, Shelley and Alonzo genesis hashes to node configuration
276
- config <- createConfigJson (TmpAbsolutePath tmpAbsPath) sbe
277
- H. evalIO $ LBS. writeFile (unFile configurationFile) config
274
+ nodeConfigFile <- case mNodeConfigFile of
275
+ UserNodeConfigNotSubmitted -> do
276
+ configurationFile <- H. noteShow $ tmpAbsPath </> " configuration.yaml"
277
+ -- Add Byron, Shelley and Alonzo genesis hashes to node configuration
278
+ config <- createConfigJson (TmpAbsolutePath tmpAbsPath) sbe
279
+ H. evalIO $ LBS. writeFile configurationFile config
280
+ return configurationFile
281
+ UserNodeConfig userSubmittedNodeConfigFile -> pure userSubmittedNodeConfigFile
282
+
278
283
execCli_
279
284
[ " debug" , " check-node-configuration"
280
- , " --node-configuration-file" , unFile configurationFile
285
+ , " --node-configuration-file" , nodeConfigFile
281
286
]
282
287
283
288
portNumbersWithNodeOptions <- forM cardanoNodes $ \ nodeOption -> (nodeOption,) <$> H. randomPort testnetDefaultIpv4Address
@@ -324,7 +329,7 @@ cardanoTestnet
324
329
eRuntime <- runExceptT . retryOnAddressInUseError $
325
330
startNode (TmpAbsolutePath tmpAbsPath) nodeName testnetDefaultIpv4Address port testnetMagic $
326
331
[ " run"
327
- , " --config" , unFile configurationFile
332
+ , " --config" , nodeConfigFile
328
333
, " --topology" , nodeDataDir </> " topology.json"
329
334
, " --database-path" , nodeDataDir </> " db"
330
335
]
@@ -352,7 +357,7 @@ cardanoTestnet
352
357
H. cat . verificationKeyFp $ paymentKeyInfoPair wallet
353
358
354
359
let runtime = TestnetRuntime
355
- { configurationFile
360
+ { configurationFile = File nodeConfigFile
356
361
, shelleyGenesisFile = tmpAbsPath </> Defaults. defaultGenesisFilepath ShelleyEra
357
362
, testnetMagic
358
363
, testnetNodes= testnetNodes'
0 commit comments