Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore stable query cmds #955

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Golden file updates
Jimbo4350 committed Oct 29, 2024
commit ce10769c401febf45e4bd585ab86fc1492cfe134
199 changes: 199 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ Usage: cardano-cli
( address
| key
| node
| query
| legacy
| byron
| shelley
@@ -202,6 +203,204 @@ Usage: cardano-cli node issue-op-cert

Issue a node operational certificate

Usage: cardano-cli query
( protocol-parameters
| tip
| stake-pools
| stake-distribution
| stake-address-info
| utxo
| ledger-state
| protocol-state
| stake-snapshot
| leadership-schedule
| kes-period-info
| pool-state
| tx-mempool
| slot-number
)

Node query commands. Will query the local node whose Unix domain socket is
obtained from the CARDANO_NODE_SOCKET_PATH environment variable.

Usage: cardano-cli query protocol-parameters --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
( --mainnet
| --testnet-magic NATURAL
)
[--out-file FILEPATH]

Get the node's current protocol parameters

Usage: cardano-cli query tip --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Get the node's current tip (slot no, hash, block no)

Usage: cardano-cli query stake-pools --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--output-json | --output-text]
[--out-file FILEPATH]

Get the node's current set of stake pool ids

Usage: cardano-cli query stake-distribution --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
( --mainnet
| --testnet-magic NATURAL
)
[--volatile-tip | --immutable-tip]
[--output-json | --output-text]
[--out-file FILEPATH]

Get the node's current aggregated stake distribution

Usage: cardano-cli query stake-address-info --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
--address ADDRESS
( --mainnet
| --testnet-magic NATURAL
)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Get the current delegations and reward accounts filtered by stake address.

Usage: cardano-cli query utxo --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
( --whole-utxo
| (--address ADDRESS)
| (--tx-in TX-IN)
)
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--output-json | --output-text]
[--out-file FILEPATH]

Get a portion of the current UTxO: by tx in, by address or the whole.

Usage: cardano-cli query ledger-state --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Dump the current ledger state of the node (Ledger.NewEpochState -- advanced
command)

Usage: cardano-cli query protocol-state --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Dump the current protocol state of the node (Ledger.ChainDepState -- advanced
command)

Usage: cardano-cli query stake-snapshot --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
( --all-stake-pools
| (--stake-pool-id STAKE_POOL_ID)
)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Obtain the three stake snapshots for a pool, plus the total active stake
(advanced command)

Usage: cardano-cli query pool-params --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
( --all-stake-pools
| (--stake-pool-id STAKE_POOL_ID)
)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

DEPRECATED. Use query pool-state instead. Dump the pool parameters
(Ledger.NewEpochState.esLState._delegationState._pState._pParams -- advanced
command)

Usage: cardano-cli query leadership-schedule --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
( --mainnet
| --testnet-magic NATURAL
)
--genesis FILEPATH
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILEPATH
| --stake-pool-id STAKE_POOL_ID
)
--vrf-signing-key-file FILEPATH
(--current | --next)
[ --volatile-tip
| --immutable-tip
]
[--output-json | --output-text]
[--out-file FILEPATH]

Get the slots the node is expected to mint a block in (advanced command)

Usage: cardano-cli query kes-period-info --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
--op-cert-file FILEPATH
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Get information about the current KES period and your node's operational
certificate.

Usage: cardano-cli query pool-state --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
( --all-stake-pools
| (--stake-pool-id STAKE_POOL_ID)
)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Dump the pool state

Usage: cardano-cli query tx-mempool --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
(info | next-tx | tx-exists)
[--out-file FILEPATH]

Local Mempool info

Usage: cardano-cli query tx-mempool info

Ask the node about the current mempool's capacity and sizes

Usage: cardano-cli query tx-mempool next-tx

Requests the next transaction from the mempool's current list

Usage: cardano-cli query tx-mempool tx-exists TX_ID

Query if a particular transaction exists in the mempool

Usage: cardano-cli query slot-number --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
TIMESTAMP

Query slot number for UTC timestamp

Usage: cardano-cli legacy Legacy commands

Legacy commands
49 changes: 49 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help/query.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Usage: cardano-cli query
( protocol-parameters
| tip
| stake-pools
| stake-distribution
| stake-address-info
| utxo
| ledger-state
| protocol-state
| stake-snapshot
| leadership-schedule
| kes-period-info
| pool-state
| tx-mempool
| slot-number
)

Node query commands. Will query the local node whose Unix domain socket is
obtained from the CARDANO_NODE_SOCKET_PATH environment variable.

Available options:
-h,--help Show this help text

Available commands:
protocol-parameters Get the node's current protocol parameters
tip Get the node's current tip (slot no, hash, block no)
stake-pools Get the node's current set of stake pool ids
stake-distribution Get the node's current aggregated stake distribution
stake-address-info Get the current delegations and reward accounts
filtered by stake address.
utxo Get a portion of the current UTxO: by tx in, by
address or the whole.
ledger-state Dump the current ledger state of the node
(Ledger.NewEpochState -- advanced command)
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
total active stake (advanced command)
pool-params DEPRECATED. Use query pool-state instead. Dump the
pool parameters
(Ledger.NewEpochState.esLState._delegationState._pState._pParams
-- advanced command)
leadership-schedule Get the slots the node is expected to mint a block in
(advanced command)
kes-period-info Get information about the current KES period and your
node's operational certificate.
pool-state Dump the pool state
tx-mempool Local Mempool info
slot-number Query slot number for UTC timestamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Usage: cardano-cli query kes-period-info --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
--op-cert-file FILEPATH
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Get information about the current KES period and your node's operational
certificate.

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
--op-cert-file FILEPATH Filepath of the node's operational certificate.
--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 Optional output file. Default is to write to stdout.
-h,--help Show this help text
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Usage: cardano-cli query leadership-schedule --socket-path SOCKET_PATH
[--cardano-mode
[--epoch-slots SLOTS]]
( --mainnet
| --testnet-magic NATURAL
)
--genesis FILEPATH
( --stake-pool-verification-key STRING
| --cold-verification-key-file FILEPATH
| --stake-pool-id STAKE_POOL_ID
)
--vrf-signing-key-file FILEPATH
(--current | --next)
[ --volatile-tip
| --immutable-tip
]
[--output-json | --output-text]
[--out-file FILEPATH]

Get the slots the node is expected to mint a block in (advanced command)

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
--genesis FILEPATH Shelley genesis filepath
--stake-pool-verification-key STRING
Stake pool verification key (Bech32 or hex-encoded).
--cold-verification-key-file FILEPATH
Filepath of the stake pool verification key.
--stake-pool-id STAKE_POOL_ID
Stake pool ID/verification key hash (either
Bech32-encoded or hex-encoded).
--vrf-signing-key-file FILEPATH
Input filepath of the VRF signing key.
--current Get the leadership schedule for the current epoch.
--next Get the leadership schedule for the following epoch.
--volatile-tip Use the volatile tip as a target. (This is the
default)
--immutable-tip Use the immutable tip as a target.
--output-json Format leadership-schedule query output to JSON.
Default format when writing to a file
--output-text Format leadership-schedule query output to TEXT.
Default format when writing to stdout
--out-file FILEPATH Optional output file. Default is to write to stdout.
-h,--help Show this help text
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Usage: cardano-cli query ledger-state --socket-path SOCKET_PATH
[--cardano-mode [--epoch-slots SLOTS]]
(--mainnet | --testnet-magic NATURAL)
[--volatile-tip | --immutable-tip]
[--out-file FILEPATH]

Dump the current ledger state of the node (Ledger.NewEpochState -- advanced
command)

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 Optional output file. Default is to write to stdout.
-h,--help Show this help text
Loading