From 45f54695900408a46e7d2d33e5da71de70fa51e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20W=C3=B3jtowicz?= Date: Mon, 15 Apr 2024 19:10:43 +0200 Subject: [PATCH] Add ledger-peer-snapshot to query command: This change introduces query subcommand ledger-peer-snapshot to serialize a snapshot of big ledger peers from the tip of the current chain. --- .../Cardano/CLI/EraBased/Commands/Query.hs | 13 +++ .../src/Cardano/CLI/EraBased/Options/Query.hs | 17 ++++ .../src/Cardano/CLI/EraBased/Run/Query.hs | 49 ++++++++++- .../Cardano/CLI/Types/Errors/QueryCmdError.hs | 3 + .../cardano-cli-golden/files/golden/help.cli | 83 +++++++++++++++++++ .../files/golden/help/allegra_query.cli | 2 + .../allegra_query_ledger-peer-snapshot.cli | 26 ++++++ .../files/golden/help/alonzo_query.cli | 2 + .../alonzo_query_ledger-peer-snapshot.cli | 26 ++++++ .../files/golden/help/babbage_query.cli | 2 + .../babbage_query_ledger-peer-snapshot.cli | 26 ++++++ .../files/golden/help/conway_query.cli | 2 + .../conway_query_ledger-peer-snapshot.cli | 32 +++++++ .../files/golden/help/latest_query.cli | 2 + .../latest_query_ledger-peer-snapshot.cli | 32 +++++++ .../files/golden/help/mary_query.cli | 2 + .../help/mary_query_ledger-peer-snapshot.cli | 26 ++++++ .../files/golden/help/shelley_query.cli | 2 + .../shelley_query_ledger-peer-snapshot.cli | 26 ++++++ 19 files changed, 372 insertions(+), 1 deletion(-) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_ledger-peer-snapshot.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_ledger-peer-snapshot.cli diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs index 5b284be306..915214847e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs @@ -28,6 +28,7 @@ module Cardano.CLI.EraBased.Commands.Query , QueryDRepStakeDistributionCmdArgs (..) , QuerySPOStakeDistributionCmdArgs (..) , QueryTreasuryValueCmdArgs (..) + , QueryLedgerPeerSnapshotCmdArgs (..) , renderQueryCmds , IncludeStake (..) ) @@ -69,6 +70,7 @@ data QueryCmds era | QueryCommitteeMembersStateCmd !(QueryCommitteeMembersStateCmdArgs era) | QueryTreasuryValueCmd !(QueryTreasuryValueCmdArgs era) | QueryProposalsCmd !(QueryProposalsCmdArgs era) + | QueryLedgerPeerSnapshotCmd !QueryLedgerPeerSnapshotCmdArgs deriving (Generic, Show) -- | Fields that are common to most queries @@ -140,6 +142,15 @@ data QueryLedgerStateCmdArgs = QueryLedgerStateCmdArgs } deriving (Generic, Show) +data QueryLedgerPeerSnapshotCmdArgs = QueryLedgerPeerSnapshotCmdArgs + { nodeSocketPath :: !SocketPath + , consensusModeParams :: !ConsensusModeParams + , networkId :: !NetworkId + , target :: !(Consensus.Target ChainPoint) + , outFile :: !(File () Out) + } + deriving (Generic, Show) + data QueryProtocolStateCmdArgs = QueryProtocolStateCmdArgs { commons :: !QueryCommons , mOutFile :: !(Maybe (File () Out)) @@ -266,6 +277,8 @@ renderQueryCmds = \case "query utxo" QueryLedgerStateCmd{} -> "query ledger-state" + QueryLedgerPeerSnapshotCmd{} -> + "query ledger-peer-snapshot" QueryProtocolStateCmd{} -> "query protocol-state" QueryStakeSnapshotCmd{} -> diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs index d1e84b5939..4aeb691713 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs @@ -215,6 +215,13 @@ pQueryCmds era envCli = mconcat [ "Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command)" ] + , Just $ + subParser "ledger-peer-snapshot" $ + Opt.info (pQueryLedgerPeerSnapshotCmd era envCli) $ + Opt.progDesc $ + mconcat + [ "Dump the current snapshot of ledger peers" + ] , Just $ subParser "protocol-state" $ Opt.info (pQueryProtocolStateCmd era envCli) $ @@ -327,6 +334,16 @@ pQueryLedgerStateCmd era envCli = <$> pQueryCommons era envCli <*> pMaybeOutputFile +pQueryLedgerPeerSnapshotCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era) +pQueryLedgerPeerSnapshotCmd era envCli = + fmap QueryLedgerPeerSnapshotCmd $ + QueryLedgerPeerSnapshotCmdArgs + <$> pSocketPath envCli + <*> pConsensusModeParams + <*> pNetworkId envCli + <*> pTarget era + <*> pOutputFile + pQueryProtocolStateCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era) pQueryProtocolStateCmd era envCli = fmap QueryProtocolStateCmd $ diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs index 3a03a26921..804b7479dc 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs @@ -19,6 +19,7 @@ module Cardano.CLI.EraBased.Run.Query , runQueryKesPeriodInfoCmd , runQueryLeadershipScheduleCmd , runQueryLedgerStateCmd + , runQueryLedgerPeerSnapshot , runQueryPoolStateCmd , runQueryProtocolParametersCmd , runQueryProtocolStateCmd @@ -43,7 +44,7 @@ import qualified Cardano.Api as Api import qualified Cardano.Api.Consensus as Consensus import Cardano.Api.Ledger (StandardCrypto, strictMaybeToMaybe) import qualified Cardano.Api.Ledger as L -import Cardano.Api.Network (Serialised (..)) +import Cardano.Api.Network (LedgerPeerSnapshot, Serialised (..)) import qualified Cardano.Api.Network as Consensus import Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..)) @@ -103,6 +104,7 @@ runQueryCmds = \case Cmd.QueryStakeDistributionCmd args -> runQueryStakeDistributionCmd args Cmd.QueryStakeAddressInfoCmd args -> runQueryStakeAddressInfoCmd args Cmd.QueryLedgerStateCmd args -> runQueryLedgerStateCmd args + Cmd.QueryLedgerPeerSnapshotCmd args -> runQueryLedgerPeerSnapshot args Cmd.QueryStakeSnapshotCmd args -> runQueryStakeSnapshotCmd args Cmd.QueryProtocolStateCmd args -> runQueryProtocolStateCmd args Cmd.QueryUTxOCmd args -> runQueryUTxOCmd args @@ -834,6 +836,38 @@ runQueryLedgerStateCmd & onLeft (left . QueryCmdAcquireFailure) & onLeft left +runQueryLedgerPeerSnapshot + :: () + => Cmd.QueryLedgerPeerSnapshotCmdArgs + -> ExceptT QueryCmdError IO () +runQueryLedgerPeerSnapshot + Cmd.QueryLedgerPeerSnapshotCmdArgs + { Cmd.nodeSocketPath + , Cmd.consensusModeParams + , Cmd.networkId + , Cmd.target + , Cmd.outFile + } = do + let localNodeConnInfo = LocalNodeConnectInfo consensusModeParams networkId nodeSocketPath + + join $ + lift + ( executeLocalStateQueryExpr localNodeConnInfo target $ runExceptT $ do + AnyCardanoEra era <- + lift queryCurrentEra + & onLeft (left . QueryCmdUnsupportedNtcVersion) + + sbe <- + requireShelleyBasedEra era + & onNothing (left QueryCmdByronEra) + + result <- easyRunQuery (queryLedgerPeerSnapshot sbe) + + pure $ shelleyBasedEraConstraints sbe (writeLedgerPeerSnapshot outFile) result + ) + & onLeft (left . QueryCmdAcquireFailure) + & onLeft left + runQueryProtocolStateCmd :: () => Cmd.QueryProtocolStateCmdArgs @@ -1040,6 +1074,19 @@ writeLedgerState mOutFile qState@(SerialisedDebugLedgerState serLedgerState) = LBS.writeFile fpath $ unSerialised serLedgerState +-- | Writes JSON-encoded big ledger peer snapshot +writeLedgerPeerSnapshot + :: File () Out + -> Serialised LedgerPeerSnapshot + -> ExceptT QueryCmdError IO () +writeLedgerPeerSnapshot outPath serBigLedgerPeerSnapshot = do + snapshot <- + firstExceptT QueryCmdBigLedgerPeerSnapshotError $ + hoistEither (decodeBigLedgerPeerSnapshot serBigLedgerPeerSnapshot) + firstExceptT QueryCmdWriteFileError $ + newExceptT . writeLazyByteStringOutput (Just outPath) $ + encodePretty snapshot + writeStakeSnapshots :: forall era ledgerera . () diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs index 1589963411..560bc75b51 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs @@ -55,6 +55,7 @@ data QueryCmdError | QueryCmdSPOKeyError !(FileError InputDecodeError) | QueryCmdCommitteeColdKeyError !(FileError InputDecodeError) | QueryCmdCommitteeHotKeyError !(FileError InputDecodeError) + | QueryCmdBigLedgerPeerSnapshotError DecoderError deriving Show mkEraMismatchError :: NodeEraMismatchError -> QueryCmdError @@ -121,3 +122,5 @@ renderQueryCmdError = \case "Error reading committee cold key: " <> prettyError e QueryCmdCommitteeHotKeyError e -> "Error reading committee hot key: " <> prettyError e + QueryCmdBigLedgerPeerSnapshotError decoderError -> + "Error decoding big ledger peer snapshot: " <> pshow decoderError 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 853ac83bfc..1152cf7eca 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -1360,6 +1360,7 @@ Usage: cardano-cli shelley query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -1448,6 +1449,16 @@ Usage: cardano-cli shelley query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli shelley query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli shelley query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -2411,6 +2422,7 @@ Usage: cardano-cli allegra query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -2499,6 +2511,16 @@ Usage: cardano-cli allegra query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli allegra query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli allegra query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -3460,6 +3482,7 @@ Usage: cardano-cli mary query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -3548,6 +3571,16 @@ Usage: cardano-cli mary query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli mary query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli mary query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -4508,6 +4541,7 @@ Usage: cardano-cli alonzo query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -4596,6 +4630,16 @@ Usage: cardano-cli alonzo query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli alonzo query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli alonzo query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -5605,6 +5649,7 @@ Usage: cardano-cli babbage query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -5693,6 +5738,16 @@ Usage: cardano-cli babbage query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli babbage query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli babbage query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -7243,6 +7298,7 @@ Usage: cardano-cli conway query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -7351,6 +7407,19 @@ Usage: cardano-cli conway query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli conway query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + [ --volatile-tip + | --immutable-tip + ] + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli conway query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] @@ -9264,6 +9333,7 @@ Usage: cardano-cli latest query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -9372,6 +9442,19 @@ Usage: cardano-cli latest query ledger-state --socket-path SOCKET_PATH Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) +Usage: cardano-cli latest query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + [ --volatile-tip + | --immutable-tip + ] + --out-file FILEPATH + + Dump the current snapshot of ledger peers + Usage: cardano-cli latest query protocol-state --socket-path SOCKET_PATH [--cardano-mode [--epoch-slots SLOTS]] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query.cli index 3bbf0ea761..7236fcc601 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli allegra query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -33,6 +34,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..5ead42d469 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_ledger-peer-snapshot.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli allegra query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query.cli index f4c913ddaf..b4903b4842 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli alonzo query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -33,6 +34,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..6c6cd34b27 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_ledger-peer-snapshot.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli alonzo query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query.cli index a399cfcf69..c9f5923cf9 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli babbage query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -33,6 +34,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..189a485fae --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_ledger-peer-snapshot.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli babbage query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --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_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query.cli index 694e2d48a1..0ba9f647ed 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli conway query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -41,6 +42,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..36599d30e8 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-peer-snapshot.cli @@ -0,0 +1,32 @@ +Usage: cardano-cli conway query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + [ --volatile-tip + | --immutable-tip + ] + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --volatile-tip Use the volatile tip as a target. (This is the + default) + --immutable-tip Use the immutable tip as a target. + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query.cli index 0d73ff5604..a811abbd4e 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli latest query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -41,6 +42,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..aa6e54a36c --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-peer-snapshot.cli @@ -0,0 +1,32 @@ +Usage: cardano-cli latest query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + [ --volatile-tip + | --immutable-tip + ] + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --volatile-tip Use the volatile tip as a target. (This is the + default) + --immutable-tip Use the immutable tip as a target. + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query.cli index 57d3afc421..e8afda0456 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli mary query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -33,6 +34,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..0a9fee4884 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_ledger-peer-snapshot.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli mary query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --out-file FILEPATH The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query.cli index 23a1d9626a..8644582560 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query.cli @@ -6,6 +6,7 @@ Usage: cardano-cli shelley query | stake-address-info | utxo | ledger-state + | ledger-peer-snapshot | protocol-state | stake-snapshot | leadership-schedule @@ -33,6 +34,7 @@ Available commands: address or the whole. ledger-state Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command) + ledger-peer-snapshot Dump the current snapshot of ledger peers protocol-state Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command) stake-snapshot Obtain the three stake snapshots for a pool, plus the diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_ledger-peer-snapshot.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_ledger-peer-snapshot.cli new file mode 100644 index 0000000000..4186f4d5d7 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_ledger-peer-snapshot.cli @@ -0,0 +1,26 @@ +Usage: cardano-cli shelley query ledger-peer-snapshot --socket-path SOCKET_PATH + [--cardano-mode + [--epoch-slots SLOTS]] + ( --mainnet + | --testnet-magic NATURAL + ) + --out-file FILEPATH + + Dump the current snapshot of ledger peers + +Available options: + --socket-path SOCKET_PATH + Path to the node socket. This overrides the + CARDANO_NODE_SOCKET_PATH environment variable. The + argument is optional if CARDANO_NODE_SOCKET_PATH is + defined and mandatory otherwise. + --cardano-mode For talking to a node running in full Cardano mode + (default). + --epoch-slots SLOTS The number of slots per epoch for the Byron era. + (default: 21600) + --mainnet Use the mainnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --testnet-magic NATURAL Specify a testnet magic id. This overrides the + CARDANO_NODE_NETWORK_ID environment variable + --out-file FILEPATH The output file. + -h,--help Show this help text