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

Added a draft proposal section for creating a proposal #487

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
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
200 changes: 198 additions & 2 deletions content/3.community/4.governance/1.governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ You will need **CONST** Testnet tokens to create the proposal on Testnet. There

## Create proposal

In previous versions, the Archway governance module featured specific proposal types and templates for creating proposals. However, with the release of version 6.0.0 of the Archway protocol, this approach has been phased out in favor of a single, standardized method for creating governance proposals.
In previous versions of the Archway protocol, the governance module featured specific proposal types and templates for creating these proposals. However, with the release of version 6.0.0 of the Archway protocol, this approach has been phased out in favor of a single, standardized method for creating governance proposals.

The previous solution was quite restrictive, but now a proposal can execute any message supported by the blockchain. You are now able to execute one or more messages automatically following the approval of a proposal.


You would therefore execute the following command to create a governance proposal:

::tab-card{noOfTabs=2}
Expand Down Expand Up @@ -213,6 +212,203 @@ message MsgSend {

This indicates that `from_address`, `to_address`, and `amount` are mandatory fields, and it also specifies their types, which must be considered. For instance, the `amount` field is of type `cosmos.base.v1beta1.Coin`, so it's necessary to consult the proto definition for this type and structure the fields accordingly.

### Draft proposal

Instead of having to go through the proto files of the respective module to get the structure of the message to be submitted, the protocol has implemented a process to help you draft the proposal message required for each module to be used by the `submit-proposal` command which is stored in a `draft_proposal.json` file. A `draft_metadata.json` file is also generated and is meant to be uploaded to `IPFS`.

You would execute the following command to start the draft porposal process:

```shell
$ archwayd tx gov draft-proposal
```

You will then see a prompt asking you to select the proposal type and you will use the arrow keys to navigate:

```
Use the arrow keys to navigate: ↓ ↑ → ←
? Select proposal type:
▸ text
community-pool-spend
software-upgrade
cancel-software-upgrade
other
```

Let's go over the options:
- **text**: A text proposal is a type of governance proposal used to suggest and vote on changes or updates within the blockchain's governance system that does not involve code changes but can influence policies, upgrades, or other significant decisions regarding the network.
- **community-pool-spend**: This proposal type allows the community to allocate funds from the `community pool` (which is is a reserve of funds collected from network fees and other sources) to specific projects, initiatives, or expenses.
- **software-upgrade**: Is a type of governance proposal used to upgrade the network's software to a new version.
- **cancel-software-upgrade**: As its name suggests, this proposal provides a mechanism that allows for cancelling a previously approved and scheduled software upgrade.
- **other**: This covers all other module specific proposal within the aarchway protocol and when you select this option you will see a long list of proposals types to select from.

Let's go through a basic `text` proposal.

**Step 1**: You will first be asked to enter a `Title`:

```
✔ text
✗ Enter proposal title: Update governance code of conduct
```

**Step 2**: Next you'll enter the proposal authors:

```
✔ text
...
✔ Enter proposal authors: John Doe█
```

**Step 3**: Now it asks for the proposal summary:

```
✔ text
...
✔ Enter proposal summary: This proposal aims to update the governance code of conduct to enhance clarity, inclusivity, and enforceability within our community.█
```

**Step 4**: Add the proposal details:

```
✔ text
...
✔ Enter proposal details: This proposal aims to update the governance code of conduct to enhance clarity, inclusivity, and enforceability within our community. By clarifying guidelines, promoting inclusivity, and establishing robust enforcement mechanisms, we intend to create a safer and more welcoming environment for all participants.
```

**Step 5**: Next you add a link to the proposal forum:

```
✔ text
...
✔ Enter proposal proposal forum url: https://gov.archway.io/t/update-governance-code-of-conduct/593/4
```

**Step 6**: You are now required to add the vote option context. The proposal vote option set consists of the choices available to participants when casting their vote. The primary options are: Yes, No, NoWithVeto, and Abstain. The NoWithVeto option functions as a No vote while also contributing a Veto vote. The Abstain option allows voters to indicate that they neither support nor oppose the proposal but are willing to accept the outcome of the vote.:

```
✔ text
...
✔ Enter proposal vote option context: Yes, No, NoWithVeto, Abstain
```

**Step 7**: For this proposal type the last step is to enter the deposit amount which must be at least the minimum deposit that can be found from the `archwayd q gov params --node <node_url>` command:

```
✔ text
...
✔ Enter proposal deposit: 1000000000000000000aconst
```

Once this deposit amount is submitted you will see the following message:

```
The draft proposal has successfully been generated.
Proposals should contain off-chain metadata, please upload the metadata JSON to IPFS.
Then, replace the generated metadata field with the IPFS CID.
```

Two new files `draft_proposal.json` and `draft_metadata.json` are created in the same directory as you entered the command from. The following are the contents of both files:

`draft_proposal.json`:

```json
{
"metadata": "ipfs://CID",
"deposit": "1000000000000000000aconst",
"title": "Update governance code of conduct",
"summary": "This proposal aims to update the governance code of conduct to enhance clarity, inclusivity, and enforceability within our community."
}
```

`draft_metadata.json`:

```json
{
"title": "Update governance code of conduct",
"authors": [
"John Doe"
],
"summary": "This proposal aims to update the governance code of conduct to enhance clarity, inclusivity, and enforceability within our community.",
"details": "This proposal aims to update the governance code of conduct to enhance clarity, inclusivity, and enforceability within our community. By clarifying guidelines, promoting inclusivity, and establishing $
"proposal_forum_url": "https://gov.archway.io/t/update-governance-code-of-conduct/593/4",
"vote_option_context": "Yes, No, NoWithVeto, Abstain"
}
```

The file `draft_metadata.json` is referenced within the `draft_proposal.json` file in the `metadata` attribute. You can store `draft_metadata.json` on IPFS and set the `metadata` attribute to the IPFS URL or it can be base64 encoded string, raw text or stringified json of the data.

If we select the `other` type the following would be an example of what is shown:

```
✔ other
Use the arrow keys to navigate: ↓ ↑ → ←
? Select proposal message type::
▸ /archway.callback.v1.MsgCancelCallback
/archway.callback.v1.MsgRequestCallback
/archway.callback.v1.MsgUpdateParams
/archway.cwerrors.v1.MsgSubscribeToError
↓ /archway.cwerrors.v1.MsgUpdateParams
```

Lets say we selected `/archway.callback.v1.MsgUpdateParams` the following is an example of the `draft_proposal.json` and `draft_metadata.json` files:

`draft_proposal.json`:

```json
{
"messages": [
{
"@type": "/archway.cwerrors.v1.MsgUpdateParams",
"authority": "archway10d07y265gmmuvt4z0w9aw880jnsr700j0f0puy",
"params": {
"error_stored_time": "0",
"subscription_fee": {
"denom": "",
"amount": "0"
},
"subscription_period": "0"
}
}
],
"metadata": "ipfs://CID",
"deposit": "1000000000000000000aconst",
"title": "Update the callback_gas_limit",
"summary": "Increase the limit from 150000 to 250000"
}
```
<br />

::alert{variant="info"}
As this is just a template, you will need to make sure the message values are set correctly. In this particular case, the authority and params which were not entered in any of the prompts. All params must be supplied and you will need to check the proto file for the respective module to get the list of params that should be supplied. For this example you would find the `MsgUpdateParams` [here](https://github.com/archway-network/archway/blob/main/proto/archway/callback/v1/tx.proto#L25-L33) with the actual params attributes [here](https://github.com/archway-network/archway/blob/main/proto/archway/callback/v1/callback.proto#L40-L51).
#title
Please Note
::

For the `callback` module you will need to add all these params:

- callback_gas_limit
- max_block_reservation_limit
- max_future_reservation_limit
- block_reservation_fee_multiplier
- future_reservation_fee_multiplier

You can query the `callback` module to get the [current values](https://api.mainnet.archway.io/archway/callback/v1/params) and update those values you would want to change.

`draft_metadata.json`:

```json
{
"title": "Update the callback_gas_limit",
"authors": [
"John Doe, Jane Doe"
],
"summary": "Increase the limit from 150000 to 250000",
"details": "This increase allows for more complex transactions",
"proposal_forum_url": "https://gov.archway.io/t/update-callback-gas-limit/599/6",
"vote_option_context": "Yes, No, NoWithVeto, Abstain"
}
```


## Depositing funds after a proposal has been submitted

If you've submitted a proposal without yet meeting the minimum token deposit, there's no need to worry! You still have time to deposit additional tokens to advance your proposal to the voting stage if the deposit time period has not elapsed. For instance, you can execute the following command:
Expand Down