Skip to content

Commit eac5d3a

Browse files
docs: Improve governance docs with new proposal types and messages [DEV-5394] (#63)
* added cli command for gov proposals * Correct code block and JSON format in upgrade proposal * fix linter errors * fix punctuation and trailing spaces * Add links, use consistent variable naming convention & other fixes * Fix typo --------- Co-authored-by: filipdjokic <djokicf@protonmail.com>
1 parent c26f665 commit eac5d3a

3 files changed

Lines changed: 188 additions & 7 deletions

File tree

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* [Manage accounts](docs/cheqd-cli/cheqd-cli-accounts.md)
1616
* [Manage a node](docs/cheqd-cli/cheqd-cli-node-management.md)
1717
* [Make transactions](docs/cheqd-cli/cheqd-cli-token-transactions.md)
18+
* [Draft governance proposals](docs/cheqd-cli/cheqd-cli-gov-proposals-types.md)
1819
* [Use fee abstraction](docs/cheqd-cli/cheqd-cli-fee-abstraction.md)
1920

2021
## 🏦 Validator Guides
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Using cheqd Cosmos CLI for submitting governance proposals
2+
3+
From Cosmos SDk v0.50+ versions the `gov` module provides a draft json file for all types of proposals. These json files can be generated using the `draft-proposal` subcommand present within the `gov` module.
4+
5+
```bash
6+
cheqd-noded tx gov draft-proposal
7+
Use the arrow keys to navigate: ↓ ↑ → ←
8+
? Select proposal type:
9+
▸ text
10+
community-pool-spend
11+
software-upgrade
12+
cancel-software-upgrade
13+
other
14+
```
15+
16+
It provides an interactive interface and provides a json output using user submitted information. The json file can be submitted on chain for voting using the following command:
17+
18+
```bash
19+
cheqd-noded tx gov submit-proposal [path/to/proposal.json]
20+
--from <key-name> \
21+
--chain-id cheqd-mainnet-1 \
22+
--gas auto \
23+
--gas-adjustment 1.4 \
24+
--gas-prices 5000ncheq
25+
```
26+
27+
## Examples of `proposal.json` for a few commonly submitted proposal types
28+
29+
### 1) Text proposals
30+
31+
```bash
32+
{
33+
"metadata": "ipfs://CID",
34+
"deposit": "8000000000000ncheq",
35+
"title": "<proposal_title>",
36+
"summary": "<proposal_description>",
37+
"expedited": false
38+
}
39+
```
40+
41+
The main parameters here are:
42+
43+
- `proposal_title` - name of the proposal.
44+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
45+
46+
### 2) Community Pool Spend
47+
48+
```bash
49+
{
50+
"messages": [
51+
{
52+
"@type": "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",
53+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
54+
"recipient": "<recipient_address>",
55+
"amount": [
56+
{
57+
"denom": "ncheq",
58+
"amount": "<amount>"
59+
}
60+
]
61+
}
62+
],
63+
"metadata": "ipfs://CID",
64+
"deposit": "8000000000000ncheq",
65+
"title": "<proposal_title>",
66+
"summary": "<proposal_description>",
67+
"expedited": false
68+
}
69+
```
70+
71+
The main parameters here are:
72+
73+
- `proposal_title` - name of the proposal.
74+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
75+
- `recipient_address`- cheqd address to which the community pool tokens should be sent.
76+
- `amount` - amount of tokens to be sent to the recipient address.
77+
78+
### 3) Software upgrade
79+
80+
```json
81+
{
82+
"messages": [
83+
{
84+
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
85+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
86+
"plan": {
87+
"name": "<proposal_name>",
88+
"time": "0001-01-01T00:00:00Z",
89+
"height": "<upgrade_height>",
90+
"info": "<upgrade_info>",
91+
"upgraded_client_state": null
92+
}
93+
}
94+
],
95+
"metadata": "ipfs://CID",
96+
"deposit": "8000000000000ncheq",
97+
"title": "<proposal_title>",
98+
"summary": "<proposal_description>",
99+
"expedited": false
100+
}
101+
```
102+
103+
The main parameters here are:
104+
105+
- `proposal_title` - name of the proposal.
106+
- `proposal_name` - name of proposal which will be used in `UpgradeHandler` in the new application,
107+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
108+
- `upgrade_height` - height when upgrade process will be triggered. Keep in mind that this needs to be after voting period has ended.
109+
- `upgrade_info` - link to the upgrade info file, containing new binaries. Needs to contain sha256 checksum. See example - `https://raw.githubusercontent.com/cheqd/cheqd-node/refs/heads/main/networks/mainnet/upgrades/upgrade-v3.json?checksum=sha256:5989f7d5bca686598c315eb74e8eb507d7f9f417d71008a31a6b828c48ce45eb`
110+
- `operator_alias` - alias of a key which will be used for signing proposal.
111+
- `<chain_id>` - identifier of chain which will be used while creating the blockchain.
112+
113+
### 4) IBC Recover Client
114+
115+
```bash
116+
{
117+
"messages": [
118+
{
119+
"@type": "/ibc.core.client.v1.MsgRecoverClient",
120+
"subject_client_id": "<expired_client-id>",
121+
"substitute_client_id": "<new_client-id>",
122+
"signer": "prop_submitter_address>"
123+
}
124+
],
125+
"metadata": "ipfs://CID",
126+
"deposit": "8000000000000ncheq",
127+
"title": "<proposal_title>",
128+
"summary": "<proposal_description>",
129+
"expedited": false
130+
}
131+
```
132+
133+
The main parameters here are:
134+
135+
- `proposal_title` - name of the proposal.
136+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
137+
- `expired_client_id` - IBC client id of the expired connection.
138+
- `new_client_id` - IBC client id of the replacement connection.
139+
- `prop_submitter_address` - Cheqd address of the user who will submit the proposal.
140+
141+
## Expedited Proposals
142+
143+
Cosmos SDK v0.50+ also added support for **expedited proposals**. Expedited proposals have shorter a voting period and a higher tally threshold by default. If an expedited proposal fails to meet the threshold within the shorter voting period, it is then automatically converted to a regular proposal and restarts voting under regular voting conditions.
144+
145+
### Submitting expedited proposals
146+
147+
Any and all proposals can be submitted as expedited proposals by switching the `expedited` field to `true` in proposal.json file. Eg;-
148+
149+
```bash
150+
{
151+
"metadata": "ipfs://CID",
152+
"deposit": "8000000000000ncheq",
153+
"title": "<proposal_title>",
154+
"summary": "<proposal_description>",
155+
"expedited": true
156+
}
157+
```

docs/upgrades/propose-software-upgrade.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The next steps are describing the general flow for making a proposal:
1616

1717
- Send proposal command to the pool;
1818
- After getting it, ledger will be in the `PROPOSAL_STATUS_DEPOSIT_PERIOD`;
19-
- After sending the first deposit from one of other operators, proposal status will be moved to `PROPOSAL_STATUS_VOTING_PERIOD` and voting period (2 weeks for now) will be started;
19+
- After sending the first deposit from one of other operators, proposal status will be moved to `PROPOSAL_STATUS_VOTING_PERIOD` and voting period (5 days for now) will be started;
2020
- Due to the voting period operators should send their votes to the pool, get new binary downloaded and got to be installed;
2121
- After voting period passing (for now it's 2 weeks) in case of success voting process proposal should be passed to `PROPOSAL_STATUS_PASSED`;
2222
- The next step is waiting for `height` which was suggested for upgrade.
@@ -25,28 +25,51 @@ The next steps are describing the general flow for making a proposal:
2525
#### Command for sending proposal
2626

2727
```bash
28-
cheqd-noded tx gov submit-legacy-proposal software-upgrade <proposal_name> \
29-
--title "<proposal_title>" \
30-
--description "<proposal_description>" \
31-
--upgrade-height <upgrade_height> \
32-
--upgrade-info <upgrade_info> \
33-
--deposit 8000000000000ncheq \
28+
cheqd-noded tx gov submit-proposal [path/to/proposal.json]
3429
--from <operator_alias> \
3530
--chain-id cheqd-mainnet-1 \
3631
--gas auto \
3732
--gas-adjustment 1.4 \
3833
--gas-prices 5000ncheq
3934
```
4035

36+
Where the contents of `proposal.json` are in the following format:
37+
38+
```json
39+
{
40+
"messages": [
41+
{
42+
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
43+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
44+
"plan": {
45+
"name": "<proposal_name>",
46+
"time": "0001-01-01T00:00:00Z",
47+
"height": "<upgrade_height>",
48+
"info": "<upgrade_info>",
49+
"upgraded_client_state": null
50+
}
51+
}
52+
],
53+
"metadata": "ipfs://CID",
54+
"deposit": "8000000000000ncheq",
55+
"title": "<proposal-title>",
56+
"summary": "<proposal_description>",
57+
"expedited": false
58+
}
59+
```
60+
4161
The main parameters here are:
4262

63+
- `proposal-title` - name of the proposal.
4364
- `proposal_name` - name of proposal which will be used in `UpgradeHandler` in the new application,
4465
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links,
4566
- `upgrade_height` - height when upgrade process will be occurred. Keep in mind that this needs to be after voting period has ended.
4667
- `upgrade_info` - link to the upgrade info file, containing new binaries. Needs to contain sha256 checksum. See example - `https://raw.githubusercontent.com/cheqd/cheqd-node/refs/heads/main/networks/mainnet/upgrades/upgrade-v3.json?checksum=sha256:5989f7d5bca686598c315eb74e8eb507d7f9f417d71008a31a6b828c48ce45eb`
4768
- `operator_alias` - alias of a key which will be used for signing proposal,
4869
- `<chain_id>` - identifier of chain which will be used while creating the blockchain.
4970

71+
Follow our [guide for drafting governance proposal](../cheqd-cli/cheqd-cli-gov-proposals-types.md) if you need help with creating the proposal file.
72+
5073
In case of successful submitting the next command can be used for getting `proposal_id`:
5174

5275
```bash

0 commit comments

Comments
 (0)