Skip to content

Commit

Permalink
Add query proposals
Browse files Browse the repository at this point in the history
Add query proposals
  • Loading branch information
CarlosLopezDeLara committed Jan 17, 2025
1 parent 8e6fa42 commit 3c2a343
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/get-started/cardano-cli/governance/gov-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,55 @@ keywords: [Governance, queries, CIP1694]

There are various queries you can do to your local node to find relevant information about different aspects of teh governance state.

### Query proposals

#### Query all proposals
This query returns all the proposals that can be ratified in the current epoch. This means that it excludes proposals that were submitted on the current epoch, as these cannot be ratified on the current epoch.

```shell
cardano-cli conway query proposals --all-proposals
```
#### Query proposal by ID
To query an individual proposal by its governance action id:

```shell
cardano-cli conway query proposals \
--governance-action-tx-id d098afe0db98605c243c13c8a537a3eb51e6ded5e3a48acca83e7082a0086428 \ --governance-action-index 0


[
{
"actionId": {
"govActionIx": 0,
"txId": "d098afe0db98605c243c13c8a537a3eb51e6ded5e3a48acca83e7082a0086428"
},
"committeeVotes": {},
"dRepVotes": {
"keyHash-68a5f1348300ada6dcec67f9421bdac62ba621006408ece8c8e551d6": "VoteNo"
},
"expiresAfter": 842,
"proposalProcedure": {
"anchor": {
"dataHash": "42af10d2f864ace50d41ff7c9c93aa51c6ab0ca57d956653fb67353d97b57400",
"url": "https://bafybeigzrnrb3njfuomjsma7zdrcjoz3a4ku2kqafeqerbuquytdl6nxjy.ipfs.dweb.link/?filename=data%20(5).jsonld"
},
"deposit": 100000000000,
"govAction": {
"tag": "InfoAction"
},
"returnAddr": {
"credential": {
"keyHash": "79bb181ab55772b961a883a2a24e73a5416e163375817c898993f120"
},
"network": "Testnet"
}
},
"proposedIn": 812,
"stakePoolVotes": {}
}
]
```

### Query the gov-state

We are showing only the top level keys of the governance state, the dump is to large to show on this tutorial.
Expand Down

0 comments on commit 3c2a343

Please sign in to comment.