From d24b33b2319bc0c9c63d3c89277074252b459daa Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 28 Nov 2024 14:15:47 +0100 Subject: [PATCH 1/3] Copy `genesis hash` to `hash genesis-file` --- cardano-cli/src/Cardano/CLI/Commands/Hash.hs | 3 +++ cardano-cli/src/Cardano/CLI/Options/Hash.hs | 12 +++++++++++- cardano-cli/src/Cardano/CLI/Run/Hash.hs | 15 +++++++++++++-- .../src/Cardano/CLI/Types/Errors/HashCmdError.hs | 3 +++ .../test/cardano-cli-golden/files/golden/help.cli | 6 +++++- .../cardano-cli-golden/files/golden/help/hash.cli | 3 ++- .../files/golden/help/hash_genesis-file.cli | 7 +++++++ 7 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/hash_genesis-file.cli diff --git a/cardano-cli/src/Cardano/CLI/Commands/Hash.hs b/cardano-cli/src/Cardano/CLI/Commands/Hash.hs index a457b7e113..0bd964d98b 100644 --- a/cardano-cli/src/Cardano/CLI/Commands/Hash.hs +++ b/cardano-cli/src/Cardano/CLI/Commands/Hash.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-} +{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE LambdaCase #-} @@ -22,6 +23,7 @@ import Data.Text (Text) data HashCmds = HashAnchorDataCmd !HashAnchorDataCmdArgs | HashScriptCmd !HashScriptCmdArgs + | HashGenesisFile !GenesisFile data HashGoal hash = -- | The hash is written to stdout @@ -58,3 +60,4 @@ renderHashCmds :: HashCmds -> Text renderHashCmds = \case HashAnchorDataCmd{} -> "hash anchor-data" HashScriptCmd{} -> "hash script" + HashGenesisFile{} -> "hash genesis-file" diff --git a/cardano-cli/src/Cardano/CLI/Options/Hash.hs b/cardano-cli/src/Cardano/CLI/Options/Hash.hs index 2603baeda3..46507f9040 100644 --- a/cardano-cli/src/Cardano/CLI/Options/Hash.hs +++ b/cardano-cli/src/Cardano/CLI/Options/Hash.hs @@ -20,7 +20,7 @@ pHashCmds :: Parser Cmd.HashCmds pHashCmds = subParser "hash" $ Opt.info - (asum [pHashAnchorDataCmd, pHashScriptCmd]) + (asum [pHashAnchorDataCmd, pHashScriptCmd, pHashGenesisHashCmd]) ( Opt.progDesc $ mconcat [ "Compute the hash to pass to the various --*-hash arguments of commands." @@ -79,3 +79,13 @@ pHashScriptCmd = do ) ) $ Opt.progDesc "Compute the hash of a script (to then pass it to other commands)." + +pHashGenesisHashCmd :: Parser Cmd.HashCmds +pHashGenesisHashCmd = + subParser "genesis-file" $ + Opt.info pGenesisHash $ + Opt.progDesc "Compute the hash of a genesis file." + +pGenesisHash :: Parser Cmd.HashCmds +pGenesisHash = + Cmd.HashGenesisFile <$> pGenesisFile "The genesis file." diff --git a/cardano-cli/src/Cardano/CLI/Run/Hash.hs b/cardano-cli/src/Cardano/CLI/Run/Hash.hs index deff090ded..9844e1a87d 100644 --- a/cardano-cli/src/Cardano/CLI/Run/Hash.hs +++ b/cardano-cli/src/Cardano/CLI/Run/Hash.hs @@ -21,11 +21,12 @@ import qualified Cardano.Api.Ledger as L import qualified Cardano.CLI.Commands.Hash as Cmd import Cardano.CLI.Parser (stringToAnchorScheme) import Cardano.CLI.Read -import Cardano.CLI.Types.Common (AnchorScheme (..), MustCheckHash (..), +import Cardano.CLI.Types.Common (AnchorScheme (..), GenesisFile (..), MustCheckHash (..), PotentiallyCheckedAnchor (..), SupportedSchemes) import Cardano.CLI.Types.Errors.HashCmdError import Cardano.Crypto.Hash (hashToTextAsHex) -import Cardano.Prelude (first) +import qualified Cardano.Crypto.Hash as Crypto +import Cardano.Prelude (ByteString, first) import Control.Exception (throw) import Control.Monad (when) @@ -55,6 +56,7 @@ runHashCmds runHashCmds = \case Cmd.HashAnchorDataCmd args -> runHashAnchorDataCmd args Cmd.HashScriptCmd args -> runHashScriptCmd args + Cmd.HashGenesisFile args -> runHashGenesisFile args runHashAnchorDataCmd :: () @@ -217,3 +219,12 @@ carryHashChecks potentiallyCheckedAnchor = TrustHash -> pure () where anchor = pcaAnchor potentiallyCheckedAnchor + +runHashGenesisFile :: GenesisFile -> ExceptT HashCmdError IO () +runHashGenesisFile (GenesisFile fpath) = do + content <- + handleIOExceptT (HashGenesisCmdGenesisFileError . FileIOError fpath) $ + BS.readFile fpath + let gh :: Crypto.Hash Crypto.Blake2b_256 ByteString + gh = Crypto.hashWith id content + liftIO $ Text.putStrLn (Crypto.hashToTextAsHex gh) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/HashCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/HashCmdError.hs index e896961c97..d4da8a105f 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/HashCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/HashCmdError.hs @@ -27,6 +27,7 @@ data HashCmdError | HashWriteFileError !(FileError ()) | HashReadScriptError !FilePath !(FileError ScriptDecodeError) | HashFetchURLError !FetchURLError + | HashGenesisCmdGenesisFileError !(FileError ()) deriving Show instance Error HashCmdError where @@ -45,6 +46,8 @@ instance Error HashCmdError where "Cannot read script at" <+> pretty filepath <> ":" <+> prettyError err HashFetchURLError fetchErr -> pretty (displayException fetchErr) + HashGenesisCmdGenesisFileError fe -> + prettyError fe data FetchURLError = FetchURLInvalidURLError !String 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 b0d9efa7d2..1899b39c1a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -10525,7 +10525,7 @@ Usage: cardano-cli latest transaction txid Print a transaction identifier. -Usage: cardano-cli hash (anchor-data | script) +Usage: cardano-cli hash (anchor-data | script | genesis-file) Compute the hash to pass to the various --*-hash arguments of commands. @@ -10545,6 +10545,10 @@ Usage: cardano-cli hash script --script-file FILEPATH [--out-file FILEPATH] Compute the hash of a script (to then pass it to other commands). +Usage: cardano-cli hash genesis-file --genesis FILEPATH + + Compute the hash of a genesis file. + Usage: cardano-cli ping [-c|--count COUNT] ((-h|--host HOST) | (-u|--unixsock SOCKET)) [-p|--port PORT] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/hash.cli index 60e539e30f..44cbfc30e4 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/hash.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/hash.cli @@ -1,4 +1,4 @@ -Usage: cardano-cli hash (anchor-data | script) +Usage: cardano-cli hash (anchor-data | script | genesis-file) Compute the hash to pass to the various --*-hash arguments of commands. @@ -10,3 +10,4 @@ Available commands: to other commands). script Compute the hash of a script (to then pass it to other commands). + genesis-file Compute the hash of a genesis file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/hash_genesis-file.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/hash_genesis-file.cli new file mode 100644 index 0000000000..f767ce89a6 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/hash_genesis-file.cli @@ -0,0 +1,7 @@ +Usage: cardano-cli hash genesis-file --genesis FILEPATH + + Compute the hash of a genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text From 7561062492c17e9a5fdc8236955e3e16936734d4 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 28 Nov 2024 16:17:47 +0100 Subject: [PATCH 2/3] Remove `genesis hash` command --- .../Cardano/CLI/EraBased/Commands/Genesis.hs | 3 -- .../Cardano/CLI/EraBased/Options/Genesis.hs | 8 ---- .../src/Cardano/CLI/EraBased/Run/Genesis.hs | 12 ------ .../Cardano/CLI/Legacy/Commands/Genesis.hs | 3 -- cardano-cli/src/Cardano/CLI/Legacy/Options.hs | 7 ---- .../src/Cardano/CLI/Legacy/Run/Genesis.hs | 9 ----- .../cardano-cli-golden/files/golden/help.cli | 40 ------------------- .../files/golden/help/allegra_genesis.cli | 2 - .../golden/help/allegra_genesis_hash.cli | 7 ---- .../files/golden/help/alonzo_genesis.cli | 2 - .../files/golden/help/alonzo_genesis_hash.cli | 7 ---- .../files/golden/help/babbage_genesis.cli | 2 - .../golden/help/babbage_genesis_hash.cli | 7 ---- .../files/golden/help/conway_genesis.cli | 2 - .../files/golden/help/conway_genesis_hash.cli | 7 ---- .../files/golden/help/latest_genesis.cli | 2 - .../files/golden/help/latest_genesis_hash.cli | 7 ---- .../files/golden/help/legacy_genesis.cli | 2 - .../files/golden/help/legacy_genesis_hash.cli | 7 ---- .../files/golden/help/mary_genesis.cli | 2 - .../files/golden/help/mary_genesis_hash.cli | 7 ---- .../files/golden/help/shelley_genesis.cli | 2 - .../golden/help/shelley_genesis_hash.cli | 7 ---- 23 files changed, 154 deletions(-) delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs index bea18c357a..c6ef5858fd 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs @@ -40,7 +40,6 @@ data GenesisCmds era | GenesisVerKey !GenesisVerKeyCmdArgs | GenesisTxIn !GenesisTxInCmdArgs | GenesisAddr !GenesisAddrCmdArgs - | GenesisHashFile !GenesisFile deriving Show data GenesisCreateCmdArgs era = GenesisCreateCmdArgs @@ -198,5 +197,3 @@ renderGenesisCmds = \case "genesis initial-txin" GenesisAddr{} -> "genesis initial-addr" - GenesisHashFile{} -> - "genesis hash" diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs index c920276eb3..b6d16ecc82 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs @@ -100,10 +100,6 @@ pGenesisCmds era envCli = mconcat [ "Create data to use for starting a testnet." ] - , Just $ - subParser "hash" $ - Opt.info pGenesisHash $ - Opt.progDesc "Compute the hash of a genesis file" ] pGenesisKeyGen :: Parser (GenesisCmds era) @@ -361,10 +357,6 @@ pGenesisCreateTestNetData era envCli = , Opt.help "The directory where to generate the data. Created if not existing." ] -pGenesisHash :: Parser (GenesisCmds era) -pGenesisHash = - GenesisHashFile <$> pGenesisFile "The genesis file." - pGenesisDir :: Parser GenesisDir pGenesisDir = fmap GenesisDir $ diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs index e819fae1c5..2aab0fb198 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs @@ -20,7 +20,6 @@ module Cardano.CLI.EraBased.Run.Genesis , runGenesisCreateCardanoCmd , runGenesisCreateCmd , runGenesisCreateStakedCmd - , runGenesisHashFileCmd , runGenesisKeyHashCmd , runGenesisTxInCmd , runGenesisVerKeyCmd @@ -108,7 +107,6 @@ runGenesisCmds = \case GenesisCreateCardano args -> runGenesisCreateCardanoCmd args GenesisCreateStaked args -> runGenesisCreateStakedCmd args GenesisCreateTestNetData args -> TN.runGenesisCreateTestNetDataCmd args - GenesisHashFile gf -> runGenesisHashFileCmd gf runGenesisKeyHashCmd :: VerificationKeyFile In -> ExceptT GenesisCmdError IO () runGenesisKeyHashCmd vkeyPath = do @@ -1341,13 +1339,3 @@ readInitialFundAddresses utxodir nw = do (PaymentCredentialByKey vkh) NoStakeAddress ] - --- | Hash a genesis file -runGenesisHashFileCmd :: GenesisFile -> ExceptT GenesisCmdError IO () -runGenesisHashFileCmd (GenesisFile fpath) = do - content <- - handleIOExceptT (GenesisCmdGenesisFileError . FileIOError fpath) $ - BS.readFile fpath - let gh :: Crypto.Hash Crypto.Blake2b_256 ByteString - gh = Crypto.hashWith id content - liftIO $ Text.putStrLn (Crypto.hashToTextAsHex gh) diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs index ce34840f43..b7b6cab1d3 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs @@ -81,8 +81,6 @@ data LegacyGenesisCmds (VerificationKeyFile In) NetworkId (Maybe (File () Out)) - | GenesisHashFile - GenesisFile deriving Show renderLegacyGenesisCmds :: LegacyGenesisCmds -> Text @@ -97,4 +95,3 @@ renderLegacyGenesisCmds = \case GenesisVerKey{} -> "genesis get-ver-key" GenesisTxIn{} -> "genesis initial-txin" GenesisAddr{} -> "genesis initial-addr" - GenesisHashFile{} -> "genesis hash" diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs index b30106c092..54280377c4 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs @@ -171,9 +171,6 @@ pGenesisCmds envCli = [ "Create a staked Shelley genesis file from a genesis " , "template and genesis/delegation/spending keys." ] - , subParser "hash" $ - Opt.info pGenesisHash $ - Opt.progDesc "Compute the hash of a genesis file" ] where pGenesisKeyGen :: Parser LegacyGenesisCmds @@ -278,10 +275,6 @@ pGenesisCmds envCli = <*> pStuffedUtxoCount <*> Opt.optional pRelayJsonFp - pGenesisHash :: Parser LegacyGenesisCmds - pGenesisHash = - GenesisHashFile <$> pGenesisFile "The genesis file." - pGenesisDir :: Parser GenesisDir pGenesisDir = fmap GenesisDir $ diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs index fa1dac1c68..f6513a72bd 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs @@ -44,8 +44,6 @@ runLegacyGenesisCmds = \case runLegacyGenesisCreateCardanoCmd eSbe gd gn un ms am k slotLength sc nw bg sg ag cg mNodeCfg GenesisCreateStaked eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp -> runLegacyGenesisCreateStakedCmd eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp - GenesisHashFile gf -> - runLegacyGenesisHashFileCmd gf runLegacyGenesisKeyGenGenesisCmd :: () @@ -271,10 +269,3 @@ runLegacyGenesisCreateStakedCmd , Cmd.numStuffedUtxo = numStuffedUtxo , Cmd.mStakePoolRelaySpecFile = mStakePoolRelaySpecFile } - --- | Hash a genesis file -runLegacyGenesisHashFileCmd - :: () - => GenesisFile - -> ExceptT GenesisCmdError IO () -runLegacyGenesisHashFileCmd = runGenesisHashFileCmd 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 1899b39c1a..4c003b4881 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -544,7 +544,6 @@ Usage: cardano-cli legacy genesis | create-cardano | create | create-staked - | hash ) Genesis block commands @@ -665,10 +664,6 @@ Usage: cardano-cli legacy genesis create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. -Usage: cardano-cli legacy genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli byron ( key | transaction @@ -1094,7 +1089,6 @@ Usage: cardano-cli shelley genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -1193,10 +1187,6 @@ Usage: cardano-cli shelley genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. -Usage: cardano-cli shelley genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli shelley governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -2143,7 +2133,6 @@ Usage: cardano-cli allegra genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -2242,10 +2231,6 @@ Usage: cardano-cli allegra genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. -Usage: cardano-cli allegra genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli allegra governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -3192,7 +3177,6 @@ Usage: cardano-cli mary genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -3289,10 +3273,6 @@ Usage: cardano-cli mary genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. -Usage: cardano-cli mary genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli mary governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -4231,7 +4211,6 @@ Usage: cardano-cli alonzo genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -4328,10 +4307,6 @@ Usage: cardano-cli alonzo genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. -Usage: cardano-cli alonzo genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli alonzo governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -5286,7 +5261,6 @@ Usage: cardano-cli babbage genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -5404,10 +5378,6 @@ Usage: cardano-cli babbage genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. -Usage: cardano-cli babbage genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli babbage governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -6640,7 +6610,6 @@ Usage: cardano-cli conway genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -6760,10 +6729,6 @@ Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. -Usage: cardano-cli conway genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli conway governance (action | committee | drep | vote) Governance commands. @@ -8658,7 +8623,6 @@ Usage: cardano-cli latest genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -8778,10 +8742,6 @@ Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. -Usage: cardano-cli latest genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - Usage: cardano-cli latest governance (action | committee | drep | vote) Governance commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli index 8b10843c12..1fd1e968cc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli @@ -9,7 +9,6 @@ Usage: cardano-cli allegra genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -34,4 +33,3 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli deleted file mode 100644 index 5a15a81e96..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli allegra genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli index a1d6c67f4e..7793ae8084 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli @@ -9,7 +9,6 @@ Usage: cardano-cli alonzo genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -34,4 +33,3 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli deleted file mode 100644 index feeb364025..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli alonzo genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli index a209f1dacf..8c598c90da 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli @@ -10,7 +10,6 @@ Usage: cardano-cli babbage genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -36,4 +35,3 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli deleted file mode 100644 index 1c2fdd79ec..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli babbage genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli index fca90a1832..49424085cd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli @@ -10,7 +10,6 @@ Usage: cardano-cli conway genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -36,4 +35,3 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli deleted file mode 100644 index 98219703fc..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli conway genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli index 00364d4775..5c41e99ad4 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli @@ -10,7 +10,6 @@ Usage: cardano-cli latest genesis | create | create-staked | create-testnet-data - | hash ) Genesis block commands. @@ -36,4 +35,3 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli deleted file mode 100644 index b9b7f22ed7..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli latest genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli index 98e99d8301..508c7a4e1a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli @@ -9,7 +9,6 @@ Usage: cardano-cli legacy genesis | create-cardano | create | create-staked - | hash ) Genesis block commands @@ -34,4 +33,3 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli deleted file mode 100644 index 60e9614008..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli legacy genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli index 95034b1ccf..2f975be08e 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli @@ -9,7 +9,6 @@ Usage: cardano-cli mary genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -34,4 +33,3 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli deleted file mode 100644 index 5070e808f5..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli mary genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli index 65ff660ac0..a6a21e0615 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli @@ -9,7 +9,6 @@ Usage: cardano-cli shelley genesis | create-cardano | create | create-staked - | hash ) Genesis block commands. @@ -34,4 +33,3 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. - hash Compute the hash of a genesis file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli deleted file mode 100644 index c7d9b9d2fd..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli +++ /dev/null @@ -1,7 +0,0 @@ -Usage: cardano-cli shelley genesis hash --genesis FILEPATH - - Compute the hash of a genesis file - -Available options: - --genesis FILEPATH The genesis file. - -h,--help Show this help text From 5a31b7e30b29b22758efea56a41ad01a1ffb81c3 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 2 Dec 2024 12:44:38 +0100 Subject: [PATCH 3/3] Restore deleted commands and add deprecation warning --- .../Cardano/CLI/EraBased/Commands/Genesis.hs | 3 + .../Cardano/CLI/EraBased/Options/Genesis.hs | 14 +++++ .../src/Cardano/CLI/EraBased/Run/Genesis.hs | 12 ++++ .../Cardano/CLI/Legacy/Commands/Genesis.hs | 3 + cardano-cli/src/Cardano/CLI/Legacy/Options.hs | 13 +++++ .../src/Cardano/CLI/Legacy/Run/Genesis.hs | 9 +++ .../cardano-cli-golden/files/golden/help.cli | 56 +++++++++++++++++++ .../files/golden/help/allegra_genesis.cli | 5 ++ .../golden/help/allegra_genesis_hash.cli | 9 +++ .../files/golden/help/alonzo_genesis.cli | 5 ++ .../files/golden/help/alonzo_genesis_hash.cli | 9 +++ .../files/golden/help/babbage_genesis.cli | 5 ++ .../golden/help/babbage_genesis_hash.cli | 9 +++ .../files/golden/help/conway_genesis.cli | 5 ++ .../files/golden/help/conway_genesis_hash.cli | 9 +++ .../files/golden/help/latest_genesis.cli | 5 ++ .../files/golden/help/latest_genesis_hash.cli | 9 +++ .../files/golden/help/legacy_genesis.cli | 5 ++ .../files/golden/help/legacy_genesis_hash.cli | 9 +++ .../files/golden/help/mary_genesis.cli | 5 ++ .../files/golden/help/mary_genesis_hash.cli | 9 +++ .../files/golden/help/shelley_genesis.cli | 5 ++ .../golden/help/shelley_genesis_hash.cli | 9 +++ 23 files changed, 222 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs index c6ef5858fd..bea18c357a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs @@ -40,6 +40,7 @@ data GenesisCmds era | GenesisVerKey !GenesisVerKeyCmdArgs | GenesisTxIn !GenesisTxInCmdArgs | GenesisAddr !GenesisAddrCmdArgs + | GenesisHashFile !GenesisFile deriving Show data GenesisCreateCmdArgs era = GenesisCreateCmdArgs @@ -197,3 +198,5 @@ renderGenesisCmds = \case "genesis initial-txin" GenesisAddr{} -> "genesis initial-addr" + GenesisHashFile{} -> + "genesis hash" diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs index b6d16ecc82..37ffaf00c9 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs @@ -100,6 +100,16 @@ pGenesisCmds era envCli = mconcat [ "Create data to use for starting a testnet." ] + , Just $ + subParser "hash" $ + Opt.info pGenesisHash $ + Opt.progDesc $ + mconcat + [ "DEPRECATION WARNING! This command is deprecated and will be " + , "removed in a future release. Please use hash genesis-file " + , "instead. " + , "Compute the hash of a genesis file." + ] ] pGenesisKeyGen :: Parser (GenesisCmds era) @@ -357,6 +367,10 @@ pGenesisCreateTestNetData era envCli = , Opt.help "The directory where to generate the data. Created if not existing." ] +pGenesisHash :: Parser (GenesisCmds era) +pGenesisHash = + GenesisHashFile <$> pGenesisFile "The genesis file." + pGenesisDir :: Parser GenesisDir pGenesisDir = fmap GenesisDir $ diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs index 2aab0fb198..e819fae1c5 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs @@ -20,6 +20,7 @@ module Cardano.CLI.EraBased.Run.Genesis , runGenesisCreateCardanoCmd , runGenesisCreateCmd , runGenesisCreateStakedCmd + , runGenesisHashFileCmd , runGenesisKeyHashCmd , runGenesisTxInCmd , runGenesisVerKeyCmd @@ -107,6 +108,7 @@ runGenesisCmds = \case GenesisCreateCardano args -> runGenesisCreateCardanoCmd args GenesisCreateStaked args -> runGenesisCreateStakedCmd args GenesisCreateTestNetData args -> TN.runGenesisCreateTestNetDataCmd args + GenesisHashFile gf -> runGenesisHashFileCmd gf runGenesisKeyHashCmd :: VerificationKeyFile In -> ExceptT GenesisCmdError IO () runGenesisKeyHashCmd vkeyPath = do @@ -1339,3 +1341,13 @@ readInitialFundAddresses utxodir nw = do (PaymentCredentialByKey vkh) NoStakeAddress ] + +-- | Hash a genesis file +runGenesisHashFileCmd :: GenesisFile -> ExceptT GenesisCmdError IO () +runGenesisHashFileCmd (GenesisFile fpath) = do + content <- + handleIOExceptT (GenesisCmdGenesisFileError . FileIOError fpath) $ + BS.readFile fpath + let gh :: Crypto.Hash Crypto.Blake2b_256 ByteString + gh = Crypto.hashWith id content + liftIO $ Text.putStrLn (Crypto.hashToTextAsHex gh) diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs index b7b6cab1d3..ce34840f43 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs @@ -81,6 +81,8 @@ data LegacyGenesisCmds (VerificationKeyFile In) NetworkId (Maybe (File () Out)) + | GenesisHashFile + GenesisFile deriving Show renderLegacyGenesisCmds :: LegacyGenesisCmds -> Text @@ -95,3 +97,4 @@ renderLegacyGenesisCmds = \case GenesisVerKey{} -> "genesis get-ver-key" GenesisTxIn{} -> "genesis initial-txin" GenesisAddr{} -> "genesis initial-addr" + GenesisHashFile{} -> "genesis hash" diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs index 54280377c4..4a80354609 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs @@ -171,6 +171,15 @@ pGenesisCmds envCli = [ "Create a staked Shelley genesis file from a genesis " , "template and genesis/delegation/spending keys." ] + , subParser "hash" $ + Opt.info pGenesisHash $ + Opt.progDesc $ + unlines + [ "DEPRECATION WARNING! This command is deprecated and will be " + , "removed in a future release. Please use hash genesis-file " + , "instead. " + , "Compute the hash of a genesis file." + ] ] where pGenesisKeyGen :: Parser LegacyGenesisCmds @@ -275,6 +284,10 @@ pGenesisCmds envCli = <*> pStuffedUtxoCount <*> Opt.optional pRelayJsonFp + pGenesisHash :: Parser LegacyGenesisCmds + pGenesisHash = + GenesisHashFile <$> pGenesisFile "The genesis file." + pGenesisDir :: Parser GenesisDir pGenesisDir = fmap GenesisDir $ diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs index f6513a72bd..fa1dac1c68 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs @@ -44,6 +44,8 @@ runLegacyGenesisCmds = \case runLegacyGenesisCreateCardanoCmd eSbe gd gn un ms am k slotLength sc nw bg sg ag cg mNodeCfg GenesisCreateStaked eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp -> runLegacyGenesisCreateStakedCmd eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp + GenesisHashFile gf -> + runLegacyGenesisHashFileCmd gf runLegacyGenesisKeyGenGenesisCmd :: () @@ -269,3 +271,10 @@ runLegacyGenesisCreateStakedCmd , Cmd.numStuffedUtxo = numStuffedUtxo , Cmd.mStakePoolRelaySpecFile = mStakePoolRelaySpecFile } + +-- | Hash a genesis file +runLegacyGenesisHashFileCmd + :: () + => GenesisFile + -> ExceptT GenesisCmdError IO () +runLegacyGenesisHashFileCmd = runGenesisHashFileCmd 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 4c003b4881..169448001a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -544,6 +544,7 @@ Usage: cardano-cli legacy genesis | create-cardano | create | create-staked + | hash ) Genesis block commands @@ -664,6 +665,12 @@ Usage: cardano-cli legacy genesis create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. +Usage: cardano-cli legacy genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli byron ( key | transaction @@ -1089,6 +1096,7 @@ Usage: cardano-cli shelley genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -1187,6 +1195,12 @@ Usage: cardano-cli shelley genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. +Usage: cardano-cli shelley genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli shelley governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -2133,6 +2147,7 @@ Usage: cardano-cli allegra genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -2231,6 +2246,12 @@ Usage: cardano-cli allegra genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. +Usage: cardano-cli allegra genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli allegra governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -3177,6 +3198,7 @@ Usage: cardano-cli mary genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -3273,6 +3295,12 @@ Usage: cardano-cli mary genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. +Usage: cardano-cli mary genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli mary governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -4211,6 +4239,7 @@ Usage: cardano-cli alonzo genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -4307,6 +4336,12 @@ Usage: cardano-cli alonzo genesis create-staked [--key-output-format STRING] Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. +Usage: cardano-cli alonzo genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli alonzo governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -5261,6 +5296,7 @@ Usage: cardano-cli babbage genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -5378,6 +5414,12 @@ Usage: cardano-cli babbage genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. +Usage: cardano-cli babbage genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli babbage governance ( create-mir-certificate | create-genesis-key-delegation-certificate @@ -6610,6 +6652,7 @@ Usage: cardano-cli conway genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -6729,6 +6772,12 @@ Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. +Usage: cardano-cli conway genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli conway governance (action | committee | drep | vote) Governance commands. @@ -8623,6 +8672,7 @@ Usage: cardano-cli latest genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -8742,6 +8792,12 @@ Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILEPATH] Create data to use for starting a testnet. +Usage: cardano-cli latest genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + Usage: cardano-cli latest governance (action | committee | drep | vote) Governance commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli index 1fd1e968cc..1de5e8300f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis.cli @@ -9,6 +9,7 @@ Usage: cardano-cli allegra genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -33,3 +34,7 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli new file mode 100644 index 0000000000..ac71269707 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli allegra genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli index 7793ae8084..5326451a1f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis.cli @@ -9,6 +9,7 @@ Usage: cardano-cli alonzo genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -33,3 +34,7 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli new file mode 100644 index 0000000000..25b6308146 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli alonzo genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli index 8c598c90da..b789946fca 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis.cli @@ -10,6 +10,7 @@ Usage: cardano-cli babbage genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -35,3 +36,7 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli new file mode 100644 index 0000000000..0e7ad87e8b --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli babbage genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli index 49424085cd..70d54a240d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis.cli @@ -10,6 +10,7 @@ Usage: cardano-cli conway genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -35,3 +36,7 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli new file mode 100644 index 0000000000..71f89c867f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli conway genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli index 5c41e99ad4..adda7dcec8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis.cli @@ -10,6 +10,7 @@ Usage: cardano-cli latest genesis | create | create-staked | create-testnet-data + | hash ) Genesis block commands. @@ -35,3 +36,7 @@ Available commands: create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. create-testnet-data Create data to use for starting a testnet. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli new file mode 100644 index 0000000000..449ae95bdc --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli latest genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli index 508c7a4e1a..5b0ba72236 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis.cli @@ -9,6 +9,7 @@ Usage: cardano-cli legacy genesis | create-cardano | create | create-staked + | hash ) Genesis block commands @@ -33,3 +34,7 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli new file mode 100644 index 0000000000..b3efe9822c --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli legacy genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli index 2f975be08e..7501966612 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis.cli @@ -9,6 +9,7 @@ Usage: cardano-cli mary genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -33,3 +34,7 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli new file mode 100644 index 0000000000..02b1335df4 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli mary genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli index a6a21e0615..21af50514a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis.cli @@ -9,6 +9,7 @@ Usage: cardano-cli shelley genesis | create-cardano | create | create-staked + | hash ) Genesis block commands. @@ -33,3 +34,7 @@ Available commands: and genesis/delegation/spending keys. create-staked Create a staked Shelley genesis file from a genesis template and genesis/delegation/spending keys. + hash DEPRECATION WARNING! This command is deprecated and + will be removed in a future release. Please use hash + genesis-file instead. Compute the hash of a genesis + file. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli new file mode 100644 index 0000000000..afe5c33145 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_genesis_hash.cli @@ -0,0 +1,9 @@ +Usage: cardano-cli shelley genesis hash --genesis FILEPATH + + DEPRECATION WARNING! This command is deprecated and will be removed in a + future release. Please use hash genesis-file instead. Compute the hash of a + genesis file. + +Available options: + --genesis FILEPATH The genesis file. + -h,--help Show this help text