Skip to content

Commit 7ba0e1d

Browse files
added cli command for gov proposals
1 parent c26f665 commit 7ba0e1d

2 files changed

Lines changed: 171 additions & 7 deletions

File tree

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
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:
16+
```bash
17+
cheqd-noded tx gov submit-proposal [path/to/proposal.json]
18+
--from <key-name> \
19+
--chain-id cheqd-mainnet-1 \
20+
--gas auto \
21+
--gas-adjustment 1.4 \
22+
--gas-prices 5000ncheq
23+
```
24+
25+
## Examples of `proposal.json` for a few commonly submitted proposal types:
26+
27+
### 1) Text proposals:
28+
```bash
29+
{
30+
"metadata": "ipfs://CID",
31+
"deposit": "8000000000000ncheq",
32+
"title": "<proposal-title>",
33+
"summary": "<proposal-description>",
34+
"expedited": false
35+
}
36+
```
37+
The main parameters here are:
38+
39+
- `proposal-title` - name of the proposal.
40+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
41+
42+
### 2) Community Pool Spend:
43+
```bash
44+
{
45+
"messages": [
46+
{
47+
"@type": "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",
48+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
49+
"recipient": "<recipient-address>",
50+
"amount": [
51+
{
52+
"denom": "ncheq",
53+
"amount": "<amount>"
54+
}
55+
]
56+
}
57+
],
58+
"metadata": "ipfs://CID",
59+
"deposit": "8000000000000ncheq",
60+
"title": "<proposal-title>",
61+
"summary": "<proposal-description>",
62+
"expedited": false
63+
}
64+
```
65+
The main parameters here are:
66+
67+
- `proposal-title` - name of the proposal.
68+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
69+
- `recipient-address`- cheqd address to which the community pool tokens should be sent.
70+
- `amount` - amount of tokens to be sent to the recipient address.
71+
72+
### 3) Software upgrade:
73+
```
74+
{
75+
"messages": [
76+
{
77+
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
78+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
79+
"plan": {
80+
"name": "<proposal_name>",
81+
"time": "0001-01-01T00:00:00Z",
82+
"height": "<upgrade_height>",
83+
"info": "<upgrade_info>",
84+
"upgraded_client_state": null
85+
}
86+
}
87+
],
88+
"metadata": "ipfs://CID",
89+
"deposit": "8000000000000ncheq",
90+
"title": "<proposal-title>",
91+
"summary": "<proposal_description>",
92+
"expedited": false
93+
}
94+
```
95+
96+
The main parameters here are:
97+
98+
- `proposal-title` - name of the proposal.
99+
- `proposal_name` - name of proposal which will be used in `UpgradeHandler` in the new application,
100+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
101+
- `upgrade_height` - height when upgrade process will be triggered. Keep in mind that this needs to be after voting period has ended.
102+
- `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`
103+
- `operator_alias` - alias of a key which will be used for signing proposal.
104+
- `<chain_id>` - identifier of chain which will be used while creating the blockchain.
105+
106+
### 4) IBC Recover Client:
107+
```bash
108+
{
109+
"messages": [
110+
{
111+
"@type": "/ibc.core.client.v1.MsgRecoverClient",
112+
"subject_client_id": "<expired-client-id>",
113+
"substitute_client_id": "<new-client-id>",
114+
"signer": "prop-submitter-address>"
115+
}
116+
],
117+
"metadata": "ipfs://CID",
118+
"deposit": "8000000000000ncheq",
119+
"title": "<proposal-title>",
120+
"summary": "<proposal_description>",
121+
"expedited": false
122+
}
123+
```
124+
- `proposal-title` - name of the proposal.
125+
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links.
126+
- `expired-client-id` - IBC client id of the expired connection.
127+
- `new-client-id` - IBC client id of the replacement connection.
128+
- `prop-submitter-address` - Cheqd address of the user who will submit the proposal.
129+
130+
## Expedited Proposals
131+
132+
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.
133+
134+
### Submitting expedited proposals
135+
136+
Any and all proposals can be submitted as expedited proposals by switching the `expedited` field to `true` in proposal.json file. Eg;-
137+
```bash
138+
{
139+
"metadata": "ipfs://CID",
140+
"deposit": "8000000000000ncheq",
141+
"title": "<proposal-title>",
142+
"summary": "<proposal-description>",
143+
"expedited": true
144+
}
145+
```

docs/upgrades/propose-software-upgrade.md

Lines changed: 26 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,21 +25,40 @@ 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
```
35+
Where the contents of `proposal.json` are in the following format
36+
```
37+
{
38+
"messages": [
39+
{
40+
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
41+
"authority": "cheqd10d07y265gmmuvt4z0w9aw880jnsr700j5ql9az",
42+
"plan": {
43+
"name": "<proposal_name>",
44+
"time": "0001-01-01T00:00:00Z",
45+
"height": "<upgrade_height>",
46+
"info": "<upgrade_info>",
47+
"upgraded_client_state": null
48+
}
49+
}
50+
],
51+
"metadata": "ipfs://CID",
52+
"deposit": "8000000000000ncheq",
53+
"title": "<proposal-title>",
54+
"summary": "<proposal_description>",
55+
"expedited": false
56+
}
57+
```
4058

4159
The main parameters here are:
4260

61+
- `proposal-title` - name of the proposal.
4362
- `proposal_name` - name of proposal which will be used in `UpgradeHandler` in the new application,
4463
- `proposal_description` - proposal description; limited to 255 characters; you can use json markdown to provide links,
4564
- `upgrade_height` - height when upgrade process will be occurred. Keep in mind that this needs to be after voting period has ended.

0 commit comments

Comments
 (0)