Create a proposal

Create a new governance proposal on dHealth

To create a new proposal on dHealth, we need to do several things:

1. Preliminary Forum Discussions

Proposals should be submitted to the dHealth's #proposals Discord channel for review and discussion prior to being submitted on-chain.

This will enable preliminary exploration amongst community members to fully understand the scope of the proposal, provide input/ feedback, and ultimately improve the proposal before pushing toward a formal on-chain vote.

Proposals are encouraged to be posted to the forum one day to several days before being submitted for voting on-chain. Author can decide this according to the complexity and/or the range of effect of the proposal.

2. Create a draft proposal

To create a draft proposal, you can use the command:

dhealthd tx gov draft-proposal
dhealth-testnetd tx gov draft-proposal

You will receive a response like this:

? Select proposal type: 
  ▸ text
    community-pool-spend
    software-upgrade
    cancel-software-upgrade
    other

Choose your proposal type accordingly. Parameter changes for example are in the other choice.

In this example let's choose a staking module's MsgUpdateParams proposal:

dhealthd tx gov draft-proposal
✔ other
Use the arrow keys to navigate: ↓ ↑ → ← 
? Select proposal message type:: 
↑   /cosmos.staking.v1beta1.MsgDelegate
    /cosmos.staking.v1beta1.MsgEditValidator
    /cosmos.staking.v1beta1.MsgUndelegate
  ▸ /cosmos.staking.v1beta1.MsgUpdateParams
↓   /cosmos.upgrade.v1beta1.MsgCancelUpgrade
dhealth-testnetd tx gov draft-proposal
✔ other
Use the arrow keys to navigate: ↓ ↑ → ← 
? Select proposal message type:: 
↑   /cosmos.staking.v1beta1.MsgDelegate
    /cosmos.staking.v1beta1.MsgEditValidator
    /cosmos.staking.v1beta1.MsgUndelegate
  ▸ /cosmos.staking.v1beta1.MsgUpdateParams
↓   /cosmos.upgrade.v1beta1.MsgCancelUpgrade

The cli will ask you for the proposal's details:

dhealthd tx gov draft-proposal
✔ other
Enter proposal's title: your proposal title
Enter proposal's authors: the address, or name you want to let people know
Enter proposal's summary: your proposal summary
Enter proposal's details: your proposal details
Enter proposal's proposal forum url: http://proposal-discussion.com
Enter proposal's vote option context: your proposal's vote options context
Enter proposal deposit: 50000000udhp
Enter msg's authority: dh10d07y265gmmuvt4z0w9aw880jnsr700jghwrtj
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.
dhealth-testnetd tx gov draft-proposal
✔ other
Enter proposal's title: your proposal title
Enter proposal's authors: the address, or name you want to let people know
Enter proposal's summary: your proposal summary
Enter proposal's details: your proposal details
Enter proposal's proposal forum url: http://proposal-discussion.com
Enter proposal's vote option context: your proposal's vote options context
Enter proposal deposit: 50000000utdhp
Enter msg's authority: dh0210d07y265gmmuvt4z0w9aw880jnsr700jzcu0p4
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.

Some points to be noticed of:

  • Proposal deposit should be 50 DHP - 50000000udhp (mainnet) or 50 tDHP - 50000000utdhp (testnet) if you want the proposal to immediately goes into voting phase.
    If you set a smaller deposit amount, the proposal when submitted will enter deposit phase and you and everyone else who are in support of introducing this proposal will have 48 hours to make a total deposit of 50 DHP or 50 tDHP. After this deadline the proposal is closed and voting will not take place.
  • Msg's authority is filled automatically by the cli and should be left as is. This is the authority account which will hold your deposits and will return to your account (in case the proposal is passed/rejected) or will burn (in case the proposal is rejected with veto).

If you have filled all the required fields, you should be able to see 2 files generated:

  • draft_proposal.json and
  • draft_metadata.json

You can construct these 2 files manually too and they can be named anything. The cli is supposed to help you by generating a template so that you don't have to create the structure yourself.

3. Specify the changes/content of the proposal

The draft_proposal.json file should initially look like this:

{
 "messages": [
  {
   "@type": "/cosmos.staking.v1beta1.MsgUpdateParams",
   "authority": "dh10d07y265gmmuvt4z0w9aw880jnsr700jghwrtj",
   "params": {
    "unbonding_time": "0s",
    "max_validators": 0,
    "max_entries": 0,
    "historical_entries": 0,
    "bond_denom": "",
    "min_commission_rate": "0.000000000000000000"
   }
  }
 ],
 "metadata": "ipfs://CID",
 "deposit": "50000000udhp",
 "title": "your proposal title",
 "summary": "your proposal summary"
}
{
 "messages": [
  {
   "@type": "/cosmos.staking.v1beta1.MsgUpdateParams",
   "authority": "dh0210d07y265gmmuvt4z0w9aw880jnsr700jzcu0p4",
   "params": {
    "unbonding_time": "0s",
    "max_validators": 0,
    "max_entries": 0,
    "historical_entries": 0,
    "bond_denom": "",
    "min_commission_rate": "0.000000000000000000"
   }
  }
 ],
 "metadata": "ipfs://CID",
 "deposit": "50000000utdhp",
 "title": "your proposal title",
 "summary": "your proposal summary"
}

In this example of staking.v1beta1.MsgUpdateParams proposal, we can see that the params fields have not been set. We need to specify them according to the goal of the proposal.

Let's make a change to the unbonding_time value, increasing it to 48 hours (172,800 seconds) for example.

  • First we need to know the current value of all the staking's parameters:
dhealthd q staking params

bond_denom: udhp
historical_entries: 10000
max_entries: 7
max_validators: 100
min_commission_rate: "0.000000000000000000"
unbonding_time: 86400s
dhealth-testnetd q staking params

bond_denom: utdhp
historical_entries: 10000
max_entries: 7
max_validators: 100
min_commission_rate: "0.000000000000000000"
unbonding_time: 86400s
  • We can keep all other parameters the same, and just change the unbonding_time value:
{
 "messages": [
  {
   "@type": "/cosmos.staking.v1beta1.MsgUpdateParams",
   "authority": "dh10d07y265gmmuvt4z0w9aw880jnsr700jghwrtj",
   "params": {
    "unbonding_time": "172800s",
    "max_validators": 100,
    "max_entries": 7,
    "historical_entries": 10000,
    "bond_denom": "udhp",
    "min_commission_rate": "0.000000000000000000"
   }
  }
 ],
 "metadata": "ipfs://CID",
 "deposit": "50000000udhp",
 "title": "your proposal title",
 "summary": "your proposal summary"
}
{
 "messages": [
  {
   "@type": "/cosmos.staking.v1beta1.MsgUpdateParams",
   "authority": "dh0210d07y265gmmuvt4z0w9aw880jnsr700jzcu0p4",
   "params": {
    "unbonding_time": "172800s",
    "max_validators": 100,
    "max_entries": 7,
    "historical_entries": 10000,
    "bond_denom": "utdhp",
    "min_commission_rate": "0.000000000000000000"
   }
  }
 ],
 "metadata": "ipfs://CID",
 "deposit": "50000000utdhp",
 "title": "your proposal title",
 "summary": "your proposal summary"
}

4. Upload metadata to IPFS (optional)

The content of your draft_metadata.json file should be something like this:

{
 "title": "your proposal title",
 "authors": [
  "the address, of name you want to let people know"
 ],
 "summary": "your proposal summary",
 "details": "your proposal details",
 "proposal_forum_url": "http://proposal-discussion.com",
 "vote_option_context": "your proposal's vote options context"
}

Now we need to upload it to an IPFS node and update draft_proposal.json file's metadata field with its url.

You can use a service like https://web3.storage to host your metadata file for example.

After successfully registered and created a space, in you should see something like this:

Click on your space and choose "Upload"

Now you can upload your draft_metadata.json file. You can change its name to something else more descriptive e.g. 20240419_staking_params_change_meta.json.

After the file is successfully uploaded, you should have an IPFS Root CID, which you can check in your List tab:

The full url to your file will be the URL you see here concats the name of your file.

In this case the full url is:

https://bafybeianr242closoudrhtdnyirqqzot6g6qk3k2tomos343gtaf4zf4ti.ipfs.w3s.link/20240419_staking_params_change_meta.json

Now we can update the draft_proposal.json file:

{
 ...
 "metadata": "https://bafybeianr242closoudrhtdnyirqqzot6g6qk3k2tomos343gtaf4zf4ti.ipfs.w3s.link/20240419_staking_params_change_meta.json",
 ...
}

5. Submit the proposal

After all the steps of preparation, now we can finally submit the proposal to be deposited/voted on-chain:

dhealthd tx gov submit-proposal draft_proposal.json --gas 250000 --from youraccount
dhealth-testnetd tx gov submit-proposal draft_proposal.json --gas 250000 --from youraccount

Please note we need to put --gas 250000 in, as we need more than the default gas value of 200000. This is because we have included the metadata file. If you choose to not include it however, you can remove the --gas 250000 argument.

Confirm the transaction by inputing y and hit enter. Now you should be able to see your proposal on the explorers, or by querying:

dhealthd q gov proposals
dhealth-testnetd q gov proposals