From 6ae496ce73087a2aa1f1f081f52cafef2b24ab02 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 19 Mar 2026 02:30:11 +0100 Subject: [PATCH 1/6] Add BLS key generation --- .../src/Cardano/CLI/EraIndependent/Key/Run.hs | 4 +- .../CLI/EraIndependent/Node/Command.hs | 11 ++++++ .../Cardano/CLI/EraIndependent/Node/Option.hs | 15 ++++++++ .../Cardano/CLI/EraIndependent/Node/Run.hs | 38 +++++++++++++++++++ .../cardano-cli-golden/files/golden/help.cli | 33 ++++++++++++++++ .../files/golden/help/conway_node.cli | 2 + .../golden/help/conway_node_key-gen-BLS.cli | 24 ++++++++++++ .../files/golden/help/latest_node.cli | 2 + .../golden/help/latest_node_key-gen-BLS.cli | 24 ++++++++++++ .../files/golden/help/node.cli | 2 + .../files/golden/help/node_key-gen-BLS.cli | 24 ++++++++++++ 11 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Key/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Key/Run.hs index 5f06ca0734..6d1618becb 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Key/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Key/Run.hs @@ -204,12 +204,12 @@ runNonExtendedKeyCmd vk@AGenesisUTxOVerificationKey{} -> goFail vk vk@AKesVerificationKey{} -> goFail vk vk@AVrfVerificationKey{} -> goFail vk + vk@ABlsVerificationKey{} -> goFail vk vk@AStakePoolVerificationKey{} -> goFail vk vk@AStakeVerificationKey{} -> goFail vk vk@ADRepVerificationKey{} -> goFail vk vk@ACommitteeColdVerificationKey{} -> goFail vk vk@ACommitteeHotVerificationKey{} -> goFail vk - vk@ABlsVerificationKey{} -> goFail vk where goFail nonExtendedKey = throwCliError $ KeyCmdExpectedExtendedVerificationKey nonExtendedKey @@ -249,12 +249,12 @@ readExtendedVerificationKeyFile evkfile = do k@AGenesisUTxOVerificationKey{} -> goFail k k@AKesVerificationKey{} -> goFail k k@AVrfVerificationKey{} -> goFail k + k@ABlsVerificationKey{} -> goFail k k@AStakePoolVerificationKey{} -> goFail k k@AStakeVerificationKey{} -> goFail k k@ADRepVerificationKey{} -> goFail k k@ACommitteeColdVerificationKey{} -> goFail k k@ACommitteeHotVerificationKey{} -> goFail k - k@ABlsVerificationKey{} -> goFail k where goFail k = left $ KeyCmdExpectedExtendedVerificationKey k diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs index 1eea566211..91f923334f 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs @@ -8,6 +8,7 @@ module Cardano.CLI.EraIndependent.Node.Command , NodeKeyGenColdCmdArgs (..) , NodeKeyGenKESCmdArgs (..) , NodeKeyGenVRFCmdArgs (..) + , NodeKeyGenBLSCmdArgs (..) , NodeKeyHashVRFCmdArgs (..) , NodeNewCounterCmdArgs (..) , NodeIssueOpCertCmdArgs (..) @@ -25,6 +26,7 @@ data NodeCmds = NodeKeyGenColdCmd !NodeKeyGenColdCmdArgs | NodeKeyGenKESCmd !NodeKeyGenKESCmdArgs | NodeKeyGenVRFCmd !NodeKeyGenVRFCmdArgs + | NodeKeyGenBLSCmd !NodeKeyGenBLSCmdArgs | NodeKeyHashVRFCmd !NodeKeyHashVRFCmdArgs | NodeNewCounterCmd !NodeNewCounterCmdArgs | NodeIssueOpCertCmd !NodeIssueOpCertCmdArgs @@ -55,6 +57,14 @@ data NodeKeyGenVRFCmdArgs } deriving Show +data NodeKeyGenBLSCmdArgs + = NodeKeyGenBLSCmdArgs + { keyOutputFormat :: !(Vary [FormatBech32, FormatTextEnvelope]) + , vkeyFile :: !(VerificationKeyFile Out) + , skeyFile :: !(SigningKeyFile Out) + } + deriving Show + data NodeKeyHashVRFCmdArgs = NodeKeyHashVRFCmdArgs { vkeySource :: !(VerificationKeyOrFile VrfKey) @@ -89,6 +99,7 @@ renderNodeCmds = \case NodeKeyGenColdCmd{} -> "node key-gen" NodeKeyGenKESCmd{} -> "node key-gen-KES" NodeKeyGenVRFCmd{} -> "node key-gen-VRF" + NodeKeyGenBLSCmd{} -> "node key-gen-BLS" NodeKeyHashVRFCmd{} -> "node key-hash-VRF" NodeNewCounterCmd{} -> "node new-counter" NodeIssueOpCertCmd{} -> "node issue-op-cert" diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs index 5e5dc6feee..6a5c81c1fd 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs @@ -43,6 +43,13 @@ pNodeCmds = mconcat [ "Create a key pair for a node VRF operational key" ] + , Opt.hsubparser $ + commandWithMetavar "key-gen-BLS" $ + Opt.info pKeyGenBLS $ + Opt.progDesc $ + mconcat + [ "Create a key pair for a node BLS operational key" + ] , Opt.hsubparser $ commandWithMetavar "key-hash-VRF" . Opt.info pKeyHashVRF $ Opt.progDesc $ @@ -97,6 +104,14 @@ pKeyGenVRF = <*> pVerificationKeyFileOut <*> pSigningKeyFileOut +pKeyGenBLS :: Parser NodeCmds +pKeyGenBLS = + fmap Cmd.NodeKeyGenBLSCmd $ + Cmd.NodeKeyGenBLSCmdArgs + <$> pKeyOutputFormat + <*> pVerificationKeyFileOut + <*> pSigningKeyFileOut + pKeyHashVRF :: Parser NodeCmds pKeyHashVRF = fmap Cmd.NodeKeyHashVRFCmd $ diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs index 50b5cb8f73..b29df68f89 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs @@ -37,6 +37,7 @@ runNodeCmds = \case Cmd.NodeKeyGenColdCmd args -> runNodeKeyGenColdCmd args Cmd.NodeKeyGenKESCmd args -> runNodeKeyGenKesCmd args Cmd.NodeKeyGenVRFCmd args -> runNodeKeyGenVrfCmd args + Cmd.NodeKeyGenBLSCmd args -> runNodeKeyGenBLSCmd args Cmd.NodeKeyHashVRFCmd args -> runNodeKeyHashVrfCmd args Cmd.NodeNewCounterCmd args -> runNodeNewCounterCmd args Cmd.NodeIssueOpCertCmd args -> runNodeIssueOpCertCmd args @@ -215,6 +216,43 @@ runNodeKeyGenVrfCmd skeyDesc = "VRF Signing Key" vkeyDesc = "VRF Verification Key" +runNodeKeyGenBLSCmd + :: () + => Cmd.NodeKeyGenBLSCmdArgs + -> CIO e () +runNodeKeyGenBLSCmd + Cmd.NodeKeyGenBLSCmdArgs + { keyOutputFormat + , vkeyFile + , skeyFile + } = do + skey <- generateSigningKey AsBlsKey + + let vkey = getVerificationKey skey + + keyOutputFormat + & ( id + . Vary.on + ( \FormatBech32 -> do + fromEitherIOCli @(FileError ()) + . writeTextFile skeyFile + $ serialiseToBech32 skey + fromEitherIOCli @(FileError ()) + . writeTextFile vkeyFile + $ serialiseToBech32 vkey + ) + . Vary.on + ( \FormatTextEnvelope -> do + fromEitherIOCli @(FileError ()) + . writeLazyByteStringFileWithOwnerPermissions skeyFile + $ textEnvelopeToJSON Nothing skey + fromEitherIOCli @(FileError ()) + . writeLazyByteStringFile vkeyFile + $ textEnvelopeToJSON Nothing vkey + ) + $ Vary.exhaustiveCase + ) + runNodeKeyHashVrfCmd :: () => Cmd.NodeKeyHashVRFCmdArgs 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 0ed67ceb95..3fd00bb804 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -173,6 +173,7 @@ Usage: cardano-cli node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -212,6 +213,16 @@ Usage: cardano-cli node key-gen-VRF Create a key pair for a node VRF operational key +Usage: cardano-cli node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + Usage: cardano-cli node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH @@ -1664,6 +1675,7 @@ Usage: cardano-cli conway node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -1703,6 +1715,16 @@ Usage: cardano-cli conway node key-gen-VRF Create a key pair for a node VRF operational key +Usage: cardano-cli conway node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + Usage: cardano-cli conway node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH @@ -3963,6 +3985,7 @@ Usage: cardano-cli latest node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -4002,6 +4025,16 @@ Usage: cardano-cli latest node key-gen-VRF Create a key pair for a node VRF operational key +Usage: cardano-cli latest node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + Usage: cardano-cli latest node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli index 3fe36322cb..961b5dad5f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli @@ -2,6 +2,7 @@ Usage: cardano-cli conway node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -17,6 +18,7 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key + key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli new file mode 100644 index 0000000000..89e6e6420b --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli @@ -0,0 +1,24 @@ +Usage: cardano-cli conway node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + +Available options: + --key-output-bech32 Format key output to BECH32. + --key-output-text-envelope + Format key output to TEXT_ENVELOPE (default). + --key-output-format STRING + Optional key output format. Accepted output formats + are "text-envelope" and "bech32". The + --key-output-format flag is deprecated and will be + removed in a future version. + --verification-key-file FILEPATH + Output filepath of the verification key. + --signing-key-file FILEPATH + Output filepath of the signing key. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli index babb45a768..5074f2b80f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli @@ -2,6 +2,7 @@ Usage: cardano-cli latest node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -17,6 +18,7 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key + key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli new file mode 100644 index 0000000000..1163141349 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli @@ -0,0 +1,24 @@ +Usage: cardano-cli latest node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + +Available options: + --key-output-bech32 Format key output to BECH32. + --key-output-text-envelope + Format key output to TEXT_ENVELOPE (default). + --key-output-format STRING + Optional key output format. Accepted output formats + are "text-envelope" and "bech32". The + --key-output-format flag is deprecated and will be + removed in a future version. + --verification-key-file FILEPATH + Output filepath of the verification key. + --signing-key-file FILEPATH + Output filepath of the signing key. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli index f133ab4c3d..3b51947160 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli @@ -2,6 +2,7 @@ Usage: cardano-cli node ( key-gen | key-gen-KES | key-gen-VRF + | key-gen-BLS | key-hash-VRF | new-counter | issue-op-cert @@ -17,6 +18,7 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key + key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli new file mode 100644 index 0000000000..4593eea99f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli @@ -0,0 +1,24 @@ +Usage: cardano-cli node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + +Available options: + --key-output-bech32 Format key output to BECH32. + --key-output-text-envelope + Format key output to TEXT_ENVELOPE (default). + --key-output-format STRING + Optional key output format. Accepted output formats + are "text-envelope" and "bech32". The + --key-output-format flag is deprecated and will be + removed in a future version. + --verification-key-file FILEPATH + Output filepath of the verification key. + --signing-key-file FILEPATH + Output filepath of the signing key. + -h,--help Show this help text From aa01e9e824cb5c478ef1e729489ac2a6a532f415 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Thu, 19 Mar 2026 20:42:26 +0100 Subject: [PATCH 2/6] Add BLS hashing command --- .../CLI/EraIndependent/Node/Command.hs | 10 +++++++ .../Cardano/CLI/EraIndependent/Node/Option.hs | 13 +++++++++ .../Cardano/CLI/EraIndependent/Node/Run.hs | 19 +++++++++++++ .../cardano-cli-golden/files/golden/help.cli | 27 +++++++++++++++++++ .../files/golden/help/conway_node.cli | 2 ++ .../golden/help/conway_node_key-hash-BLS.cli | 15 +++++++++++ .../files/golden/help/latest_node.cli | 2 ++ .../golden/help/latest_node_key-hash-BLS.cli | 15 +++++++++++ .../files/golden/help/node.cli | 2 ++ .../files/golden/help/node_key-hash-BLS.cli | 15 +++++++++++ 10 files changed, 120 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs index 91f923334f..2e6ae9aaab 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs @@ -10,6 +10,7 @@ module Cardano.CLI.EraIndependent.Node.Command , NodeKeyGenVRFCmdArgs (..) , NodeKeyGenBLSCmdArgs (..) , NodeKeyHashVRFCmdArgs (..) + , NodeKeyHashBLSCmdArgs (..) , NodeNewCounterCmdArgs (..) , NodeIssueOpCertCmdArgs (..) ) @@ -28,6 +29,7 @@ data NodeCmds | NodeKeyGenVRFCmd !NodeKeyGenVRFCmdArgs | NodeKeyGenBLSCmd !NodeKeyGenBLSCmdArgs | NodeKeyHashVRFCmd !NodeKeyHashVRFCmdArgs + | NodeKeyHashBLSCmd !NodeKeyHashBLSCmdArgs | NodeNewCounterCmd !NodeNewCounterCmdArgs | NodeIssueOpCertCmd !NodeIssueOpCertCmdArgs deriving Show @@ -72,6 +74,13 @@ data NodeKeyHashVRFCmdArgs } deriving Show +data NodeKeyHashBLSCmdArgs + = NodeKeyHashBLSCmdArgs + { vkeySource :: !(VerificationKeyOrFile BlsKey) + , mOutFile :: !(Maybe (File () Out)) + } + deriving Show + data NodeNewCounterCmdArgs = NodeNewCounterCmdArgs { coldVkeyFile :: !ColdVerificationKeyOrFile @@ -101,5 +110,6 @@ renderNodeCmds = \case NodeKeyGenVRFCmd{} -> "node key-gen-VRF" NodeKeyGenBLSCmd{} -> "node key-gen-BLS" NodeKeyHashVRFCmd{} -> "node key-hash-VRF" + NodeKeyHashBLSCmd{} -> "node key-hash-BLS" NodeNewCounterCmd{} -> "node new-counter" NodeIssueOpCertCmd{} -> "node issue-op-cert" diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs index 6a5c81c1fd..e167c31e30 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs @@ -56,6 +56,12 @@ pNodeCmds = mconcat [ "Print hash of a node's operational VRF key." ] + , Opt.hsubparser $ + commandWithMetavar "key-hash-BLS" . Opt.info pKeyHashBLS $ + Opt.progDesc $ + mconcat + [ "Print hash of a node's operational BLS key." + ] , Opt.hsubparser $ commandWithMetavar "new-counter" $ Opt.info pNewCounter $ @@ -119,6 +125,13 @@ pKeyHashVRF = <$> pVerificationKeyOrFileIn <*> pMaybeOutputFile +pKeyHashBLS :: Parser NodeCmds +pKeyHashBLS = + fmap Cmd.NodeKeyHashBLSCmd $ + Cmd.NodeKeyHashBLSCmdArgs + <$> pVerificationKeyOrFileIn + <*> pMaybeOutputFile + pNewCounter :: Parser NodeCmds pNewCounter = fmap Cmd.NodeNewCounterCmd $ diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs index b29df68f89..46f4aef3bb 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs @@ -13,6 +13,7 @@ module Cardano.CLI.EraIndependent.Node.Run , runNodeKeyGenKesCmd , runNodeKeyGenVrfCmd , runNodeKeyHashVrfCmd + , runNodeKeyHashBlsCmd , runNodeNewCounterCmd ) where @@ -39,6 +40,7 @@ runNodeCmds = \case Cmd.NodeKeyGenVRFCmd args -> runNodeKeyGenVrfCmd args Cmd.NodeKeyGenBLSCmd args -> runNodeKeyGenBLSCmd args Cmd.NodeKeyHashVRFCmd args -> runNodeKeyHashVrfCmd args + Cmd.NodeKeyHashBLSCmd args -> runNodeKeyHashBlsCmd args Cmd.NodeNewCounterCmd args -> runNodeNewCounterCmd args Cmd.NodeIssueOpCertCmd args -> runNodeIssueOpCertCmd args @@ -270,6 +272,23 @@ runNodeKeyHashVrfCmd fromEitherIOCli @(FileError ()) $ writeByteStringOutput mOutFile hexKeyHash +runNodeKeyHashBlsCmd + :: () + => Cmd.NodeKeyHashBLSCmdArgs + -> CIO e () +runNodeKeyHashBlsCmd + Cmd.NodeKeyHashBLSCmdArgs + { vkeySource + , mOutFile + } = do + vkey <- + readVerificationKeyOrFile vkeySource + + let hexKeyHash = serialiseToRawBytesHex (verificationKeyHash vkey) + + fromEitherIOCli @(FileError ()) $ + writeByteStringOutput mOutFile hexKeyHash + runNodeNewCounterCmd :: () => Cmd.NodeNewCounterCmdArgs 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 3fd00bb804..8bf799e612 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -175,6 +175,7 @@ Usage: cardano-cli node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -231,6 +232,14 @@ Usage: cardano-cli node key-hash-VRF Print hash of a node's operational VRF key. +Usage: cardano-cli node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + Usage: cardano-cli node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING @@ -1677,6 +1686,7 @@ Usage: cardano-cli conway node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -1733,6 +1743,14 @@ Usage: cardano-cli conway node key-hash-VRF Print hash of a node's operational VRF key. +Usage: cardano-cli conway node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + Usage: cardano-cli conway node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING @@ -3987,6 +4005,7 @@ Usage: cardano-cli latest node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -4043,6 +4062,14 @@ Usage: cardano-cli latest node key-hash-VRF Print hash of a node's operational VRF key. +Usage: cardano-cli latest node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + Usage: cardano-cli latest node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli index 961b5dad5f..06c6deba86 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli @@ -4,6 +4,7 @@ Usage: cardano-cli conway node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -20,5 +21,6 @@ Available commands: key-gen-VRF Create a key pair for a node VRF operational key key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. + key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli new file mode 100644 index 0000000000..72ee5c99d7 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli @@ -0,0 +1,15 @@ +Usage: cardano-cli conway node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + +Available options: + --verification-key STRING + Verification key (Bech32 or hex-encoded). + --verification-key-file FILEPATH + Input filepath of the verification key. + --out-file FILEPATH Optional output file. Default is to write to stdout. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli index 5074f2b80f..bb65c4f755 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli @@ -4,6 +4,7 @@ Usage: cardano-cli latest node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -20,5 +21,6 @@ Available commands: key-gen-VRF Create a key pair for a node VRF operational key key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. + key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli new file mode 100644 index 0000000000..7ba8b958a0 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli @@ -0,0 +1,15 @@ +Usage: cardano-cli latest node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + +Available options: + --verification-key STRING + Verification key (Bech32 or hex-encoded). + --verification-key-file FILEPATH + Input filepath of the verification key. + --out-file FILEPATH Optional output file. Default is to write to stdout. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli index 3b51947160..cc2eac8f9b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli @@ -4,6 +4,7 @@ Usage: cardano-cli node | key-gen-VRF | key-gen-BLS | key-hash-VRF + | key-hash-BLS | new-counter | issue-op-cert ) @@ -20,5 +21,6 @@ Available commands: key-gen-VRF Create a key pair for a node VRF operational key key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. + key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli new file mode 100644 index 0000000000..da206ca8bd --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli @@ -0,0 +1,15 @@ +Usage: cardano-cli node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + +Available options: + --verification-key STRING + Verification key (Bech32 or hex-encoded). + --verification-key-file FILEPATH + Input filepath of the verification key. + --out-file FILEPATH Optional output file. Default is to write to stdout. + -h,--help Show this help text From 4c26d8b88faa095c6ce17c697d8694db832c9193 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 23 Mar 2026 19:07:10 +0100 Subject: [PATCH 3/6] Fix BLS signing key file permissions in Bech32 mode Use `writeTextFileWithOwnerPermissions` instead of `writeTextFile` for the signing key --- cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs index 46f4aef3bb..49765f2c44 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs @@ -237,7 +237,7 @@ runNodeKeyGenBLSCmd . Vary.on ( \FormatBech32 -> do fromEitherIOCli @(FileError ()) - . writeTextFile skeyFile + . writeTextFileWithOwnerPermissions skeyFile $ serialiseToBech32 skey fromEitherIOCli @(FileError ()) . writeTextFile vkeyFile From fbda188809f150b435111a60ccb6b02131f6d57c Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 23 Mar 2026 19:08:46 +0100 Subject: [PATCH 4/6] Remove redundant empty constraint from BLS function signatures Drop the `:: () =>` constraint from `runNodeKeyGenBLSCmd` and `runNodeKeyHashBlsCmd` signatures --- cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs index 49765f2c44..20110e76c2 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs @@ -219,8 +219,7 @@ runNodeKeyGenVrfCmd vkeyDesc = "VRF Verification Key" runNodeKeyGenBLSCmd - :: () - => Cmd.NodeKeyGenBLSCmdArgs + :: Cmd.NodeKeyGenBLSCmdArgs -> CIO e () runNodeKeyGenBLSCmd Cmd.NodeKeyGenBLSCmdArgs @@ -273,8 +272,7 @@ runNodeKeyHashVrfCmd writeByteStringOutput mOutFile hexKeyHash runNodeKeyHashBlsCmd - :: () - => Cmd.NodeKeyHashBLSCmdArgs + :: Cmd.NodeKeyHashBLSCmdArgs -> CIO e () runNodeKeyHashBlsCmd Cmd.NodeKeyHashBLSCmdArgs From 9adc63a5c43e067f9cf505d74e5fe0e83858733a Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 23 Mar 2026 19:11:45 +0100 Subject: [PATCH 5/6] Add golden tests for BLS key generation and key hashing Use default for the description of the text envelope --- cardano-cli/cardano-cli.cabal | 2 + .../Test/Golden/Shelley/Node/KeyGenBls.hs | 98 +++++++++++++++++++ .../Test/Golden/Shelley/Node/KeyHashBls.hs | 28 ++++++ .../input/shelley/keys/bls_keys/signing_key | 5 + .../shelley/keys/bls_keys/verification_key | 5 + .../keys/bls_keys/verification_key.key-hash | 1 + 6 files changed, 139 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs create mode 100644 cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs create mode 100755 cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/signing_key create mode 100644 cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key create mode 100644 cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key.key-hash diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index ce60d3f5b2..86a59e5667 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -497,8 +497,10 @@ test-suite cardano-cli-golden Test.Golden.Shelley.MultiSig.Address Test.Golden.Shelley.Node.IssueOpCert Test.Golden.Shelley.Node.KeyGen + Test.Golden.Shelley.Node.KeyGenBls Test.Golden.Shelley.Node.KeyGenKes Test.Golden.Shelley.Node.KeyGenVrf + Test.Golden.Shelley.Node.KeyHashBls Test.Golden.Shelley.StakeAddress.Build Test.Golden.Shelley.StakeAddress.DeregistrationCertificate Test.Golden.Shelley.StakeAddress.KeyGen diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs new file mode 100644 index 0000000000..c3d21b4c73 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs @@ -0,0 +1,98 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Test.Golden.Shelley.Node.KeyGenBls where + +import Control.Monad (void) + +import Test.Cardano.CLI.Aeson +import Test.Cardano.CLI.Util + +import Hedgehog (Property) +import Hedgehog.Extras.Test.Base qualified as H +import Hedgehog.Extras.Test.File qualified as H + +hprop_golden_shelleyNodeKeyGenBls :: Property +hprop_golden_shelleyNodeKeyGenBls = + watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + verificationKey <- noteTempFile tempDir "bls.vkey" + signingKey <- noteTempFile tempDir "bls.skey" + + void $ + execCardanoCLI + [ "latest" + , "node" + , "key-gen-BLS" + , "--verification-key-file" + , verificationKey + , "--signing-key-file" + , signingKey + ] + + assertHasMappings + [ ("type", "BlsVerificationKey_bls12-381-BLS-Signature-Mininimal-Signature-Size") + , ("description", "BLS12-381 verification key") + ] + verificationKey + assertHasMappings + [ ("type", "BlsSigningKey_bls12-381-BLS-Signature-Mininimal-Signature-Size") + , ("description", "BLS12-381 signing key") + ] + signingKey + + H.assertEndsWithSingleNewline verificationKey + H.assertEndsWithSingleNewline signingKey + +hprop_golden_shelleyNodeKeyGenBls_te :: Property +hprop_golden_shelleyNodeKeyGenBls_te = + watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + verificationKey <- noteTempFile tempDir "bls.vkey" + signingKey <- noteTempFile tempDir "bls.skey" + + void $ + execCardanoCLI + [ "latest" + , "node" + , "key-gen-BLS" + , "--key-output-format" + , "text-envelope" + , "--verification-key-file" + , verificationKey + , "--signing-key-file" + , signingKey + ] + + assertHasMappings + [ ("type", "BlsVerificationKey_bls12-381-BLS-Signature-Mininimal-Signature-Size") + , ("description", "BLS12-381 verification key") + ] + verificationKey + assertHasMappings + [ ("type", "BlsSigningKey_bls12-381-BLS-Signature-Mininimal-Signature-Size") + , ("description", "BLS12-381 signing key") + ] + signingKey + + H.assertEndsWithSingleNewline verificationKey + H.assertEndsWithSingleNewline signingKey + +hprop_golden_shelleyNodeKeyGenBls_bech32 :: Property +hprop_golden_shelleyNodeKeyGenBls_bech32 = + watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + verificationKey <- noteTempFile tempDir "bls.vkey" + signingKey <- noteTempFile tempDir "bls.skey" + + void $ + execCardanoCLI + [ "latest" + , "node" + , "key-gen-BLS" + , "--key-output-format" + , "bech32" + , "--verification-key-file" + , verificationKey + , "--signing-key-file" + , signingKey + ] + + H.assertFileOccurences 1 "bls_vk" verificationKey + H.assertFileOccurences 1 "bls_sk" signingKey diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs new file mode 100644 index 0000000000..57f77fb61a --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Test.Golden.Shelley.Node.KeyHashBls where + +import Test.Cardano.CLI.Util + +import Hedgehog (Property) +import Hedgehog.Extras.Test qualified as H + +hprop_golden_shelleyNodeKeyHashBls :: Property +hprop_golden_shelleyNodeKeyHashBls = + watchdogProp . propertyOnce $ do + verificationKeyFile <- + noteInputFile "test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key" + goldenVerificationKeyHashFile <- + noteInputFile + "test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key.key-hash" + + verificationKeyHash <- + execCardanoCLI + [ "latest" + , "node" + , "key-hash-BLS" + , "--verification-key-file" + , verificationKeyFile + ] + + H.diffVsGoldenFile verificationKeyHash goldenVerificationKeyHashFile diff --git a/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/signing_key b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/signing_key new file mode 100755 index 0000000000..c1100aad7f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/signing_key @@ -0,0 +1,5 @@ +{ + "type": "BlsSigningKey_bls12-381-BLS-Signature-Mininimal-Signature-Size", + "description": "BLS Signing Key", + "cborHex": "58206f4b2375c689e6ef27cd3fc2cce9ae8d221386c3641746ec4e8eb3d32ebd2b7c" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key new file mode 100644 index 0000000000..172678ac98 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key @@ -0,0 +1,5 @@ +{ + "type": "BlsVerificationKey_bls12-381-BLS-Signature-Mininimal-Signature-Size", + "description": "BLS Verification Key", + "cborHex": "58608f25d696f778b68ceca228315b9366423029d781a36c4353a9ccfc7b4e879b5827324000c1c0748d19f11ea92857d7ce004c3c11ef18949e6df8cfced42c25764ff95c3603973af54e38b7d760a2a9921959498ef895d66d8ba2266dcb69659b" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key.key-hash b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key.key-hash new file mode 100644 index 0000000000..384924225e --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/shelley/keys/bls_keys/verification_key.key-hash @@ -0,0 +1 @@ +be1845522652ed53a57652b17927b8f1028876602b7aba1f93101f01e12082ef \ No newline at end of file From b53d42160b783ed56e8c872cf9d9274a50cfc84c Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Tue, 31 Mar 2026 02:00:25 +0200 Subject: [PATCH 6/6] Only enable BLS generation and hashing functions on Dijkstra --- .../src/Cardano/CLI/EraBased/Option.hs | 10 +- .../Cardano/CLI/EraIndependent/Node/Option.hs | 183 ++++++++++-------- cardano-cli/src/Cardano/CLI/Option.hs | 2 +- .../Test/Golden/Shelley/Node/KeyGenBls.hs | 6 +- .../Test/Golden/Shelley/Node/KeyHashBls.hs | 2 +- .../files/golden/base_help.cli | 2 + .../cardano-cli-golden/files/golden/help.cli | 158 +++++++++------ .../files/golden/help/conway_node.cli | 4 - .../files/golden/help/dijkstra_node.cli | 26 +++ .../help/dijkstra_node_issue-op-cert.cli | 24 +++ ...-BLS.cli => dijkstra_node_key-gen-BLS.cli} | 14 +- ...-BLS.cli => dijkstra_node_key-gen-KES.cli} | 16 +- ...-BLS.cli => dijkstra_node_key-gen-VRF.cli} | 16 +- .../golden/help/dijkstra_node_key-gen.cli | 29 +++ ...BLS.cli => dijkstra_node_key-hash-BLS.cli} | 10 +- .../help/dijkstra_node_key-hash-VRF.cli | 15 ++ .../golden/help/dijkstra_node_new-counter.cli | 26 +++ .../files/golden/help/latest_node.cli | 4 - .../golden/help/latest_node_key-hash-BLS.cli | 15 -- .../files/golden/help/node.cli | 4 - .../files/golden/help/node_key-hash-BLS.cli | 15 -- 21 files changed, 363 insertions(+), 218 deletions(-) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_issue-op-cert.cli rename cardano-cli/test/cardano-cli-golden/files/golden/help/{conway_node_key-gen-BLS.cli => dijkstra_node_key-gen-BLS.cli} (62%) rename cardano-cli/test/cardano-cli-golden/files/golden/help/{node_key-gen-BLS.cli => dijkstra_node_key-gen-KES.cli} (58%) rename cardano-cli/test/cardano-cli-golden/files/golden/help/{latest_node_key-gen-BLS.cli => dijkstra_node_key-gen-VRF.cli} (58%) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen.cli rename cardano-cli/test/cardano-cli-golden/files/golden/help/{conway_node_key-hash-BLS.cli => dijkstra_node_key-hash-BLS.cli} (54%) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-VRF.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_new-counter.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/Option.hs index 3e790cadc7..adf63519da 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Option.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} module Cardano.CLI.EraBased.Option @@ -6,6 +7,7 @@ module Cardano.CLI.EraBased.Option ) where +import Cardano.Api (DijkstraEra) import Cardano.Api.Experimental import Cardano.CLI.Environment @@ -27,7 +29,7 @@ import Data.Maybe import Options.Applicative (Parser) import Options.Applicative qualified as Opt -pCmds :: IsEra era => EnvCli -> Parser (Cmds era) +pCmds :: forall era. IsEra era => EnvCli -> Parser (Cmds era) pCmds envCli = do asum $ catMaybes @@ -35,7 +37,7 @@ pCmds envCli = do , Just (KeyCmds <$> pKeyCmds) , fmap GenesisCmds <$> pGenesisCmds envCli , fmap GovernanceCmds <$> pGovernanceCmds - , Just (NodeCmds <$> pNodeCmds) + , Just (NodeCmds <$> pNodeCmds @era) , fmap QueryCmds <$> pQueryCmds envCli , fmap StakeAddressCmds <$> pStakeAddressCmds envCli , fmap StakePoolCmds <$> pStakePoolCmds envCli @@ -50,6 +52,10 @@ pAnyEraCommand envCli = commandWithMetavar "conway" $ Opt.info (AnyEraCommandOf ConwayEra <$> pCmds @ConwayEra envCli) $ Opt.progDesc "Conway era commands" + , Opt.hsubparser $ + commandWithMetavar "dijkstra" $ + Opt.info (AnyEraCommandOf DijkstraEra <$> asum [NodeCmds <$> pNodeCmds @DijkstraEra]) $ + Opt.progDesc "Dijkstra era commands" , Opt.hsubparser $ commandWithMetavar "latest" $ Opt.info (AnyEraCommandOf ConwayEra <$> pCmds @ConwayEra envCli) $ diff --git a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs index e167c31e30..d2ee77ac57 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs @@ -1,82 +1,91 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} module Cardano.CLI.EraIndependent.Node.Option ( pNodeCmds ) where +import Cardano.Api.Experimental qualified as Exp + import Cardano.CLI.EraBased.Common.Option import Cardano.CLI.EraIndependent.Node.Command import Cardano.CLI.EraIndependent.Node.Command qualified as Cmd import Cardano.CLI.Parser import Data.Foldable +import Data.Maybe (catMaybes) import Options.Applicative hiding (help, str) import Options.Applicative qualified as Opt -pNodeCmds :: Parser NodeCmds +pNodeCmds :: forall era. Exp.IsEra era => Parser NodeCmds pNodeCmds = let nodeCmdParsers = - asum - [ Opt.hsubparser $ - commandWithMetavar "key-gen" $ - Opt.info pKeyGenOperator $ - Opt.progDesc $ - mconcat - [ "Create a key pair for a node operator's offline " - , "key and a new certificate issue counter" - ] - , Opt.hsubparser $ - commandWithMetavar "key-gen-KES" $ - Opt.info pKeyGenKES $ - Opt.progDesc $ - mconcat - [ "Create a key pair for a node KES operational key" - ] - , Opt.hsubparser $ - commandWithMetavar "key-gen-VRF" $ - Opt.info pKeyGenVRF $ - Opt.progDesc $ - mconcat - [ "Create a key pair for a node VRF operational key" - ] - , Opt.hsubparser $ - commandWithMetavar "key-gen-BLS" $ - Opt.info pKeyGenBLS $ - Opt.progDesc $ - mconcat - [ "Create a key pair for a node BLS operational key" - ] - , Opt.hsubparser $ - commandWithMetavar "key-hash-VRF" . Opt.info pKeyHashVRF $ - Opt.progDesc $ - mconcat - [ "Print hash of a node's operational VRF key." - ] - , Opt.hsubparser $ - commandWithMetavar "key-hash-BLS" . Opt.info pKeyHashBLS $ - Opt.progDesc $ - mconcat - [ "Print hash of a node's operational BLS key." - ] - , Opt.hsubparser $ - commandWithMetavar "new-counter" $ - Opt.info pNewCounter $ - Opt.progDesc $ - mconcat - [ "Create a new certificate issue counter" - ] - , Opt.hsubparser $ - commandWithMetavar "issue-op-cert" $ - Opt.info pIssueOpCert $ - Opt.progDesc $ - mconcat - [ "Issue a node operational certificate" - ] - ] + asum $ + catMaybes + [ Just $ + Opt.hsubparser $ + commandWithMetavar "key-gen" $ + Opt.info pKeyGenOperator $ + Opt.progDesc $ + mconcat + [ "Create a key pair for a node operator's offline " + , "key and a new certificate issue counter" + ] + , Just $ + Opt.hsubparser $ + commandWithMetavar "key-gen-KES" $ + Opt.info pKeyGenKES $ + Opt.progDesc $ + mconcat + [ "Create a key pair for a node KES operational key" + ] + , Just $ + Opt.hsubparser $ + commandWithMetavar "key-gen-VRF" $ + Opt.info pKeyGenVRF $ + Opt.progDesc $ + mconcat + [ "Create a key pair for a node VRF operational key" + ] + , pKeyGenBLS @era + , Just $ + Opt.hsubparser $ + commandWithMetavar "key-hash-VRF" . Opt.info pKeyHashVRF $ + Opt.progDesc $ + mconcat + [ "Print hash of a node's operational VRF key." + ] + , pKeyHashBLS @era + , Just $ + Opt.hsubparser $ + commandWithMetavar "new-counter" $ + Opt.info pNewCounter $ + Opt.progDesc $ + mconcat + [ "Create a new certificate issue counter" + ] + , Just + $ Opt.hsubparser + $ commandWithMetavar "issue-op-cert" + $ Opt.info + ( fmap Cmd.NodeIssueOpCertCmd $ + Cmd.NodeIssueOpCertCmdArgs + <$> pKesVerificationKeyOrFile + <*> pColdSigningKeyFile + <*> pOperatorCertIssueCounterFile + <*> pKesPeriod + <*> pOutputFile + ) + $ Opt.progDesc + $ mconcat + [ "Issue a node operational certificate" + ] + ] in Opt.hsubparser $ commandWithMetavar "node" $ Opt.info nodeCmdParsers $ @@ -110,13 +119,24 @@ pKeyGenVRF = <*> pVerificationKeyFileOut <*> pSigningKeyFileOut -pKeyGenBLS :: Parser NodeCmds -pKeyGenBLS = - fmap Cmd.NodeKeyGenBLSCmd $ - Cmd.NodeKeyGenBLSCmdArgs - <$> pKeyOutputFormat - <*> pVerificationKeyFileOut - <*> pSigningKeyFileOut +pKeyGenBLS :: forall era. Exp.IsEra era => Maybe (Parser NodeCmds) +pKeyGenBLS = case Exp.useEra @era of + Exp.ConwayEra -> Nothing + Exp.DijkstraEra -> + Just + $ Opt.hsubparser + $ commandWithMetavar "key-gen-BLS" + $ Opt.info + ( fmap Cmd.NodeKeyGenBLSCmd $ + Cmd.NodeKeyGenBLSCmdArgs + <$> pKeyOutputFormat + <*> pVerificationKeyFileOut + <*> pSigningKeyFileOut + ) + $ Opt.progDesc + $ mconcat + [ "Create a key pair for a node BLS operational key" + ] pKeyHashVRF :: Parser NodeCmds pKeyHashVRF = @@ -125,12 +145,23 @@ pKeyHashVRF = <$> pVerificationKeyOrFileIn <*> pMaybeOutputFile -pKeyHashBLS :: Parser NodeCmds -pKeyHashBLS = - fmap Cmd.NodeKeyHashBLSCmd $ - Cmd.NodeKeyHashBLSCmdArgs - <$> pVerificationKeyOrFileIn - <*> pMaybeOutputFile +pKeyHashBLS :: forall era. Exp.IsEra era => Maybe (Parser NodeCmds) +pKeyHashBLS = case Exp.useEra @era of + Exp.ConwayEra -> Nothing + Exp.DijkstraEra -> + Just + $ Opt.hsubparser + $ commandWithMetavar "key-hash-BLS" + . Opt.info + ( fmap Cmd.NodeKeyHashBLSCmd $ + Cmd.NodeKeyHashBLSCmdArgs + <$> pVerificationKeyOrFileIn + <*> pMaybeOutputFile + ) + $ Opt.progDesc + $ mconcat + [ "Print hash of a node's operational BLS key." + ] pNewCounter :: Parser NodeCmds pNewCounter = @@ -148,13 +179,3 @@ pCounterValue = , Opt.metavar "INT" , Opt.help "The next certificate issue counter value to use." ] - -pIssueOpCert :: Parser NodeCmds -pIssueOpCert = - fmap Cmd.NodeIssueOpCertCmd $ - Cmd.NodeIssueOpCertCmdArgs - <$> pKesVerificationKeyOrFile - <*> pColdSigningKeyFile - <*> pOperatorCertIssueCounterFile - <*> pKesPeriod - <*> pOutputFile diff --git a/cardano-cli/src/Cardano/CLI/Option.hs b/cardano-cli/src/Cardano/CLI/Option.hs index 7de87c08aa..328f78722f 100644 --- a/cardano-cli/src/Cardano/CLI/Option.hs +++ b/cardano-cli/src/Cardano/CLI/Option.hs @@ -61,7 +61,7 @@ addressCmdsTopLevel envCli = AddressCommand <$> pAddressCmds envCli -- The node related commands are shelley era agnostic for the time being. -- There is no need to guard them by the era argument. nodeCmdsTopLevel :: Parser ClientCommand -nodeCmdsTopLevel = NodeCommands <$> pNodeCmds +nodeCmdsTopLevel = NodeCommands <$> pNodeCmds @ConwayEra -- Queries actually depend on the node to client version which may coincide -- with a hardfork but not necessarily. We will expose commands at the top level diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs index c3d21b4c73..0b9464526b 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyGenBls.hs @@ -19,7 +19,7 @@ hprop_golden_shelleyNodeKeyGenBls = void $ execCardanoCLI - [ "latest" + [ "dijkstra" , "node" , "key-gen-BLS" , "--verification-key-file" @@ -50,7 +50,7 @@ hprop_golden_shelleyNodeKeyGenBls_te = void $ execCardanoCLI - [ "latest" + [ "dijkstra" , "node" , "key-gen-BLS" , "--key-output-format" @@ -83,7 +83,7 @@ hprop_golden_shelleyNodeKeyGenBls_bech32 = void $ execCardanoCLI - [ "latest" + [ "dijkstra" , "node" , "key-gen-BLS" , "--key-output-format" diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs index 57f77fb61a..dd0ef720fb 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/Node/KeyHashBls.hs @@ -18,7 +18,7 @@ hprop_golden_shelleyNodeKeyHashBls = verificationKeyHash <- execCardanoCLI - [ "latest" + [ "dijkstra" , "node" , "key-hash-BLS" , "--verification-key-file" diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/base_help.cli b/cardano-cli/test/cardano-cli-golden/files/golden/base_help.cli index 339e15c6ce..9c420b764a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/base_help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/base_help.cli @@ -11,6 +11,7 @@ Usage: cardano-cli | legacy | byron | conway + | dijkstra | latest | debug commands | version @@ -34,6 +35,7 @@ Available commands: legacy Legacy commands byron Byron specific commands conway Conway era commands + dijkstra Dijkstra era commands latest Latest era commands (Conway) debug Debug commands help Show all help 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 8bf799e612..3b450c8bc1 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -7,6 +7,7 @@ Usage: cardano-cli | legacy | byron | conway + | dijkstra | latest | debug commands | version @@ -173,9 +174,7 @@ Usage: cardano-cli node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -214,16 +213,6 @@ Usage: cardano-cli node key-gen-VRF Create a key pair for a node VRF operational key -Usage: cardano-cli node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH - - Create a key pair for a node BLS operational key - Usage: cardano-cli node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH @@ -232,14 +221,6 @@ Usage: cardano-cli node key-hash-VRF Print hash of a node's operational VRF key. -Usage: cardano-cli node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] - - Print hash of a node's operational BLS key. - Usage: cardano-cli node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING @@ -1684,9 +1665,7 @@ Usage: cardano-cli conway node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -1725,16 +1704,6 @@ Usage: cardano-cli conway node key-gen-VRF Create a key pair for a node VRF operational key -Usage: cardano-cli conway node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH - - Create a key pair for a node BLS operational key - Usage: cardano-cli conway node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH @@ -1743,14 +1712,6 @@ Usage: cardano-cli conway node key-hash-VRF Print hash of a node's operational VRF key. -Usage: cardano-cli conway node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] - - Print hash of a node's operational BLS key. - Usage: cardano-cli conway node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING @@ -3281,6 +3242,103 @@ Usage: cardano-cli conway transaction txid Print a transaction identifier. +Usage: cardano-cli dijkstra node + + Dijkstra era commands + +Usage: cardano-cli dijkstra node + ( key-gen + | key-gen-KES + | key-gen-VRF + | key-gen-BLS + | key-hash-VRF + | key-hash-BLS + | new-counter + | issue-op-cert + ) + + Node operation commands. + +Usage: cardano-cli dijkstra node key-gen + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --cold-verification-key-file FILEPATH + --cold-signing-key-file FILEPATH + --operational-certificate-issue-counter-file FILEPATH + + Create a key pair for a node operator's offline key and a new certificate + issue counter + +Usage: cardano-cli dijkstra node key-gen-KES + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node KES operational key + +Usage: cardano-cli dijkstra node key-gen-VRF + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node VRF operational key + +Usage: cardano-cli dijkstra node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH + + Create a key pair for a node BLS operational key + +Usage: cardano-cli dijkstra node key-hash-VRF + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational VRF key. + +Usage: cardano-cli dijkstra node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational BLS key. + +Usage: cardano-cli dijkstra node new-counter + ( --stake-pool-verification-key STRING + | --stake-pool-verification-extended-key STRING + | --genesis-delegate-verification-key STRING + | --cold-verification-key-file FILEPATH + ) + --counter-value INT + --operational-certificate-issue-counter-file FILEPATH + + Create a new certificate issue counter + +Usage: cardano-cli dijkstra node issue-op-cert + ( --kes-verification-key STRING + | --kes-verification-key-file FILEPATH + ) + --cold-signing-key-file FILEPATH + --operational-certificate-issue-counter-file FILEPATH + --kes-period NATURAL + --out-file FILEPATH + + Issue a node operational certificate + Usage: cardano-cli latest ( address | key @@ -4003,9 +4061,7 @@ Usage: cardano-cli latest node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -4044,16 +4100,6 @@ Usage: cardano-cli latest node key-gen-VRF Create a key pair for a node VRF operational key -Usage: cardano-cli latest node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH - - Create a key pair for a node BLS operational key - Usage: cardano-cli latest node key-hash-VRF ( --verification-key STRING | --verification-key-file FILEPATH @@ -4062,14 +4108,6 @@ Usage: cardano-cli latest node key-hash-VRF Print hash of a node's operational VRF key. -Usage: cardano-cli latest node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] - - Print hash of a node's operational BLS key. - Usage: cardano-cli latest node new-counter ( --stake-pool-verification-key STRING | --stake-pool-verification-extended-key STRING diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli index 06c6deba86..3fe36322cb 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node.cli @@ -2,9 +2,7 @@ Usage: cardano-cli conway node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -19,8 +17,6 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key - key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. - key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node.cli new file mode 100644 index 0000000000..df86e3683f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli dijkstra node + ( key-gen + | key-gen-KES + | key-gen-VRF + | key-gen-BLS + | key-hash-VRF + | key-hash-BLS + | new-counter + | issue-op-cert + ) + + Node operation commands. + +Available options: + -h,--help Show this help text + +Available commands: + key-gen Create a key pair for a node operator's offline key + and a new certificate issue counter + key-gen-KES Create a key pair for a node KES operational key + key-gen-VRF Create a key pair for a node VRF operational key + key-gen-BLS Create a key pair for a node BLS operational key + key-hash-VRF Print hash of a node's operational VRF key. + key-hash-BLS Print hash of a node's operational BLS key. + new-counter Create a new certificate issue counter + issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_issue-op-cert.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_issue-op-cert.cli new file mode 100644 index 0000000000..c2d5f79f73 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_issue-op-cert.cli @@ -0,0 +1,24 @@ +Usage: cardano-cli dijkstra node issue-op-cert + ( --kes-verification-key STRING + | --kes-verification-key-file FILEPATH + ) + --cold-signing-key-file FILEPATH + --operational-certificate-issue-counter-file FILEPATH + --kes-period NATURAL + --out-file FILEPATH + + Issue a node operational certificate + +Available options: + --kes-verification-key STRING + A Bech32 or hex-encoded hot KES verification key. + --kes-verification-key-file FILEPATH + Filepath of the hot KES verification key. + --cold-signing-key-file FILEPATH + Filepath of the cold signing key. + --operational-certificate-issue-counter-file FILEPATH + The file with the issue counter for the operational + certificate. + --kes-period NATURAL The start of the KES key validity period. + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-BLS.cli similarity index 62% rename from cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli rename to cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-BLS.cli index 89e6e6420b..b4358978b3 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-gen-BLS.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-BLS.cli @@ -1,10 +1,10 @@ -Usage: cardano-cli conway node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH +Usage: cardano-cli dijkstra node key-gen-BLS + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH Create a key pair for a node BLS operational key diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-KES.cli similarity index 58% rename from cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli rename to cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-KES.cli index 4593eea99f..fc4667849e 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-gen-BLS.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-KES.cli @@ -1,12 +1,12 @@ -Usage: cardano-cli node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH +Usage: cardano-cli dijkstra node key-gen-KES + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH - Create a key pair for a node BLS operational key + Create a key pair for a node KES operational key Available options: --key-output-bech32 Format key output to BECH32. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-VRF.cli similarity index 58% rename from cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli rename to cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-VRF.cli index 1163141349..f96a42fcf7 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-gen-BLS.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-VRF.cli @@ -1,12 +1,12 @@ -Usage: cardano-cli latest node key-gen-BLS - [ --key-output-bech32 - | --key-output-text-envelope - | --key-output-format STRING - ] - --verification-key-file FILEPATH - --signing-key-file FILEPATH +Usage: cardano-cli dijkstra node key-gen-VRF + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --verification-key-file FILEPATH + --signing-key-file FILEPATH - Create a key pair for a node BLS operational key + Create a key pair for a node VRF operational key Available options: --key-output-bech32 Format key output to BECH32. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen.cli new file mode 100644 index 0000000000..171a1f2b7d --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen.cli @@ -0,0 +1,29 @@ +Usage: cardano-cli dijkstra node key-gen + [ --key-output-bech32 + | --key-output-text-envelope + | --key-output-format STRING + ] + --cold-verification-key-file FILEPATH + --cold-signing-key-file FILEPATH + --operational-certificate-issue-counter-file FILEPATH + + Create a key pair for a node operator's offline key and a new certificate + issue counter + +Available options: + --key-output-bech32 Format key output to BECH32. + --key-output-text-envelope + Format key output to TEXT_ENVELOPE (default). + --key-output-format STRING + Optional key output format. Accepted output formats + are "text-envelope" and "bech32". The + --key-output-format flag is deprecated and will be + removed in a future version. + --cold-verification-key-file FILEPATH + Filepath of the cold verification key. + --cold-signing-key-file FILEPATH + Filepath of the cold signing key. + --operational-certificate-issue-counter-file FILEPATH + The file with the issue counter for the operational + certificate. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-BLS.cli similarity index 54% rename from cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli rename to cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-BLS.cli index 72ee5c99d7..a0b4632a3f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_node_key-hash-BLS.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-BLS.cli @@ -1,8 +1,8 @@ -Usage: cardano-cli conway node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] +Usage: cardano-cli dijkstra node key-hash-BLS + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] Print hash of a node's operational BLS key. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-VRF.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-VRF.cli new file mode 100644 index 0000000000..ef3fbf8ebb --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-VRF.cli @@ -0,0 +1,15 @@ +Usage: cardano-cli dijkstra node key-hash-VRF + ( --verification-key STRING + | --verification-key-file FILEPATH + ) + [--out-file FILEPATH] + + Print hash of a node's operational VRF key. + +Available options: + --verification-key STRING + Verification key (Bech32 or hex-encoded). + --verification-key-file FILEPATH + Input filepath of the verification key. + --out-file FILEPATH Optional output file. Default is to write to stdout. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_new-counter.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_new-counter.cli new file mode 100644 index 0000000000..170900c6d0 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_new-counter.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli dijkstra node new-counter + ( --stake-pool-verification-key STRING + | --stake-pool-verification-extended-key STRING + | --genesis-delegate-verification-key STRING + | --cold-verification-key-file FILEPATH + ) + --counter-value INT + --operational-certificate-issue-counter-file FILEPATH + + Create a new certificate issue counter + +Available options: + --stake-pool-verification-key STRING + Stake pool verification key (Bech32 or hex-encoded). + --stake-pool-verification-extended-key STRING + Stake pool verification extended key (Bech32 or + hex-encoded). + --genesis-delegate-verification-key STRING + Genesis delegate verification key (hex-encoded). + --cold-verification-key-file FILEPATH + Filepath of the cold verification key. + --counter-value INT The next certificate issue counter value to use. + --operational-certificate-issue-counter-file FILEPATH + The file with the issue counter for the operational + certificate. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli index bb65c4f755..babb45a768 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node.cli @@ -2,9 +2,7 @@ Usage: cardano-cli latest node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -19,8 +17,6 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key - key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. - key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli deleted file mode 100644 index 7ba8b958a0..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_node_key-hash-BLS.cli +++ /dev/null @@ -1,15 +0,0 @@ -Usage: cardano-cli latest node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] - - Print hash of a node's operational BLS key. - -Available options: - --verification-key STRING - Verification key (Bech32 or hex-encoded). - --verification-key-file FILEPATH - Input filepath of the verification key. - --out-file FILEPATH Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli index cc2eac8f9b..f133ab4c3d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/node.cli @@ -2,9 +2,7 @@ Usage: cardano-cli node ( key-gen | key-gen-KES | key-gen-VRF - | key-gen-BLS | key-hash-VRF - | key-hash-BLS | new-counter | issue-op-cert ) @@ -19,8 +17,6 @@ Available commands: and a new certificate issue counter key-gen-KES Create a key pair for a node KES operational key key-gen-VRF Create a key pair for a node VRF operational key - key-gen-BLS Create a key pair for a node BLS operational key key-hash-VRF Print hash of a node's operational VRF key. - key-hash-BLS Print hash of a node's operational BLS key. new-counter Create a new certificate issue counter issue-op-cert Issue a node operational certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli deleted file mode 100644 index da206ca8bd..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/node_key-hash-BLS.cli +++ /dev/null @@ -1,15 +0,0 @@ -Usage: cardano-cli node key-hash-BLS - ( --verification-key STRING - | --verification-key-file FILEPATH - ) - [--out-file FILEPATH] - - Print hash of a node's operational BLS key. - -Available options: - --verification-key STRING - Verification key (Bech32 or hex-encoded). - --verification-key-file FILEPATH - Input filepath of the verification key. - --out-file FILEPATH Optional output file. Default is to write to stdout. - -h,--help Show this help text