Skip to main content

Gov

The gov module enables on-chain governance which allows Terp token holders to participate in a community led decision-making process. For example, users can:

  • Form an idea and seek feedback
  • Create a proposal and adjust according to feedback as needed
  • Submit a proposal along with an initial deposit
  • Deposit tokens and fund an active proposal
  • Vote for an active proposal

Available Commands

NameDescription
proposalQuery details of a single proposal
proposalsQuery proposals with optional filter
voteQuery details of a single vote
votesQuery votes on a proposal
depositQuery details of a deposit
depositsQuery deposits on a proposal
tallyGet the tally of a proposal vote
paramQuery the parameters (voting
paramsQuery the parameters of the governance process
proposerQuery which address proposed a proposal with a given ID.
submit-proposalSubmit a proposal along with an initial deposit
depositDeposit tokens for an active proposal
voteVote for an active proposal, options: yes/no/no_with_veto/abstain

terpd query gov proposal

Query details of a single governance proposal:

terpd query gov proposal [proposal-id] [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--depositorAddressFilter proposals by depositor address
--limituint100Limit to the latest [number] of proposals. Default to all proposals
--statusstringFilter proposals by status
--voterAddressFilter proposals by voter address

terpd query gov proposals

Query all proposals:

terpd query gov proposals

Query proposals with conditions filters:

terpd query gov proposals --limit=3 --status=Passed --depositor=<terp...>

terpd query gov vote

Query details of a single vote.

terpd query gov vote [proposal-id] [voter-addr] [flags]

terpd query gov votes

Query votes on a proposal.

terpd query gov votes [proposal-id] [flags]

terpd query gov deposit

Query details for a single proposal deposit on a proposal by its identifier.

terpd query gov deposit [proposal-id] [depositer-addr] [flags]

terpd query gov deposits

Query details for all deposits on a proposal.

terpd query gov deposits [proposal-id] [flags]

terpd query gov tally

Query tally of votes on a proposal.

terpd query gov tally [proposal-id] [flags]

terpd query gov param

Query the parameters (voting | tallying | deposit) of the governance process.

terpd query gov param [param-type] [flags]

Example:

# query voting parameters
terpd query gov param voting

# query tallying parameters
terpd query gov param tallying

# query deposit parameters
terpd query gov param deposit

terpd query gov params

Query the all the parameters for the governance process.

terpd query gov params [flags]

terpd query gov proposer

Query which address proposed a proposal with a given ID.

terpd query gov proposer [proposal-id] [flags]

terpd tx gov submit-proposal

Submit a proposal along with an initial deposit. Proposal title, description, type and deposit can be given directly or through a proposal JSON file. Available Commands:

NameDescription
cancel-software-upgradeCancel the current software upgrade proposal
community-pool-spendSubmit a community pool spend proposal
param-changeSubmit a parameter change proposal
software-upgradeSubmit a software upgrade proposal

terpd tx gov submit-proposal community-pool-spend

Submit a community pool spend proposal along with an initial deposit. The proposal details must be supplied via a JSON file.

terpd tx gov submit-proposal community-pool-spend <path/to/proposal.json> --from=<key_or_address>

Where proposal.json contains, for example:

{
"title": "Community Pool Spend",
"description": "Send me tokens, to benefit the Terp community",
"recipient": "terp1ludczrvlw36fkur9vy49lx4vjqhppn30h42ufg",
"amount": "1000000uterp",
"deposit": "1000uterp"
}

terpd tx gov submit-proposal param-change

Submit a parameter proposal along with an initial deposit. The proposal details must be supplied via a JSON file. For values that contains objects, only non-empty fields will be updated.

{% hint style="warning" %} IMPORTANT

Currently parameter changes are evaluated but not validated, so it is very important that any "value" change is valid (ie. correct type and within bounds) for its respective parameter, eg. "MaxValidators" should be an integer and not a decimal. {% endhint %}

Proper vetting of a parameter change proposal should prevent this from happening (no deposits should occur during the governance process), but it should be noted regardless.

terpd tx gov submit-proposal param-change <path/to/proposal.json> --from=<key_or_address>

Where proposal.json contains, for example:

{
"title": "Staking Param Change",
"description": "Update max validators",
"changes": [
{
"subspace": "staking",
"key": "MaxValidators",
"value": 105
}
],
"deposit": "1000uterp"
}

terpd tx gov submit-proposal software-upgrade

Submit a software upgrade along with an initial deposit. Please specify a unique name and height OR time for the upgrade to take effect.

terpd tx gov submit-proposal software-upgrade [name] (--upgrade-height [height] | --upgrade-time [time]) (--upgrade-info [info]) [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--depositCoinYesDeposit of the proposal
--titlestringYesTitle of proposal
--descriptionstringYesDescription of proposal
--upgrade-heightint64The height at which the upgrade must happen (not to be used together with --upgrade-time)
--timestringThe time at which the upgrade must happen (not to be used together with --upgrade-height)
--infostringOptional info for the planned upgrade such as commit hash, etc.

{% hint style="info" %} TIP

To enable nodes managed by forbole/cosmovisor to undertake an automatic upgrade, where the operator has the required environment variable set.

Store an os/architecture -> binary URI map in the upgrade plan info field as JSON under the "binaries" key, eg:

{
"binaries": {
"linux/amd64":"https://example.com/terp.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f"
}
}

{% endhint %}

terpd tx gov submit-proposal cancel-software-upgrade

Cancel a software upgrade along with an initial deposit.

terpd tx gov submit-proposal cancel-software-upgrade [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--depositCoinYesDeposit of the proposal
--titlestringYesTitle of proposal
--descriptionstringYesDescription of proposal

terpd tx gov deposit

Submit a deposit for an active proposal. You can find the proposal-id by running terpd query gov proposals.

terpd tx gov deposit [proposal-id] [deposit] [flags]

terpd tx gov vote

Submit a vote for an active proposal. You can find the proposal-id by running terpd query gov proposals. Vote for an active proposal, options: (yes | no | no_with_veto | abstain).

terpd tx gov vote [proposal-id] [option] [flags]

Example vote, voting yes on proposal number 1:

terpd tx gov vote 1 yes --from=<key_or_address> --fees=1terp