From 128054613a19b1d36fe838eaa684299c92a95feb Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Wed, 7 Feb 2024 08:20:24 +0100 Subject: [PATCH 1/5] Release 8.20.0.0 --- cardano-cli/CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ cardano-cli/cardano-cli.cabal | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/cardano-cli/CHANGELOG.md b/cardano-cli/CHANGELOG.md index 73b95148fc..e274d5631d 100644 --- a/cardano-cli/CHANGELOG.md +++ b/cardano-cli/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog for cardano-cli +## 8.20.0.0 + +- - Bump CHaP in preparation for cardano-node 8.8 + - `--pool-retirement-epoch-boundary` updated to `--pool-retirement-epoch-interval` + (breaking) + [PR 529](https://github.com/IntersectMBO/cardano-cli/pull/529) + +- create-testnet-data: better UX for supply arguments: have a flag for total supply and delegated supply is a fraction of that. + (breaking) + [PR 581](https://github.com/IntersectMBO/cardano-cli/pull/581) + +- Provide more detailed error upon missing policy id + (improvement) + [PR 527](https://github.com/IntersectMBO/cardano-cli/pull/527) + +- Bump hedgehog-extras to 0.6.0.1 to benefit of this fix: https://github.com/input-output-hk/hedgehog-extras/pull/58 + (compatible, test, release) + [PR 589](https://github.com/IntersectMBO/cardano-cli/pull/589) + +- Avoid an internal crash of `create-testnet-data` + (compatible, bugfix) + [PR 588](https://github.com/IntersectMBO/cardano-cli/pull/588) + +- Update help for `drep-stake-distribution` and `drep-state` queries + (improvement, test) + [PR 585](https://github.com/IntersectMBO/cardano-cli/pull/585) + +- Improvements to --create-testnet-data + (compatible, test) + [PR 575](https://github.com/IntersectMBO/cardano-cli/pull/575) + +- Support signing with drep extended key + (feature, compatible) + [PR 556](https://github.com/IntersectMBO/cardano-cli/pull/556) + ## 8.19.0.0 - Update cardano-api 8.37.1 diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 50320620b9..5dc9e44bec 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -1,7 +1,7 @@ cabal-version: 3.4 name: cardano-cli -version: 8.19.0.0 +version: 8.20.0.0 synopsis: The Cardano command-line interface description: The Cardano command-line interface. copyright: 2020-2023 Input Output Global Inc (IOG). From 2521721120ef874875bb28b8c75e010b29546dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Tue, 6 Feb 2024 10:34:11 +0100 Subject: [PATCH 2/5] Support signing transactions with extended committee keys --- cardano-cli/src/Cardano/CLI/Read.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 51dcd8eda4..d0e43a42ef 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -640,7 +640,9 @@ data SomeSigningWitness | ADRepSigningWitness (SigningKey DRepKey) | ADRepExtendedSigningWitness (SigningKey DRepExtendedKey) | ACommitteeColdSigningWitness (SigningKey CommitteeColdKey) + | ACommitteeColdExtendedSigningWitness (SigningKey CommitteeColdExtendedKey) | ACommitteeHotSigningWitness (SigningKey CommitteeHotKey) + | ACommitteeHotExtendedSigningWitness (SigningKey CommitteeHotExtendedKey) deriving Show @@ -677,7 +679,9 @@ categoriseSomeSigningWitness swsk = ADRepSigningWitness sk -> AShelleyKeyWitness (WitnessDRepKey sk) ADRepExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessDRepExtendedKey sk) ACommitteeColdSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeColdKey sk) + ACommitteeColdExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeColdExtendedKey sk) ACommitteeHotSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeHotKey sk) + ACommitteeHotExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeHotExtendedKey sk) data ReadWitnessSigningDataError = ReadWitnessSigningDataSigningKeyDecodeError !(FileError InputDecodeError) @@ -727,7 +731,9 @@ readWitnessSigningData (KeyWitnessSigningData skFile mbByronAddr) = do , FromSomeType (AsSigningKey AsDRepKey ) ADRepSigningWitness , FromSomeType (AsSigningKey AsDRepExtendedKey ) ADRepExtendedSigningWitness , FromSomeType (AsSigningKey AsCommitteeColdKey ) ACommitteeColdSigningWitness + , FromSomeType (AsSigningKey AsCommitteeColdExtendedKey ) ACommitteeColdExtendedSigningWitness , FromSomeType (AsSigningKey AsCommitteeHotKey ) ACommitteeHotSigningWitness + , FromSomeType (AsSigningKey AsCommitteeHotExtendedKey ) ACommitteeHotExtendedSigningWitness ] bech32FileTypes = From f472515f672b1e69379b7e9f4294076af92d8069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Tue, 6 Feb 2024 10:40:56 +0100 Subject: [PATCH 3/5] Signing with commmitee extended key: add test --- .../Test/Golden/Governance/Committee.hs | 40 +++++++++++++++++++ .../committee/tx.cold.extended.signed | 5 +++ .../committee/tx.hot.extended.signed | 5 +++ .../committee/cc.extended.cold.skey | 5 +++ .../governance/committee/cc.extended.hot.skey | 5 +++ 5 files changed, 60 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.cold.extended.signed create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.hot.extended.signed create mode 100644 cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.skey create mode 100644 cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.skey diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs index 59517e919c..841abdb6b9 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs @@ -181,3 +181,43 @@ hprop_golden_governanceUpdateCommittee = ] H.diffFileVsGoldenFile outFile goldenAnswerFile + +-- | Execute me with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden governance committee cold extended key signing/"'@ +hprop_golden_governance_committee_cold_extended_key_signing :: Property +hprop_golden_governance_committee_cold_extended_key_signing = + propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + skeyFile <- noteInputFile "test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.skey" + txBody <- noteInputFile "test/cardano-cli-golden/files/input/governance/drep/extended-key-signing/tx.body" + + outGold <- H.note "test/cardano-cli-golden/files/golden/governance/committee/tx.cold.extended.signed" + outFile <- H.noteTempFile tempDir "outFile" + + H.noteM_ $ execCardanoCLI + [ "conway", "transaction", "sign" + , "--tx-body-file", txBody + , "--signing-key-file", skeyFile + , "--out-file", outFile + ] + + H.diffFileVsGoldenFile outFile outGold + +-- | Execute me with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden governance committee hot extended key signing/"'@ +hprop_golden_governance_committee_hot_extended_key_signing :: Property +hprop_golden_governance_committee_hot_extended_key_signing = + propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + skeyFile <- noteInputFile "test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.skey" + txBody <- noteInputFile "test/cardano-cli-golden/files/input/governance/drep/extended-key-signing/tx.body" + + outGold <- H.note "test/cardano-cli-golden/files/golden/governance/committee/tx.hot.extended.signed" + outFile <- H.noteTempFile tempDir "outFile" + + H.noteM_ $ execCardanoCLI + [ "conway", "transaction", "sign" + , "--tx-body-file", txBody + , "--signing-key-file", skeyFile + , "--out-file", outFile + ] + + H.diffFileVsGoldenFile outFile outGold \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.cold.extended.signed b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.cold.extended.signed new file mode 100644 index 0000000000..1cc8732c79 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.cold.extended.signed @@ -0,0 +1,5 @@ +{ + "type": "Witnessed Tx ConwayEra", + "description": "Ledger Cddl Format", + "cborHex": "84a50081825820829e3fd4847f53f0291370fc900b24cc7c7cc4f69676bbed9ca6e281dae9d60a00018182581d6063a11787740d8c90b6d335eefb8bb2f9e23066a3340e8c89d31ed74e1a002b2d03021a000299bd031a010f14d904d901028184108200581c8f4fefcf28017a57b41517a67d56ef4c0dc04181a11d35178dd53f4c1a001e8480f6a100d90102818258200a9d35aa5299580a67b1e43a3a4b6d43ef29c94e56c51ce4c17e9a53c1d0f39a58400598eecd84e9467182b4b027d1d30f0ba54b84367042e805bd817644d5f7905bc5c27c99c4f403226c069d972c8e1ad9adfd1b4945345b65b339cdfa6ae46100f5f6" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.hot.extended.signed b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.hot.extended.signed new file mode 100644 index 0000000000..2e14c4b94b --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/tx.hot.extended.signed @@ -0,0 +1,5 @@ +{ + "type": "Witnessed Tx ConwayEra", + "description": "Ledger Cddl Format", + "cborHex": "84a50081825820829e3fd4847f53f0291370fc900b24cc7c7cc4f69676bbed9ca6e281dae9d60a00018182581d6063a11787740d8c90b6d335eefb8bb2f9e23066a3340e8c89d31ed74e1a002b2d03021a000299bd031a010f14d904d901028184108200581c8f4fefcf28017a57b41517a67d56ef4c0dc04181a11d35178dd53f4c1a001e8480f6a100d9010281825820f010c4332699c6ea1e43b427919860277169382d43d2969b28a110cfa08d955c584053eb4711d6cf2c9985c36e32d4bdfada2de85fc7c7ad1ac3a8ecb69843f5bc1897acca423934ac9596bf7eeb3e5ab33a43de895e17e786ae3e6df840e8097802f5f6" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.skey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.skey new file mode 100644 index 0000000000..37a2148b10 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.cold.skey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeColdExtendedSigningKey_ed25519_bip32", + "description": "Constitutional Committee Cold Extended Signing Key", + "cborHex": "5880c8b1f328da856c2b3a2534a2338de9a460a1034f02404e019b8925582c55b94724765b6ee5964393ba66f048f6d8b94e2395686af82a87f13ed4af4f7ee9beff0a9d35aa5299580a67b1e43a3a4b6d43ef29c94e56c51ce4c17e9a53c1d0f39aa7f68837c38ef680b2dc8f047581707a32f6fcade23d4e02177d389002484798" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.skey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.skey new file mode 100644 index 0000000000..5afd8346c1 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc.extended.hot.skey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeHotExtendedSigningKey_ed25519_bip32", + "description": "Constitutional Committee Hot Extended Signing Key", + "cborHex": "5880e87138d157d31374987c97c2d2b681f0f995734b70367a31ea87f8c3d382345415787fe9fc22d8363bc6826ba6ac9739225bbb6fc73f0005679a6313ef7e6b6af010c4332699c6ea1e43b427919860277169382d43d2969b28a110cfa08d955c4f178f20955541ce918a6a1352c32536f22677008f9f918d109663e4d2bdc084" +} From 773a650cd3e66ed28b6f5aae5ee05025f7f508de Mon Sep 17 00:00:00 2001 From: Carlos LopezDeLara Date: Thu, 1 Feb 2024 21:36:17 -0600 Subject: [PATCH 4/5] Update cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Clément Hurlin --- cardano-cli/src/Cardano/CLI/Environment.hs | 2 +- .../Cardano/CLI/EraBased/Commands/Genesis.hs | 4 +-- .../Cardano/CLI/EraBased/Options/Genesis.hs | 19 +++++++++---- .../CLI/EraBased/Run/CreateTestnetData.hs | 28 +++++++++++-------- .../Test/Golden/CreateTestnetData.hs | 27 ++++++++++++++---- .../cardano-cli-golden/files/golden/help.cli | 28 +++++-------------- .../allegra_genesis_create-testnet-data.cli | 10 ++----- .../alonzo_genesis_create-testnet-data.cli | 10 ++----- .../babbage_genesis_create-testnet-data.cli | 10 ++----- .../conway_genesis_create-testnet-data.cli | 10 ++----- .../latest_genesis_create-testnet-data.cli | 10 ++----- .../help/mary_genesis_create-testnet-data.cli | 10 ++----- .../shelley_genesis_create-testnet-data.cli | 10 ++----- 13 files changed, 83 insertions(+), 95 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/Environment.hs b/cardano-cli/src/Cardano/CLI/Environment.hs index f82ab99520..46d352f36c 100644 --- a/cardano-cli/src/Cardano/CLI/Environment.hs +++ b/cardano-cli/src/Cardano/CLI/Environment.hs @@ -92,4 +92,4 @@ getCardanoEra = do "conway" -> pure $ Just $ AnyCardanoEra ConwayEra unknown -> error $ "Unknown era: " <> unknown -- TODO improve error handling - Nothing -> pure Nothing + Nothing -> pure Nothing \ No newline at end of file diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs index 052a8b9810..b7d694ea54 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs @@ -93,7 +93,7 @@ data GenesisCreateTestNetDataCmdArgs = GenesisCreateTestNetDataCmdArgs , numUtxoKeys :: !Word -- ^ The number of UTxO credentials to create and write to disk. , totalSupply :: !(Maybe Lovelace) -- ^ The total number of Lovelace , delegatedSupply :: !(Maybe Lovelace) -- ^ The number of Lovelace being delegated - , networkId :: !NetworkId -- ^ The network ID to use. + , networkId :: !(Maybe NetworkId) -- ^ The network ID to use. Overrides the network id supplied in the spec file. , systemStart :: !(Maybe SystemStart) -- ^ The genesis start time. , outputDir :: !FilePath -- ^ Directory where to write credentials and files. } deriving Show @@ -156,4 +156,4 @@ renderGenesisCmds = \case GenesisAddr {} -> "genesis initial-addr" GenesisHashFile {} -> - "genesis hash" + "genesis hash" \ No newline at end of file diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs index fe93446d2c..f6acb69f6e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs @@ -89,7 +89,7 @@ pGenesisCmds envCli = ] , Just $ subParser "create-testnet-data" - $ Opt.info (pGenesisCreateTestNetData envCli) + $ Opt.info pGenesisCreateTestNetData $ Opt.progDesc $ mconcat [ "Create data to use for starting a testnet." @@ -199,8 +199,8 @@ pGenesisCreateStaked envCli = <*> pStuffedUtxoCount <*> Opt.optional pRelayJsonFp -pGenesisCreateTestNetData :: EnvCli -> Parser (GenesisCmds era) -pGenesisCreateTestNetData envCli = +pGenesisCreateTestNetData :: Parser (GenesisCmds era) +pGenesisCreateTestNetData = fmap GenesisCreateTestNetData $ GenesisCreateTestNetDataCmdArgs <$> (optional $ pSpecFile "shelley") <*> pNumGenesisKeys @@ -211,10 +211,18 @@ pGenesisCreateTestNetData envCli = <*> pNumUtxoKeys <*> pSupply <*> pSupplyDelegated - <*> pNetworkId envCli + <*> optional pNetworkIdForTestnetData <*> pMaybeSystemStart <*> pOutputDir where + pNetworkIdForTestnetData :: Parser NetworkId + pNetworkIdForTestnetData = Testnet . NetworkMagic <$> testnetMagicParser + where + testnetMagicParser = Opt.option (bounded "TESTNET_MAGIC") + ( Opt.long "testnet-magic" + <> Opt.metavar "NATURAL" + <> Opt.help "Specify a testnet magic id for the cluster. Overrides the network id supplied in the spec file." + ) pSpecFile era = Opt.strOption $ mconcat [ Opt.long $ "spec-" <> era , Opt.metavar "FILE" @@ -409,7 +417,6 @@ pSlotLength = , Opt.value 1_000 ] - pSlotCoefficient :: Parser Rational pSlotCoefficient = Opt.option readRationalUnitInterval $ mconcat @@ -435,4 +442,4 @@ pBulkPoolsPerFile = , Opt.metavar "INT" , Opt.help "Each bulk pool to contain this many pool credential sets [default is 0]." , Opt.value 0 - ] + ] \ No newline at end of file diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs index 41f00dc837..712581cd76 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs @@ -197,15 +197,21 @@ runGenesisCreateTestNetDataCmd Cmd.GenesisCreateTestNetDataCmdArgs , outputDir } = do liftIO $ createDirectoryIfMissing False outputDir - shelleyGenesis <- + shelleyGenesisInit <- case specShelley of Just shelleyPath -> newExceptT $ readAndDecodeShelleyGenesis shelleyPath - Nothing -> do + Nothing -> -- No template given: a default file is created - pure $ shelleyGenesisDefaults { sgNetworkMagic = unNetworkMagic (toNetworkMagic networkId) } - - let -- {0 -> genesis-keys/genesis0/key.vkey, 1 -> genesis-keys/genesis1/key.vkey, ...} + pure shelleyGenesisDefaults + + -- Read NetworkId either from file or from the flag. Flag overrides template file. + let actualNetworkId = + case networkId of + Just networkFromFlag -> networkFromFlag + Nothing -> fromNetworkMagic (NetworkMagic $ sgNetworkMagic shelleyGenesisInit) + shelleyGenesis = shelleyGenesisInit { sgNetworkMagic = unNetworkMagic (toNetworkMagic actualNetworkId) } + -- {0 -> genesis-keys/genesis0/key.vkey, 1 -> genesis-keys/genesis1/key.vkey, ...} genesisVKeysPaths = mkPaths numGenesisKeys genesisDir "genesis" "key.vkey" -- {0 -> delegate-keys/delegate0/key.vkey, 1 -> delegate-keys/delegate1/key.vkey, ...} delegateKeys = mkPaths numGenesisKeys delegateDir "delegate" "key.vkey" @@ -237,7 +243,7 @@ runGenesisCreateTestNetDataCmd Cmd.GenesisCreateTestNetDataCmdArgs let poolDir = poolsDir ("pool" <> show index) createPoolCredentials desiredKeyOutputFormat poolDir - buildPoolParams networkId poolDir Nothing (fromMaybe mempty mayStakePoolRelays) + buildPoolParams actualNetworkId poolDir Nothing (fromMaybe mempty mayStakePoolRelays) when (0 < numPools) $ writeREADME poolsDir poolsREADME @@ -283,15 +289,15 @@ runGenesisCreateTestNetDataCmd Cmd.GenesisCreateTestNetDataCmdArgs -- We don't need to be attentive to laziness here, because anyway this -- doesn't scale really well (because we're generating legit credentials, -- as opposed to the Transient case). - zipWithM (computeDelegation networkId) delegates distribution + zipWithM (computeDelegation actualNetworkId) delegates distribution Transient _ -> - liftIO $ Lazy.forStateM g distribution $ flip computeInsecureDelegation networkId + liftIO $ Lazy.forStateM g distribution $ flip computeInsecureDelegation actualNetworkId genDlgs <- readGenDelegsMap genesisVKeysPaths delegateKeys delegateVrfKeys - nonDelegAddrs <- readInitialFundAddresses utxoKeys networkId + nonDelegAddrs <- readInitialFundAddresses utxoKeys actualNetworkId start <- maybe (SystemStart <$> getCurrentTimePlus30) pure systemStart - let network = toShelleyNetwork networkId + let network = toShelleyNetwork actualNetworkId stuffedUtxoAddrs <- liftIO $ Lazy.replicateM (fromIntegral numStuffedUtxo) $ genStuffedAddress network let stake = second Ledger.ppId . mkDelegationMapEntry <$> delegations @@ -723,4 +729,4 @@ readInitialFundAddresses utxoKeys nw = do , let vkh = verificationKeyHash (castVerificationKey vkey) addr = makeShelleyAddressInEra ShelleyBasedEraShelley nw (PaymentCredentialByKey vkh) NoStakeAddress - ] + ] \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs index 04b5b61337..1a81511780 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs @@ -27,7 +27,7 @@ import qualified Hedgehog.Extras.Test.Golden as H {- HLINT ignore "Use camelCase" -} networkMagic :: Word32 -networkMagic = 42 +networkMagic = 623 numDReps :: Int numDReps = 5 @@ -62,16 +62,33 @@ tree root = do subTrees <- mapM tree subs return $ files ++ concat subTrees --- | This test tests the non-transient case, i.e. it maximizes the files --- that can be written to disk. Execute this test with: --- @cabal test cardano-cli-golden --test-options '-p "/golden create testnet data/'@ +-- Execute this test with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden create testnet data/"'@ hprop_golden_create_testnet_data :: Property hprop_golden_create_testnet_data = + golden_create_testnet_data Nothing + +-- Execute this test with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden create testnet data with template/"'@ +hprop_golden_create_testnet_data_with_template :: Property +hprop_golden_create_testnet_data_with_template = + golden_create_testnet_data $ Just "test/cardano-cli-golden/files/input/shelley/genesis/genesis.spec.json" + +-- | This test tests the non-transient case, i.e. it maximizes the files +-- that can be written to disk. +golden_create_testnet_data :: () + => Maybe FilePath -- ^ The path to the shelley template use, if any + -> Property +golden_create_testnet_data mShelleyTemplate = propertyOnce $ moduleWorkspace "tmp" $ \tempDir -> do let outputDir = tempDir "out" + templateArg :: [String] = + case mShelleyTemplate of + Nothing -> [] + Just shelleyTemplate -> ["--spec-shelley", shelleyTemplate] - void $ execCardanoCLI $ mkArguments outputDir <> ["--stake-delegators", "4"] + void $ execCardanoCLI $ mkArguments outputDir <> ["--stake-delegators", "4"] <> templateArg generated <- liftIO $ tree outputDir -- Sort output for stability, and make relative to avoid storing diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli index 0ac5c5e15a..1cd2055c2c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -270,9 +270,7 @@ Usage: cardano-cli shelley genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -1429,9 +1427,7 @@ Usage: cardano-cli allegra genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -2586,9 +2582,7 @@ Usage: cardano-cli mary genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -3727,9 +3721,7 @@ Usage: cardano-cli alonzo genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -4892,9 +4884,7 @@ Usage: cardano-cli babbage genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -6075,9 +6065,7 @@ Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -7628,9 +7616,7 @@ Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli index 9f585ae776..c85d1ef2cd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli allegra genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli index a605dddc49..f02a7ea666 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli alonzo genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli index 25fb36b679..3df92c5c92 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli babbage genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli index 456ae72c13..b684d8e815 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli index fa85e70048..5c098b47ca 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli index 39de9776c6..54a2cf055f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli mary genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli index 560ba8f063..e5fb4bd6ed 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli @@ -9,9 +9,7 @@ Usage: cardano-cli shelley genesis create-testnet-data [--spec-shelley FILE] [--utxo-keys INT] [--total-supply LOVELACE] [--delegated-supply LOVELACE] - ( --mainnet - | --testnet-magic NATURAL - ) + [--testnet-magic NATURAL] [--start-time UTC-TIME] --out-dir DIR @@ -44,10 +42,8 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides + the network id supplied in the spec file. --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. From 33e0ddd0c188ba7e8715e06a05103d96b1936c13 Mon Sep 17 00:00:00 2001 From: Carlos LopezDeLara Date: Wed, 7 Feb 2024 11:02:16 -0600 Subject: [PATCH 5/5] rework to also pick network magic from environment --- .../Cardano/CLI/EraBased/Options/Genesis.hs | 36 ++++++++++++------- .../allegra_genesis_create-testnet-data.cli | 5 +-- .../alonzo_genesis_create-testnet-data.cli | 5 +-- .../babbage_genesis_create-testnet-data.cli | 5 +-- .../conway_genesis_create-testnet-data.cli | 5 +-- .../latest_genesis_create-testnet-data.cli | 5 +-- .../help/mary_genesis_create-testnet-data.cli | 5 +-- .../shelley_genesis_create-testnet-data.cli | 5 +-- 8 files changed, 44 insertions(+), 27 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs index f6acb69f6e..bc44edf359 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs @@ -21,6 +21,7 @@ import Data.Maybe import Data.Word (Word64) import Options.Applicative hiding (help, str) import qualified Options.Applicative as Opt +import Data.Foldable {- HLINT ignore "Use <$>" -} {- HLINT ignore "Move brackets to avoid $" -} @@ -89,7 +90,7 @@ pGenesisCmds envCli = ] , Just $ subParser "create-testnet-data" - $ Opt.info pGenesisCreateTestNetData + $ Opt.info (pGenesisCreateTestNetData envCli) $ Opt.progDesc $ mconcat [ "Create data to use for starting a testnet." @@ -199,8 +200,8 @@ pGenesisCreateStaked envCli = <*> pStuffedUtxoCount <*> Opt.optional pRelayJsonFp -pGenesisCreateTestNetData :: Parser (GenesisCmds era) -pGenesisCreateTestNetData = +pGenesisCreateTestNetData :: EnvCli -> Parser (GenesisCmds era) +pGenesisCreateTestNetData envCli = fmap GenesisCreateTestNetData $ GenesisCreateTestNetDataCmdArgs <$> (optional $ pSpecFile "shelley") <*> pNumGenesisKeys @@ -211,18 +212,10 @@ pGenesisCreateTestNetData = <*> pNumUtxoKeys <*> pSupply <*> pSupplyDelegated - <*> optional pNetworkIdForTestnetData + <*> (optional $ pNetworkIdForTestnetData envCli) <*> pMaybeSystemStart <*> pOutputDir where - pNetworkIdForTestnetData :: Parser NetworkId - pNetworkIdForTestnetData = Testnet . NetworkMagic <$> testnetMagicParser - where - testnetMagicParser = Opt.option (bounded "TESTNET_MAGIC") - ( Opt.long "testnet-magic" - <> Opt.metavar "NATURAL" - <> Opt.help "Specify a testnet magic id for the cluster. Overrides the network id supplied in the spec file." - ) pSpecFile era = Opt.strOption $ mconcat [ Opt.long $ "spec-" <> era , Opt.metavar "FILE" @@ -442,4 +435,21 @@ pBulkPoolsPerFile = , Opt.metavar "INT" , Opt.help "Each bulk pool to contain this many pool credential sets [default is 0]." , Opt.value 0 - ] \ No newline at end of file + ] + +pNetworkIdForTestnetData :: EnvCli -> Parser NetworkId +pNetworkIdForTestnetData envCli = asum $ mconcat + [ [ fmap (Testnet . NetworkMagic) $ Opt.option (bounded "TESTNET_MAGIC") $ mconcat + [ Opt.long "testnet-magic" + , Opt.metavar "NATURAL" + , Opt.help $ mconcat + [ "Specify a testnet magic id for the cluster. " + , "This overrides both the network magic from the " + , "spec file and CARDANO_NODE_NETWORK_ID environment variable" + ] + ] + ] + , -- Default to the network id specified by the environment variable if it is available. + pure <$> maybeToList (envCliNetworkId envCli) + ] + diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli index c85d1ef2cd..65b3b90621 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli index f02a7ea666..bb72c14ea9 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli index 3df92c5c92..aa23d8d044 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli index b684d8e815..a73282a280 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli index 5c098b47ca..564b11d1a7 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli index 54a2cf055f..055caed3c8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli index e5fb4bd6ed..49fe029e8c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_create-testnet-data.cli @@ -42,8 +42,9 @@ Available options: delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace). Cannot be more than the amount specified with --total-supply. - --testnet-magic NATURAL Specify a testnet magic id for the cluster. Overrides - the network id supplied in the spec file. + --testnet-magic NATURAL Specify a testnet magic id for the cluster. This + overrides both the network magic from the spec file + and CARDANO_NODE_NETWORK_ID environment variable --start-time UTC-TIME The genesis start time in YYYY-MM-DDThh:mm:ssZ format. If unspecified, will be the current time +30 seconds.