The tx
commands allow users to interact with the gov
module.
Deposit
The deposit
command allows users to deposit tokens for a given proposal.
Copy sged tx gov deposit [proposal-id] [deposit] [flags]
Example:
Copy sged tx gov deposit 1 10000000usge --from sge1..
Draft Proposal
The draft-proposal
command allows users to draft any type of proposal. The command returns a draft_proposal.json
, to be used by submit-proposal
after being completed. The draft_metadata.json
is meant to be uploaded to IPFS .
Copy sged tx gov draft-proposal
Submit Proposal
The submit-proposal
command allows users to submit a governance proposal along with some messages and metadata. Messages, metadata and deposit are defined in a JSON file.
Copy sged tx gov submit-proposal [path-to-proposal-json] [flags]
Example:
Copy sged tx gov submit-proposal /path/to/proposal.json --from sge1..
where proposal.json
contains:
Copy {
"messages": [
{
"@type": "/cosmos.bank.v1beta1.MsgSend",
"from_address": "cosmos1...", // The gov module module address
"to_address": "cosmos1...",
"amount":[{"denom": "usge","amount": "10"}]
}
],
"metadata": "AQ==",
"deposit": "10usge"
}
Submit Legacy Proposal
The submit-legacy-proposal
command allows users to submit a governance legacy proposal along with an initial deposit.
Copy sged tx gov submit-legacy-proposal [command] [flags]
Example:
Copy sged tx gov submit-legacy-proposal --title="Test Proposal" --description="testing" --type="Text" --deposit="100000000usge" --from sge1..
Example (cancel-software-upgrade
):
Copy sged tx gov submit-legacy-proposal cancel-software-upgrade --title="Test Proposal" --description="testing" --deposit="100000000usge" --from sge1..
Example (community-pool-spend
):
Copy sged tx gov submit-legacy-proposal community-pool-spend proposal.json --from sge1..
Copy {
"title": "Test Proposal",
"description": "testing, 1, 2, 3",
"recipient": "cosmos1..",
"amount": "10000000usge",
"deposit": "10000000usge"
}
Example (param-change
):
Copy {
"title": "Test Proposal",
"description": "testing, testing, 1, 2, 3",
"changes": [
{
"subspace": "staking",
"key": "MaxValidators",
"value": 100
}
],
"deposit": "10000000usge"
}
Example (software-upgrade
):
Copy sged tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" --description="testing, testing, 1, 2, 3" --upgrade-height 1000000 --from sge1..
Vote
The vote
command allows users to submit a vote for a given governance proposal.
Copy sged tx gov vote [command] [flags]
Example:
Copy sged tx gov vote 1 yes --from sge1..
Weighted Vote
The weighted-vote
command allows users to submit a weighted vote for a given governance proposal.
Copy sged tx gov weighted-vote [proposal-id] [weighted-options] [flags]
Example:
Copy sged tx gov weighted-vote 1 yes=0.5,no=0.5 --from sge1..
For detailed information see the original document.