|
| 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 | +``` |
0 commit comments