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/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/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..2e6ae9aaab 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Command.hs @@ -8,7 +8,9 @@ module Cardano.CLI.EraIndependent.Node.Command , NodeKeyGenColdCmdArgs (..) , NodeKeyGenKESCmdArgs (..) , NodeKeyGenVRFCmdArgs (..) + , NodeKeyGenBLSCmdArgs (..) , NodeKeyHashVRFCmdArgs (..) + , NodeKeyHashBLSCmdArgs (..) , NodeNewCounterCmdArgs (..) , NodeIssueOpCertCmdArgs (..) ) @@ -25,7 +27,9 @@ data NodeCmds = NodeKeyGenColdCmd !NodeKeyGenColdCmdArgs | NodeKeyGenKESCmd !NodeKeyGenKESCmdArgs | NodeKeyGenVRFCmd !NodeKeyGenVRFCmdArgs + | NodeKeyGenBLSCmd !NodeKeyGenBLSCmdArgs | NodeKeyHashVRFCmd !NodeKeyHashVRFCmdArgs + | NodeKeyHashBLSCmd !NodeKeyHashBLSCmdArgs | NodeNewCounterCmd !NodeNewCounterCmdArgs | NodeIssueOpCertCmd !NodeIssueOpCertCmdArgs deriving Show @@ -55,6 +59,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) @@ -62,6 +74,13 @@ data NodeKeyHashVRFCmdArgs } deriving Show +data NodeKeyHashBLSCmdArgs + = NodeKeyHashBLSCmdArgs + { vkeySource :: !(VerificationKeyOrFile BlsKey) + , mOutFile :: !(Maybe (File () Out)) + } + deriving Show + data NodeNewCounterCmdArgs = NodeNewCounterCmdArgs { coldVkeyFile :: !ColdVerificationKeyOrFile @@ -89,6 +108,8 @@ 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" + 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 5e5dc6feee..d2ee77ac57 100644 --- a/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Option.hs @@ -1,69 +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-hash-VRF" . Opt.info pKeyHashVRF $ - Opt.progDesc $ - mconcat - [ "Print hash of a node's operational VRF 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 $ @@ -97,6 +119,25 @@ pKeyGenVRF = <*> 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 = fmap Cmd.NodeKeyHashVRFCmd $ @@ -104,6 +145,24 @@ pKeyHashVRF = <$> 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 = fmap Cmd.NodeNewCounterCmd $ @@ -120,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/EraIndependent/Node/Run.hs b/cardano-cli/src/Cardano/CLI/EraIndependent/Node/Run.hs index 50b5cb8f73..20110e76c2 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 @@ -37,7 +38,9 @@ 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.NodeKeyHashBLSCmd args -> runNodeKeyHashBlsCmd args Cmd.NodeNewCounterCmd args -> runNodeNewCounterCmd args Cmd.NodeIssueOpCertCmd args -> runNodeIssueOpCertCmd args @@ -215,6 +218,42 @@ 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 ()) + . writeTextFileWithOwnerPermissions 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 @@ -232,6 +271,22 @@ 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/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 new file mode 100644 index 0000000000..0b9464526b --- /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 + [ "dijkstra" + , "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 + [ "dijkstra" + , "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 + [ "dijkstra" + , "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..dd0ef720fb --- /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 + [ "dijkstra" + , "node" + , "key-hash-BLS" + , "--verification-key-file" + , verificationKeyFile + ] + + H.diffVsGoldenFile verificationKeyHash goldenVerificationKeyHashFile 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 0ed67ceb95..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 @@ -3241,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 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/dijkstra_node_key-gen-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-BLS.cli new file mode 100644 index 0000000000..b4358978b3 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-BLS.cli @@ -0,0 +1,24 @@ +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 + +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/dijkstra_node_key-gen-KES.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-KES.cli new file mode 100644 index 0000000000..fc4667849e --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-KES.cli @@ -0,0 +1,24 @@ +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 + +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/dijkstra_node_key-gen-VRF.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-VRF.cli new file mode 100644 index 0000000000..f96a42fcf7 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-gen-VRF.cli @@ -0,0 +1,24 @@ +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 + +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/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/dijkstra_node_key-hash-BLS.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-BLS.cli new file mode 100644 index 0000000000..a0b4632a3f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/dijkstra_node_key-hash-BLS.cli @@ -0,0 +1,15 @@ +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. + +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_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/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