Skip to content

Commit a1522c5

Browse files
Merge branch 'master' into edgr/ux-topology-config-file
2 parents d0da45e + a3e6d88 commit a1522c5

File tree

8 files changed

+16
-23
lines changed

8 files changed

+16
-23
lines changed

cardano-testnet/src/Parsers/Run.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,11 @@ runCardanoOptions CardanoTestnetCliOptions
8787
createTestnetEnv
8888
testnetOptions genesisOptions def
8989
conf
90-
cardanoTestnet testnetOptions genesisOptions conf
90+
cardanoTestnet testnetOptions conf
9191
UserProvidedEnv nodeEnvPath ->
9292
-- Run cardano-testnet in the sandbox provided by the user
9393
-- In that case, 'cardanoOutputDir' is not used
9494
runTestnet (UserProvidedEnv nodeEnvPath) $ \conf ->
9595
cardanoTestnet
9696
testnetOptions
97-
genesisOptions
9897
conf{updateTimestamps=updateTimestamps}

cardano-testnet/src/Testnet/Start/Cardano.hs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,10 @@ createTestnetEnv
208208
cardanoTestnet :: ()
209209
=> HasCallStack
210210
=> CardanoTestnetOptions -- ^ The options to use
211-
-> GenesisOptions
212211
-> Conf -- ^ Path to the test sandbox
213212
-> H.Integration TestnetRuntime
214213
cardanoTestnet
215214
testnetOptions
216-
GenesisOptions{genesisTestnetMagic=testnetMagic}
217215
Conf
218216
{ tempAbsPath=TmpAbsolutePath tmpAbsPath
219217
, updateTimestamps
@@ -225,9 +223,14 @@ cardanoTestnet
225223
} = testnetOptions
226224
nPools = cardanoNumPools testnetOptions
227225
nodeConfigFile = tmpAbsPath </> "configuration.yaml"
226+
byronGenesisFile = tmpAbsPath </> "byron-genesis.json"
227+
shelleyGenesisFile = tmpAbsPath </> "shelley-genesis.json"
228228

229229
H.note_ OS.os
230230

231+
shelleyGenesis@ShelleyGenesis{sgNetworkMagic} <- H.readJsonFileOk shelleyGenesisFile
232+
let testnetMagic :: Int = fromIntegral sgNetworkMagic
233+
231234
wallets <- forM [1..3] $ \idx -> do
232235
let utxoKeys@KeyPair{verificationKey} = makePathsAbsolute $ Defaults.defaultUtxoKeys idx
233236
let paymentAddrFile = tmpAbsPath </> "utxo-keys" </> "utxo" <> show idx </> "utxo.addr"
@@ -306,9 +309,6 @@ cardanoTestnet
306309
-- This is a QoL feature so that users who edit their configuration files don't
307310
-- have to manually set up the start times themselves.
308311
when (updateTimestamps == UpdateTimestamps) $ do
309-
let byronGenesisFile = tmpAbsPath </> "byron-genesis.json"
310-
shelleyGenesisFile = tmpAbsPath </> "shelley-genesis.json"
311-
312312
currentTime <- H.noteShowIO DTC.getCurrentTime
313313
startTime <- H.noteShow $ DTC.addUTCTime startTimeOffsetSeconds currentTime
314314

@@ -318,11 +318,9 @@ cardanoTestnet
318318
let byronGenesis = byronGenesis'{gdStartTime = startTime}
319319
H.lbsWriteFile byronGenesisFile $ canonicalEncodePretty byronGenesis
320320

321-
-- Update start time in Shelley genesis file
322-
eShelley <- H.readJsonFile shelleyGenesisFile
323-
shelleyGenesis' :: ShelleyGenesis <- H.leftFail eShelley
324-
let shelleyGenesis = shelleyGenesis'{sgSystemStart = startTime}
325-
H.lbsWriteFile shelleyGenesisFile $ A.encodePretty shelleyGenesis
321+
-- Update start time in Shelley genesis file (which has been read already)
322+
let shelleyGenesis' = shelleyGenesis{sgSystemStart = startTime}
323+
H.lbsWriteFile shelleyGenesisFile $ A.encodePretty shelleyGenesis'
326324

327325
eTestnetNodes <- H.forConcurrently (zip [1..] portNumbersWithNodeOptions) $ \(i, (nodeOptions, port)) -> do
328326
let nodeName = Defaults.defaultNodeName i
@@ -426,7 +424,7 @@ createAndRunTestnet testnetOptions genesisOptions conf = do
426424
createTestnetEnv
427425
testnetOptions genesisOptions def
428426
conf
429-
cardanoTestnet testnetOptions genesisOptions conf
427+
cardanoTestnet testnetOptions conf
430428

431429
-- | Retry an action when `NodeAddressAlreadyInUseError` gets thrown from an action
432430
retryOnAddressInUseError

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ hprop_dump_config = integrationRetryWorkspace 2 "dump-config-files" $ \tmpDir ->
6969
H.lbsWriteFile shelleyGenesisFile $ encodePretty shelleyGenesis
7070

7171
-- Run testnet with generated config
72-
runtime <- cardanoTestnet testnetOptions genesisOptions conf
72+
runtime <- cardanoTestnet testnetOptions conf
7373

7474
nodesProduceBlocks tmpDir runtime

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat
112112
, testnetNodes
113113
, wallets=wallet0:_wallet1:_
114114
, configurationFile
115-
} <- cardanoTestnet fastTestnetOptions genesisOptions conf
115+
} <- cardanoTestnet fastTestnetOptions conf
116116

117117
poolNode1 <- H.headM testnetNodes
118118
poolSprocket1 <- H.noteShow $ nodeSprocket poolNode1

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/MainnetParams.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ hprop_mainnet_params = integrationRetryWorkspace 2 "mainnet-params" $ \tmpDir ->
4545
TestnetRuntime
4646
{ testnetNodes
4747
, testnetMagic
48-
} <- cardanoTestnet testnetOptions genesisOptions conf
48+
} <- cardanoTestnet testnetOptions conf
4949

5050
-- Get a running node
5151
TestnetNode{nodeSprocket} <- H.headM testnetNodes

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/P2PTopology.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ hprop_p2p_topology = integrationRetryWorkspace 2 "p2p-topology" $ \tmpDir -> H.r
4343
(_topology :: P2P.NetworkTopology NodeId) <- H.leftFail eTopology
4444

4545
-- Run testnet with generated config
46-
runtime <- cardanoTestnet testnetOptions genesisOptions conf
46+
runtime <- cardanoTestnet testnetOptions conf
4747

4848
nodesProduceBlocks tmpDir runtime

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/UpdateTimeStamps.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ hprop_update_time_stamps = integrationRetryWorkspace 2 "update-time-stamps" $ \t
4545
H.threadDelay $ double2Int $ realToFrac startTimeOffsetSeconds * 1_000_000 * 1.2
4646

4747
-- Run testnet and specify to update time stamps before starting
48-
runtime <- cardanoTestnet
49-
testnetOptions
50-
genesisOptions
51-
conf{updateTimestamps = UpdateTimestamps}
48+
runtime <- cardanoTestnet testnetOptions conf{updateTimestamps = UpdateTimestamps}
5249

5350
nodesProduceBlocks tmpDir runtime

nix/docker/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ Note that once ledger state is converted, the cardano-node container will need
230230
to be run with a node configuration aligned with the new ledger state type,
231231
otherwise ledger replay from genesis will re-occur.
232232

233-
For more info, see the [UTxO Migration Guide](https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/utxo-hd/migrating/).
234-
233+
For more info, see the [UTxO Migration Guide](https://ouroboros-consensus.cardano.intersectmbo.org/docs/references/miscellaneous/utxo-hd/migrating/).
235234

236235
## Legacy Tracing System
237236
Cardano-node now defaults to using the new tracing system. The legacy tracing

0 commit comments

Comments
 (0)