From 5e829fe132049abe53a5404c111a465ed8a7d8b6 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 10 Nov 2025 11:58:07 +0100 Subject: [PATCH] feat(query): add get_ledger_peer_snapshot method Introduce get_ledger_peer_snapshot to QueryGroup for retrieving the current snapshot of ledger peers via the CLI. --- cardano_clusterlib/query_group.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cardano_clusterlib/query_group.py b/cardano_clusterlib/query_group.py index e0df769..eb41908 100644 --- a/cardano_clusterlib/query_group.py +++ b/cardano_clusterlib/query_group.py @@ -739,5 +739,10 @@ def get_stake_pool_default_vote( raw_output: str = self.query_cli(["stake-pool-default-vote", *cred_args]).strip().strip('"') return raw_output + def get_ledger_peer_snapshot(self) -> dict[str, tp.Any]: + """Get the current snapshot of ledger peers.""" + out: dict[str, tp.Any] = json.loads(self.query_cli(["ledger-peer-snapshot"])) or {} + return out + def __repr__(self) -> str: return f"<{self.__class__.__name__}: clusterlib_obj={id(self._clusterlib_obj)}>"