{"content":{"title":"COSMOSSDK GOV模块中文文档","body":"---\r\nsidebar_position: 1\r\n---\r\n\r\n# `x/gov`\r\n\r\n## 概览\r\n\r\n本文对Cosmos SDK的治理模块进行了详细说明。治理模块在2016年的Cosmos白皮书中首次提出[Cosmos Whitepaper](https://cosmos.network/about/whitepaper)。\r\n\r\n此模块让以Cosmos SDK为基础的区块链支持链上治理系统。在治理系统中，此链的原生代币持有者可以以1:1（原生代币:投票）的比例对提案进行投票。以下为此模块目前支持的特性列表：\r\n\r\n* **提交提案:** 用户可以质押一定数量的代币进行提案。一旦提案质押的代币数量达到最小质押数量要求，此提案便进入投票阶段。最小质押数量可以在有效期内由不同的用户（包括提案提交者）进行质押达到。\r\n* **投票:** 参与者可以对进入投票阶段（满足代币最小质押数量要求）的提案进行投票。\r\n* **继承和惩罚:** 如果委托人自己不进行投票，则继承被委托的验证者的投票。\r\n* **认领质押的代币:** 当提案被通过或者被拒绝，质押者可以取回他们之前质押的代币。如果提案被封禁或者永远无法进入投票阶段(在有效期内没有达到代币最小质押数量要求)，用户质押的代币将被燃烧掉无法取回。\r\n\r\n此模块已被Cosmos Hub使用 (a.k.a [gaia](https://github.com/cosmos/gaia)).\r\n\r\n\r\n## 目录\r\n\r\n以下说明均以*ATOM*作为原生质押代币。对于任意的PWS区块链，可以用该链的原生质押代币对*ATOM*进行替换。\r\n\r\n* [概念](#concepts)\r\n    * [提交提案](#proposal-submission)\r\n    * [质押](#deposit)\r\n    * [投票](#vote)\r\n* [状态](#state)\r\n    * [提案](#proposals)\r\n    * [参数和基础类型](#parameters-and-base-types)\r\n    * [质押](#deposit-1)\r\n    * [验证者治理信息](#validatorgovinfo)\r\n    * [存储](#stores)\r\n    * [提案处理队列](#proposal-processing-queue)\r\n    * [遗产提案（已弃用）](#legacy-proposal)\r\n* [消息](#messages)\r\n    * [提交提案](#proposal-submission-1)\r\n    * [质押](#deposit-2)\r\n    * [投票](#vote-1)\r\n* [事件](#events)\r\n    * [EndBlocker](#endblocker)\r\n    * [Handlers](#handlers)\r\n* [参数](#parameters)\r\n* [客户端](#client)\r\n    * [CLI](#cli)\r\n    * [gRPC](#grpc)\r\n    * [REST](#rest)\r\n* [元数据](#metadata)\r\n    * [提案](#proposal-3)\r\n    * [投票](#vote-5)\r\n* [未来规划](#future-improvements)\r\n\r\n## 概念\r\n\r\n治理的步骤分为以下几步：\r\n\r\n* **提交提案:** 提交提案到链上需要质押一定数量的治理代币。\r\n* **投票:** 一旦提案质押的代币达到最小质押量（`MinDeposit`）,提案就会被确认并且进入投票阶段。Atom的持有者便可以通过发送`TxGovVote`交易来对提案进行投票。\r\n* **执行** .一段时间后进行计票，如果提案通过，提案中的消息将会被执行。\r\n\r\n### 提交提案\r\n\r\n#### 提交提案的权利\r\n\r\n每个账号都可以通过发送`MsgSubmitProposal`交易来提交提案。一旦提案被提交，提案便有一个`proposalID`作为它的唯一标识。\r\n\r\n#### 提案包含的消息\r\n\r\n一个提案里包含了一个`sdk.Msg`消息的数组，如果提案通过，这些消息就会被执行。执行消息的是治理模块`ModuleAccount`自身。如果模块例如`x/upgrade`想要允许某些特定的消息在满足阈值时被治理模块执行，只需要在各自的消息服务中加一个白名单来授予治理模块执行的权限。治理模块使用消息服务路由`MsgServiceRouter`来检查消息的构造的正确性并且有独立的路由去执行，但不会对消息做完整的校验。\r\n\r\n:::注意\r\n总之，治理模块能够执行任意提案，即使他们本意不是由治理模块来执行（例如没有设置authority）。消息不设置authority是为了指定由用户来执行。在提案中使用`MsgSudoExec`来让治理模块执行任意消息，这实际上也就是让治理模块成为超级用户。\r\n:::\r\n\r\n### 质押\r\n\r\n为了防止产生垃圾提案，提交提案必须质押`MinDeposit`参数指定的最小数量的代币。\r\n\r\n当提交一个提案时，质押的代币数量必须为正数，但是可以小于`MinDeposit`指定的数量，提案提交者不需要自己全部质押`MinDeposit`所指定的最小质押量的代币。新创建的提案被存储在*未激活提案队列*直到它的代币质押量达到最小质押量。只有代币持有者通过发送`Deposit`交易来增加提案的质押代币。如果在有效期期间提案的质押量未达到最小质押量（过了有效期无法再进行质押），提案便会被销毁：提案从状态树中移除并且提案质押的代币会被燃烧掉(详细请查阅 x/gov `EndBlocker`)。当一个提案的质押量在有效期内达到了最小质押量阈值`MinDeposit`，提案会被移到*已激活提案队列*(*active proposal queue*)并且开启投票阶段。\r\n\r\n在提案最终确认前（通过或者被拒绝），提案质押的代币会被保管在由治理模块掌管的`ModuleAccount`第三方账户里。\r\n\r\n#### 质押代币退回以及燃烧销毁\r\n\r\nWhen a proposal is finalized, the coins from the deposit are either refunded or burned\r\naccording to the final tally of the proposal:\r\n\r\n* If the proposal is approved or rejected but *not* vetoed, each deposit will be\r\n  automatically refunded to its respective depositor (transferred from the governance\r\n  `ModuleAccount`).\r\n* When the proposal is vetoed with greater than 1/3, deposits will be burned from the\r\n  governance `ModuleAccount` and the proposal information along with its deposit\r\n  information will be removed from state.\r\n* All refunded or burned deposits are removed from the state. Events are issued when\r\n  burning or refunding a deposit.\r\n\r\n### Vote\r\n\r\n#### Participants\r\n\r\n*Participants* are users that have the right to vote on proposals. On the\r\nCosmos Hub, participants are bonded Atom holders. Unbonded Atom holders and\r\nother users do not get the right to participate in governance. However, they\r\ncan submit and deposit on proposals.\r\n\r\nNote that when *participants* have bonded and unbonded Atoms, their voting power is calculated from their bonded Atom holdings only.\r\n\r\n#### Voting period\r\n\r\nOnce a proposal reaches `MinDeposit`, it immediately enters `Voting period`. We\r\ndefine `Voting period` as the interval between the moment the vote opens and\r\nthe moment the vote closes. The initial value of `Voting period` is 2 weeks.\r\n\r\n#### Option set\r\n\r\nThe option set of a proposal refers to the set of choices a participant can\r\nchoose from when casting its vote.\r\n\r\nThe initial option set includes the following options:\r\n\r\n* `Yes` / `Option 1`\r\n* `Abstain` / `Option 2`\r\n* `No` / `Option 3`\r\n* `NoWithVeto` / `Option 4`\r\n* `Spam` / `Option Spam`\r\n\r\n`NoWithVeto` counts as `No` but also adds a `Veto` vote. `Abstain` option\r\nallows voters to signal that they do not intend to vote in favor or against the\r\nproposal but accept the result of the vote.\r\n\r\n*Note: from the UI, for urgent proposals we should maybe add a ‘Not Urgent’ option that casts a `NoWithVeto` vote.*\r\n\r\n#### Weighted Votes\r\n\r\n[ADR-037](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-037-gov-split-vote.md) introduces the weighted vote feature which allows a staker to split their votes into several voting options. For example, it could use 70% of its voting power to vote Yes and 30% of its voting power to vote No.\r\n\r\nOften times the entity owning that address might not be a single individual. For example, a company might have different stakeholders who want to vote differently, and so it makes sense to allow them to split their voting power. Currently, it is not possible for them to do \"passthrough voting\" and giving their users voting rights over their tokens. However, with this system, exchanges can poll their users for voting preferences, and then vote on-chain proportionally to the results of the poll.\r\n\r\nTo represent weighted vote on chain, we use the following Protobuf message.\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1beta1/gov.proto#L34-L47\r\n```\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1beta1/gov.proto#L181-L201\r\n```\r\n\r\nFor a weighted vote to be valid, the `options` field must not contain duplicate vote options, and the sum of weights of all options must be equal to 1.\r\n\r\nThe maximum number of weighted vote options can be limited by the developer via a config parameter, named `MaxVoteOptionsLen`, which gets passed into the gov keeper.\r\n\r\n### Quorum\r\n\r\nQuorum is defined as the minimum percentage of voting power that needs to be\r\ncast on a proposal for the result to be valid.\r\n\r\n### Expedited Quorum\r\n\r\nExpedited Quorum is defined as the minimum percentage of voting power that needs to be\r\ncast on an **expedited** proposal for the result to be valid.\r\n\r\n### Yes Quorum\r\n\r\nYes quorum is a more restrictive quorum that is used to determine if a proposal passes.\r\nIt is defined as the minimum percentage of voting power that needs to have voted `Yes` for the proposal to pass.\r\nIt differs from `Threshold` as it takes the whole voting power into account, not only `Yes` and `No` votes.\r\nBy default, `YesQuorum` is set to 0, which means no minimum.\r\n\r\n### Proposal Types\r\n\r\nProposal types have been introduced in ADR-069.\r\n\r\n#### Standard proposal\r\n\r\nA standard proposal is a proposal that can contain any messages. The proposal follows the standard governance flow and governance parameters.\r\n\r\n#### Expedited Proposal\r\n\r\nA proposal can be expedited, making the proposal use shorter voting duration and a higher tally threshold by its default. If an expedited proposal fails to meet the threshold within the scope of shorter voting duration, the expedited proposal is then converted to a regular proposal and restarts voting under regular voting conditions.\r\n\r\n#### Optimistic Proposal\r\n\r\nAn optimistic proposal is a proposal that passes unless a threshold a NO votes is reached.\r\nVoter can only vote NO on the proposal. If the NO threshold is reached, the optimistic proposal is converted to a standard proposal.\r\n\r\nThat threshold is defined by the `optimistic_rejected_threshold` governance parameter.\r\nA chain can optionally set a list of authorized addresses that can submit optimistic proposals using the `optimistic_authorized_addresses` governance parameter.\r\n\r\n#### Multiple Choice Proposals\r\n\r\nA multiple choice proposal is a proposal where the voting options can be defined by the proposer.\r\nThe number of voting options is limited to a maximum of 4.\r\nMultiple choice proposals, contrary to any other proposal type, cannot have messages to execute. They are only text proposals.\r\n\r\n#### Threshold\r\n\r\nThreshold is defined as the minimum proportion of `Yes` votes (excluding\r\n`Abstain` votes) for the proposal to be accepted.\r\n\r\nInitially, the threshold is set at 50% of `Yes` votes, excluding `Abstain`\r\nvotes. A possibility to veto exists if more than 1/3rd of all votes are\r\n`NoWithVeto` votes.  Note, both of these values are derived from the `TallyParams`\r\non-chain parameter, which is modifiable by governance.\r\nThis means that proposals are accepted iff:\r\n\r\n* There exist bonded tokens.\r\n* Quorum has been achieved.\r\n* The proportion of `Abstain` votes is inferior to 1/1.\r\n* The proportion of `NoWithVeto` votes is inferior to 1/3, including\r\n  `Abstain` votes.\r\n* The proportion of `Yes` votes, excluding `Abstain` votes, at the end of\r\n  the voting period is superior to 1/2.\r\n\r\nFor expedited proposals, by default, the threshold is higher than with a *normal proposal*, namely, 66.7%.\r\n\r\n#### Inheritance\r\n\r\nIf a delegator does not vote, it will inherit its validator vote.\r\n\r\n* If the delegator votes before its validator, it will not inherit from the\r\n  validator's vote.\r\n* If the delegator votes after its validator, it will override its validator\r\n  vote with its own. If the proposal is urgent, it is possible\r\n  that the vote will close before delegators have a chance to react and\r\n  override their validator's vote. This is not a problem, as proposals require more than 2/3rd of the total voting power to pass, when tallied at the end of the voting period. Because as little as 1/3 + 1 validation power could collude to censor transactions, non-collusion is already assumed for ranges exceeding this threshold.\r\n\r\n#### Validator’s punishment for non-voting\r\n\r\nAt present, validators are not punished for failing to vote.\r\n\r\n#### Governance address\r\n\r\nLater, we may add permissioned keys that could only sign txs from certain modules. For the MVP, the `Governance address` will be the main validator address generated at account creation. This address corresponds to a different PrivKey than the CometBFT PrivKey which is responsible for signing consensus messages. Validators thus do not have to sign governance transactions with the sensitive CometBFT PrivKey.\r\n\r\n#### Burnable Params\r\n\r\nThere are three parameters that define if the deposit of a proposal should be burned or returned to the depositors.\r\n\r\n* `BurnVoteVeto` burns the proposal deposit if the proposal gets vetoed.\r\n* `BurnVoteQuorum` burns the proposal deposit if the proposal deposit if the vote does not reach quorum.\r\n* `BurnProposalDepositPrevote` burns the proposal deposit if it does not enter the voting phase.\r\n\r\n> Note: These parameters are modifiable via governance.\r\n\r\n#### Execution\r\n\r\nExecution is the process of executing the messages contained in a proposal. The execution phase will commence after the proposal has been accepted by the network. The messages contained in the proposal will be executed in the order they were submitted.\r\n\r\nExecution has a upper limit on how much gas can be consumed in a single block. This limit is defined by the `ProposalExecutionGas` parameter.\r\n\r\n## State\r\n\r\n### Constitution\r\n\r\n`Constitution` is found in the genesis state.  It is a string field intended to be used to describe the purpose of a particular blockchain, and its expected norms.  A few examples of how the constitution field can be used:\r\n\r\n* define the purpose of the chain, laying a foundation for its future development\r\n* set expectations for delegators\r\n* set expectations for validators\r\n* define the chain's relationship to \"meatspace\" entities, like a foundation or corporation\r\n\r\nSince this is more of a social feature than a technical feature, we'll now get into some items that may have been useful to have in a genesis constitution:\r\n\r\n* What limitations on governance exist, if any?\r\n    * is it okay for the community to slash the wallet of a whale that they no longer feel that they want around? (viz: Juno Proposal 4 and 16)\r\n    * can governance \"socially slash\" a validator who is using unapproved MEV? (viz: commonwealth.im/osmosis)\r\n    * In the event of an economic emergency, what should validators do?\r\n        * Terra crash of May, 2022, saw validators choose to run a new binary with code that had not been approved by governance, because the governance token had been inflated to nothing.\r\n* What is the purpose of the chain, specifically?\r\n    * best example of this is the Cosmos hub, where different founding groups, have different interpretations of the purpose of the network.\r\n\r\nThis genesis entry, \"constitution\" hasn't been designed for existing chains, who should likely just ratify a constitution using their governance system.  Instead, this is for new chains.  It will allow for validators to have a much clearer idea of purpose and the expectations placed on them while operating their nodes.  Likewise, for community members, the constitution will give them some idea of what to expect from both the \"chain team\" and the validators, respectively.\r\n\r\nThis constitution is designed to be immutable, and placed only in genesis, though that could change over time by a pull request to the cosmos-sdk that allows for the constitution to be changed by governance.  Communities whishing to make amendments to their original constitution should use the governance mechanism and a \"signaling proposal\" to do exactly that.\r\n\r\n**Ideal use scenario for a cosmos chain constitution**\r\n\r\nAs a chain developer, you decide that you'd like to provide clarity to your key user groups:\r\n\r\n* validators\r\n* token holders\r\n* developers (yourself)\r\n\r\nYou use the constitution to immutably store some Markdown in genesis, so that when difficult questions come up, the constutituon can provide guidance to the community.\r\n\r\n### Proposals\r\n\r\n`Proposal` objects are used to tally votes and generally track the proposal's state.\r\nThey contain an array of arbitrary `sdk.Msg`'s which the governance module will attempt\r\nto resolve and then execute if the proposal passes. `Proposal`'s are identified by a\r\nunique id and contains a series of timestamps: `submit_time`, `deposit_end_time`,\r\n`voting_start_time`, `voting_end_time` which track the lifecycle of a proposal\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/gov.proto#L51-L99\r\n```\r\n\r\nA proposal will generally require more than just a set of messages to explain its\r\npurpose but need some greater justification and allow a means for interested participants\r\nto discuss and debate the proposal.\r\nIn most cases, **it is encouraged to have an off-chain system that supports the on-chain governance process**.\r\nTo accommodate for this, a proposal contains a special **`metadata`** field, a string,\r\nwhich can be used to add context to the proposal. The `metadata` field allows custom use for networks,\r\nhowever, it is expected that the field contains a URL or some form of CID using a system such as\r\n[IPFS](https://docs.ipfs.io/concepts/content-addressing/). To support the case of\r\ninteroperability across networks, the SDK recommends that the `metadata` represents\r\nthe following `JSON` template:\r\n\r\n```json\r\n{\r\n  \"title\": \"...\",\r\n  \"description\": \"...\",\r\n  \"forum\": \"...\", // a link to the discussion platform (i.e. Discord)\r\n  \"other\": \"...\" // any extra data that doesn't correspond to the other fields\r\n}\r\n```\r\n\r\nThis makes it far easier for clients to support multiple networks.\r\n\r\nFields metadata, title and summary have a maximum length that is chosen by the app developer, and\r\npassed into the gov keeper as a config. The default maximum length are: for the title 255 characters, for the metadata 255 characters and for summary 10200 characters (40 times the one of the title).\r\n\r\n#### Writing a module that uses governance\r\n\r\nThere are many aspects of a chain, or of the individual modules that you may want to\r\nuse governance to perform such as changing various parameters. This is very simple\r\nto do. First, write out your message types and `MsgServer` implementation. Add an\r\n`authority` field to the keeper which will be populated in the constructor with the\r\ngovernance module account: `govKeeper.GetGovernanceAccount().GetAddress()`. Then for\r\nthe methods in the `msg_server.go`, perform a check on the message that the signer\r\nmatches `authority`. This will prevent any user from executing that message.\r\n\r\n:::warning\r\nNote, any message can be executed by governance if embedded in `MsgSudoExec`.\r\n:::\r\n\r\n### Parameters and base types\r\n\r\n`Parameters` define the rules according to which votes are run. There can only\r\nbe one active parameter set at any given time. If governance wants to change a\r\nparameter set, either to modify a value or add/remove a parameter field, a new\r\nparameter set has to be created and the previous one rendered inactive.\r\n\r\n#### DepositParams\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/gov.proto#L152-L162\r\n```\r\n\r\n#### VotingParams\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/gov.proto#L164-L168\r\n```\r\n\r\n#### TallyParams\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/gov.proto#L170-L182\r\n```\r\n\r\nParameters are stored in a global `GlobalParams` KVStore.\r\n\r\nAdditionally, we introduce some basic types:\r\n\r\n```go\r\ntype ProposalStatus byte\r\n\r\n\r\nconst (\r\n    StatusNil           ProposalStatus = 0x00\r\n    StatusDepositPeriod ProposalStatus = 0x01  // Proposal is submitted. Participants can deposit on it but not vote\r\n    StatusVotingPeriod  ProposalStatus = 0x02  // MinDeposit is reached, participants can vote\r\n    StatusPassed        ProposalStatus = 0x03  // Proposal passed and successfully executed\r\n    StatusRejected      ProposalStatus = 0x04  // Proposal has been rejected\r\n    StatusFailed        ProposalStatus = 0x05  // Proposal passed but failed execution\r\n)\r\n```\r\n\r\n### Deposit\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/gov.proto#L38-L49\r\n```\r\n\r\n### ValidatorGovInfo\r\n\r\nThis type is used in a temp map when tallying\r\n\r\n```go\r\n  type ValidatorGovInfo struct {\r\n    Minus     sdk.Dec\r\n    Vote      Vote\r\n  }\r\n```\r\n\r\n## Stores\r\n\r\n:::note\r\nStores are KVStores in the multi-store. The key to find the store is the first parameter in the list\r\n:::\r\n\r\nWe will use one KVStore `Governance` to store four mappings:\r\n\r\n* A mapping from `proposalID|'proposal'` to `Proposal`.\r\n* A mapping from `proposalID|'addresses'|address` to `Vote`. This mapping allows\r\n  us to query all addresses that voted on the proposal along with their vote by\r\n  doing a range query on `proposalID:addresses`.\r\n* A mapping from `ParamsKey|'Params'` to `Params`. This map allows to query all\r\n  x/gov params.\r\n  \r\nFor pseudocode purposes, here are the two function we will use to read or write in stores:\r\n\r\n* `load(StoreKey, Key)`: Retrieve item stored at key `Key` in store found at key `StoreKey` in the multistore\r\n* `store(StoreKey, Key, value)`: Write value `Value` at key `Key` in store found at key `StoreKey` in the multistore\r\n\r\n### Proposal Processing Queue\r\n\r\n**Store:**\r\n\r\n* `ProposalProcessingQueue`: A queue `queue[proposalID]` containing all the\r\n  `ProposalIDs` of proposals that reached `MinDeposit`. During each `EndBlock`,\r\n  all the proposals that have reached the end of their voting period are processed.\r\n  To process a finished proposal, the application tallies the votes, computes the\r\n  votes of each validator and checks if every validator in the validator set has\r\n  voted. If the proposal is accepted, deposits are refunded. Finally, the proposal\r\n  content `Handler` is executed.\r\n\r\n### Legacy Proposal\r\n\r\n:::warning\r\nLegacy proposals are deprecated. Use the new proposal flow by granting the governance module the right to execute the message.\r\n:::\r\n\r\nA legacy proposal is the old implementation of governance proposal.\r\nContrary to proposal that can contain any messages, a legacy proposal allows to submit a set of pre-defined proposals.\r\nThese proposals are defined by their types and handled by handlers that are registered in the gov v1beta1 router.\r\n\r\nMore information on how to submit proposals in the [client section](#client).\r\n\r\n## Messages\r\n\r\n### Proposal Submission\r\n\r\nProposals can be submitted by any account via a `MsgSubmitProposal` or a `MsgSubmitMultipleChoiceProposal` transaction.\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.proto#L42-L69\r\n```\r\n\r\n:::note\r\nA multiple choice proposal is a proposal where the voting options can be defined by the proposer.\r\nIt cannot have messages to execute. It is only a text proposal.\r\n:::\r\n\r\n:::warning\r\nSubmitting a multiple choice proposal using `MsgSubmitProposal` is invalid, as vote options cannot be defined.\r\n:::\r\n\r\nAll `sdk.Msgs` passed into the `messages` field of a `MsgSubmitProposal` message\r\nmust be registered in the app's `MsgServiceRouter`. Each of these messages must\r\nhave one signer, namely the gov module account. And finally, the metadata length\r\nmust not be larger than the `maxMetadataLen` config passed into the gov keeper.\r\nThe `initialDeposit` must be strictly positive and conform to the accepted denom of the `MinDeposit` param.\r\n\r\n**State modifications:**\r\n\r\n* Generate new `proposalID`\r\n* Create new `Proposal`\r\n* Initialise `Proposal`'s attributes\r\n* Decrease balance of sender by `InitialDeposit`\r\n* If `MinDeposit` is reached:\r\n    * Push `proposalID` in `ProposalProcessingQueue`\r\n* Transfer `InitialDeposit` from the `Proposer` to the governance `ModuleAccount`\r\n\r\n### Deposit\r\n\r\nOnce a proposal is submitted, if `Proposal.TotalDeposit < ActiveParam.MinDeposit`, Atom holders can send\r\n`MsgDeposit` transactions to increase the proposal's deposit.\r\n\r\nA deposit is accepted iff:\r\n\r\n* The proposal exists\r\n* The proposal is not in the voting period\r\n* The deposited coins are conform to the accepted denom from the `MinDeposit` param\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.proto#L134-L147\r\n```\r\n\r\n**State modifications:**\r\n\r\n* Decrease balance of sender by `deposit`\r\n* Add `deposit` of sender in `proposal.Deposits`\r\n* Increase `proposal.TotalDeposit` by sender's `deposit`\r\n* If `MinDeposit` is reached:\r\n    * Push `proposalID` in `ProposalProcessingQueueEnd`\r\n* Transfer `Deposit` from the `proposer` to the governance `ModuleAccount`\r\n\r\n### Vote\r\n\r\nOnce `ActiveParam.MinDeposit` is reached, voting period starts. From there,\r\nbonded Atom holders are able to send `MsgVote` transactions to cast their\r\nvote on the proposal.\r\n\r\n```protobuf reference\r\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.proto#L92-L108\r\n```\r\n\r\n**State modifications:**\r\n\r\n* Record `Vote` of sender\r\n\r\n:::note\r\nGas cost for this message has to take into account the future tallying of the vote in EndBlocker.\r\n:::\r\n\r\n## Events\r\n\r\nThe governance module emits the following events:\r\n\r\n### EndBlocker\r\n\r\n| Type              | Attribute Key   | Attribute Value  |\r\n| ----------------- | --------------- | ---------------- |\r\n| inactive_proposal | proposal_id     | {proposalID}     |\r\n| inactive_proposal | proposal_result | {proposalResult} |\r\n| active_proposal   | proposal_id     | {proposalID}     |\r\n| active_proposal   | proposal_result | {proposalResult} |\r\n\r\n### Handlers\r\n\r\n#### MsgSubmitProposal, MsgSubmitMultipleChoiceProposal\r\n\r\n| Type                | Attribute Key       | Attribute Value |\r\n| ------------------- | ------------------- | --------------- |\r\n| submit_proposal     | proposal_id         | {proposalID}    |\r\n| submit_proposal [0] | voting_period_start | {proposalID}    |\r\n| proposal_deposit    | amount              | {depositAmount} |\r\n| proposal_deposit    | proposal_id         | {proposalID}    |\r\n| message             | module              | governance      |\r\n| message             | action              | submit_proposal |\r\n| message             | sender              | {senderAddress} |\r\n\r\n* [0] Event only emitted if the voting period starts during the submission.\r\n\r\n#### MsgVote\r\n\r\n| Type          | Attribute Key | Attribute Value |\r\n| ------------- | ------------- | --------------- |\r\n| proposal_vote | option        | {voteOption}    |\r\n| proposal_vote | proposal_id   | {proposalID}    |\r\n| message       | module        | governance      |\r\n| message       | action        | vote            |\r\n| message       | sender        | {senderAddress} |\r\n\r\n#### MsgVoteWeighted\r\n\r\n| Type          | Attribute Key | Attribute Value       |\r\n| ------------- | ------------- | --------------------- |\r\n| proposal_vote | option        | {weightedVoteOptions} |\r\n| proposal_vote | proposal_id   | {proposalID}          |\r\n| message       | module        | governance            |\r\n| message       | action        | vote                  |\r\n| message       | sender        | {senderAddress}       |\r\n\r\n#### MsgDeposit\r\n\r\n| Type                 | Attribute Key       | Attribute Value |\r\n| -------------------- | ------------------- | --------------- |\r\n| proposal_deposit     | amount              | {depositAmount} |\r\n| proposal_deposit     | proposal_id         | {proposalID}    |\r\n| proposal_deposit [0] | voting_period_start | {proposalID}    |\r\n| message              | module              | governance      |\r\n| message              | action              | deposit         |\r\n| message              | sender              | {senderAddress} |\r\n\r\n* [0] Event only emitted if the voting period starts during the submission.\r\n\r\n## Parameters\r\n\r\nThe governance module contains the following parameters:\r\n\r\n| Key                             | Type              | Example                                 |\r\n| ------------------------------- | ----------------- | --------------------------------------- |\r\n| min_deposit                     | array (coins)     | [{\"denom\":\"uatom\",\"amount\":\"10000000\"}] |\r\n| max_deposit_period              | string (time ns)  | \"172800000000000\" (17280s)              |\r\n| voting_period                   | string (time ns)  | \"172800000000000\" (17280s)              |\r\n| quorum                          | string (dec)      | \"0.334000000000000000\"                  |\r\n| yes_quorum                      | string (dec)      | \"0.4\"                                   |\r\n| threshold                       | string (dec)      | \"0.500000000000000000\"                  |\r\n| veto                            | string (dec)      | \"0.334000000000000000\"                  |\r\n| expedited_threshold             | string (time ns)  | \"0.667000000000000000\"                  |\r\n| expedited_voting_period         | string (time ns)  | \"86400000000000\" (8600s)                |\r\n| expedited_min_deposit           | array (coins)     | [{\"denom\":\"uatom\",\"amount\":\"50000000\"}] |\r\n| expedited_quorum                | string (dec)      | \"0.5\"                                   |\r\n| burn_proposal_deposit_prevote   | bool              | false                                   |\r\n| burn_vote_quorum                | bool              | false                                   |\r\n| burn_vote_veto                  | bool              | true                                    |\r\n| min_initial_deposit_ratio       | string            | \"0.1\"                                   |\r\n| proposal_cancel_ratio           | string (dec)      | \"0.5\"                                   |\r\n| proposal_cancel_dest            | string (address)  | \"cosmos1..\" or empty for burn           |\r\n| proposal_cancel_max_period      | string (dec)      | \"0.5\"                                   |\r\n| optimistic_rejected_threshold   | string (dec)      | \"0.1\"                                   |\r\n| optimistic_authorized_addresses | array (addresses) | []                                      |\r\n\r\n**NOTE**: The governance module contains parameters that are objects unlike other\r\nmodules. If only a subset of parameters are desired to be changed, only they need\r\nto be included and not the entire parameter object structure.\r\n\r\n### Message Based Parameters\r\n\r\nIn addition to the parameters above, the governance module can also be configured to have different parameters for a given proposal message.\r\n\r\n| Key           | Type             | Example                    |\r\n| ------------- | ---------------- | -------------------------- |\r\n| voting_period | string (time ns) | \"172800000000000\" (17280s) |\r\n| yes_quorum    | string (dec)     | \"0.4\"                      |\r\n| quorum        | string (dec)     | \"0.334000000000000000\"     |\r\n| threshold     | string (dec)     | \"0.500000000000000000\"     |\r\n| veto          | string (dec)     | \"0.334000000000000000\"     |\r\n\r\nIf configured, these params will take precedence over the global params for a specific proposal.\r\n\r\n:::warning\r\nCurrently, messaged based parameters limit the number of messages that can be included in a proposal to 1 if a messaged based parameter is configured.\r\n:::\r\n\r\n## Client\r\n\r\n### CLI\r\n\r\nA user can query and interact with the `gov` module using the CLI.\r\n\r\n#### Query\r\n\r\nThe `query` commands allow users to query `gov` state.\r\n\r\n```bash\r\nsimd query gov --help\r\n```\r\n\r\n##### deposit\r\n\r\nThe `deposit` command allows users to query a deposit for a given proposal from a given depositor.\r\n\r\n```bash\r\nsimd query gov deposit [proposal-id] [depositer-addr] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov deposit 1 cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\namount:\r\n- amount: \"100\"\r\n  denom: stake\r\ndepositor: cosmos1..\r\nproposal_id: \"1\"\r\n```\r\n\r\n##### deposits\r\n\r\nThe `deposits` command allows users to query all deposits for a given proposal.\r\n\r\n```bash\r\nsimd query gov deposits [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov deposits 1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\ndeposits:\r\n- amount:\r\n  - amount: \"100\"\r\n    denom: stake\r\n  depositor: cosmos1..\r\n  proposal_id: \"1\"\r\npagination:\r\n  next_key: null\r\n  total: \"0\"\r\n```\r\n\r\n##### params\r\n\r\nThe `params` command allows users to query all parameters for the `gov` module.\r\n\r\n```bash\r\nsimd query gov params [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov params\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\nparams:\r\n  expedited_min_deposit:\r\n  - amount: \"50000000\"\r\n    denom: stake\r\n  expedited_threshold: \"0.670000000000000000\"\r\n  expedited_voting_period: 86400s\r\n  max_deposit_period: 172800s\r\n  min_deposit:\r\n  - amount: \"10000000\"\r\n    denom: stake\r\n  min_initial_deposit_ratio: \"0.000000000000000000\"\r\n  proposal_cancel_burn_rate: \"0.500000000000000000\"\r\n  quorum: \"0.334000000000000000\"\r\n  threshold: \"0.500000000000000000\"\r\n  veto_threshold: \"0.334000000000000000\"\r\n  voting_period: 172800s\r\n```\r\n\r\n##### proposal\r\n\r\nThe `proposal` command allows users to query a given proposal.\r\n\r\n```bash\r\nsimd query gov proposal [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov proposal 1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\ndeposit_end_time: \"2022-03-30T11:50:20.819676256Z\"\r\nfinal_tally_result:\r\n  abstain_count: \"0\"\r\n  no_count: \"0\"\r\n  no_with_veto_count: \"0\"\r\n  yes_count: \"0\"\r\nid: \"1\"\r\nmessages:\r\n- '@type': /cosmos.bank.v1beta1.MsgSend\r\n  amount:\r\n  - amount: \"10\"\r\n    denom: stake\r\n  from_address: cosmos1..\r\n  to_address: cosmos1..\r\nmetadata: AQ==\r\nstatus: PROPOSAL_STATUS_DEPOSIT_PERIOD\r\nsubmit_time: \"2022-03-28T11:50:20.819676256Z\"\r\ntotal_deposit:\r\n- amount: \"10\"\r\n  denom: stake\r\nvoting_end_time: null\r\nvoting_start_time: null\r\n```\r\n\r\n##### proposals\r\n\r\nThe `proposals` command allows users to query all proposals with optional filters.\r\n\r\n```bash\r\nsimd query gov proposals [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov proposals\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\npagination:\r\n  next_key: null\r\n  total: \"0\"\r\nproposals:\r\n- deposit_end_time: \"2022-03-30T11:50:20.819676256Z\"\r\n  final_tally_result:\r\n    abstain_count: \"0\"\r\n    no_count: \"0\"\r\n    no_with_veto_count: \"0\"\r\n    yes_count: \"0\"\r\n  id: \"1\"\r\n  messages:\r\n  - '@type': /cosmos.bank.v1beta1.MsgSend\r\n    amount:\r\n    - amount: \"10\"\r\n      denom: stake\r\n    from_address: cosmos1..\r\n    to_address: cosmos1..\r\n  metadata: AQ==\r\n  status: PROPOSAL_STATUS_DEPOSIT_PERIOD\r\n  submit_time: \"2022-03-28T11:50:20.819676256Z\"\r\n  total_deposit:\r\n  - amount: \"10\"\r\n    denom: stake\r\n  voting_end_time: null\r\n  voting_start_time: null\r\n- deposit_end_time: \"2022-03-30T14:02:41.165025015Z\"\r\n  final_tally_result:\r\n    abstain_count: \"0\"\r\n    no_count: \"0\"\r\n    no_with_veto_count: \"0\"\r\n    yes_count: \"0\"\r\n  id: \"2\"\r\n  messages:\r\n  - '@type': /cosmos.bank.v1beta1.MsgSend\r\n    amount:\r\n    - amount: \"10\"\r\n      denom: stake\r\n    from_address: cosmos1..\r\n    to_address: cosmos1..\r\n  metadata: AQ==\r\n  status: PROPOSAL_STATUS_DEPOSIT_PERIOD\r\n  submit_time: \"2022-03-28T14:02:41.165025015Z\"\r\n  total_deposit:\r\n  - amount: \"10\"\r\n    denom: stake\r\n  voting_end_time: null\r\n  voting_start_time: null\r\n```\r\n\r\n##### proposer\r\n\r\nThe `proposer` command allows users to query the proposer for a given proposal.\r\n\r\n```bash\r\nsimd query gov proposer [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov proposer 1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\nproposal_id: \"1\"\r\nproposer: cosmos1..\r\n```\r\n\r\n##### tally\r\n\r\nThe `tally` command allows users to query the tally of a given proposal vote.\r\n\r\n```bash\r\nsimd query gov tally [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov tally 1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\nabstain: \"0\"\r\n\"no\": \"0\"\r\nno_with_veto: \"0\"\r\n\"yes\": \"1\"\r\n```\r\n\r\n##### vote\r\n\r\nThe `vote` command allows users to query a vote for a given proposal.\r\n\r\n```bash\r\nsimd query gov vote [proposal-id] [voter-addr] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov vote 1 cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\noption: VOTE_OPTION_YES\r\noptions:\r\n- option: VOTE_OPTION_YES\r\n  weight: \"1.000000000000000000\"\r\nproposal_id: \"1\"\r\nvoter: cosmos1..\r\n```\r\n\r\n##### votes\r\n\r\nThe `votes` command allows users to query all votes for a given proposal.\r\n\r\n```bash\r\nsimd query gov votes [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd query gov votes 1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\npagination:\r\n  next_key: null\r\n  total: \"0\"\r\nvotes:\r\n- option: VOTE_OPTION_YES\r\n  options:\r\n  - option: VOTE_OPTION_YES\r\n    weight: \"1.000000000000000000\"\r\n  proposal_id: \"1\"\r\n  voter: cosmos1..\r\n```\r\n\r\n#### Transactions\r\n\r\nThe `tx` commands allow users to interact with the `gov` module.\r\n\r\n```bash\r\nsimd tx gov --help\r\n```\r\n\r\n##### deposit\r\n\r\nThe `deposit` command allows users to deposit tokens for a given proposal.\r\n\r\n```bash\r\nsimd tx gov deposit [proposal-id] [deposit] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov deposit 1 10000000stake --from cosmos1..\r\n```\r\n\r\n##### draft-proposal\r\n\r\nThe `draft-proposal` command allows users to draft any type of proposal.\r\nThe command returns a `draft_proposal.json`, to be used by `submit-proposal` after being completed.\r\nThe `draft_metadata.json` is meant to be uploaded to [IPFS](#metadata).\r\n\r\n```bash\r\nsimd tx gov draft-proposal\r\n```\r\n\r\n##### submit-proposal\r\n\r\nThe `submit-proposal` command allows users to submit a governance proposal along with some messages and metadata.\r\nMessages, metadata and deposit are defined in a JSON file.\r\n\r\n```bash\r\nsimd tx gov submit-proposal [path-to-proposal-json] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov submit-proposal /path/to/proposal.json --from cosmos1..\r\n```\r\n\r\nwhere `proposal.json` contains:\r\n\r\n```json\r\n{\r\n  \"messages\": [\r\n    {\r\n      \"@type\": \"/cosmos.bank.v1beta1.MsgSend\",\r\n      \"from_address\": \"cosmos1...\", // The gov module module address\r\n      \"to_address\": \"cosmos1...\",\r\n      \"amount\":[{\"denom\": \"stake\",\"amount\": \"10\"}]\r\n    }\r\n  ],\r\n  \"metadata\": \"AQ==\",\r\n  \"deposit\": \"10stake\",\r\n  \"title\": \"Proposal Title\",\r\n  \"summary\": \"Proposal Summary\"\r\n}\r\n```\r\n\r\n:::note\r\nBy default the metadata, summary and title are both limited by 255 characters, this can be overridden by the application developer.\r\n:::\r\n\r\n:::tip\r\nWhen metadata is not specified, the title is limited to 255 characters and the summary 40x the title length.\r\n:::\r\n\r\n##### submit-legacy-proposal\r\n\r\nThe `submit-legacy-proposal` command allows users to submit a governance legacy proposal along with an initial deposit.\r\n\r\n```bash\r\nsimd tx gov submit-legacy-proposal [command] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov submit-legacy-proposal --title=\"Test Proposal\" --description=\"testing\" --type=\"Text\" --deposit=\"100000000stake\" --from cosmos1..\r\n```\r\n\r\nExample (`param-change`):\r\n\r\n```bash\r\nsimd tx gov submit-legacy-proposal param-change proposal.json --from cosmos1..\r\n```\r\n\r\n```json\r\n{\r\n  \"title\": \"Test Proposal\",\r\n  \"description\": \"testing, testing, 1, 2, 3\",\r\n  \"changes\": [\r\n    {\r\n      \"subspace\": \"staking\",\r\n      \"key\": \"MaxValidators\",\r\n      \"value\": 100\r\n    }\r\n  ],\r\n  \"deposit\": \"10000000stake\"\r\n}\r\n```\r\n\r\n##### cancel-proposal\r\n\r\nOnce proposal is canceled, from the deposits of proposal `deposits * proposal_cancel_ratio` will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. The `remaining deposits` will be sent to depositers.\r\n\r\n```bash\r\nsimd tx gov cancel-proposal [proposal-id] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov cancel-proposal 1 --from cosmos1...\r\n```\r\n\r\n##### vote\r\n\r\nThe `vote` command allows users to submit a vote for a given governance proposal.\r\n\r\n```bash\r\nsimd tx gov vote [command] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov vote 1 yes --from cosmos1..\r\n```\r\n\r\n##### weighted-vote\r\n\r\nThe `weighted-vote` command allows users to submit a weighted vote for a given governance proposal.\r\n\r\n```bash\r\nsimd tx gov weighted-vote [proposal-id] [weighted-options] [flags]\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\nsimd tx gov weighted-vote 1 yes=0.5,no=0.5 --from cosmos1..\r\n```\r\n\r\n### gRPC\r\n\r\nA user can query the `gov` module using gRPC endpoints.\r\n\r\n#### Proposal\r\n\r\nThe `Proposal` endpoint allows users to query a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Proposal\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Proposal\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposal\": {\r\n    \"proposalId\": \"1\",\r\n    \"content\": {\"@type\":\"/cosmos.gov.v1beta1.TextProposal\",\"description\":\"testing, testing, 1, 2, 3\",\"title\":\"Test Proposal\"},\r\n    \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n    \"finalTallyResult\": {\r\n      \"yes\": \"0\",\r\n      \"abstain\": \"0\",\r\n      \"no\": \"0\",\r\n      \"noWithVeto\": \"0\"\r\n    },\r\n    \"submitTime\": \"2021-09-16T19:40:08.712440474Z\",\r\n    \"depositEndTime\": \"2021-09-18T19:40:08.712440474Z\",\r\n    \"totalDeposit\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ],\r\n    \"votingStartTime\": \"2021-09-16T19:40:08.712440474Z\",\r\n    \"votingEndTime\": \"2021-09-18T19:40:08.712440474Z\",\r\n    \"title\": \"Test Proposal\",\r\n    \"summary\": \"testing, testing, 1, 2, 3\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Proposal\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Proposal\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposal\": {\r\n    \"id\": \"1\",\r\n    \"messages\": [\r\n      {\"@type\":\"/cosmos.bank.v1beta1.MsgSend\",\"amount\":[{\"denom\":\"stake\",\"amount\":\"10\"}],\"fromAddress\":\"cosmos1..\",\"toAddress\":\"cosmos1..\"}\r\n    ],\r\n    \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n    \"finalTallyResult\": {\r\n      \"yesCount\": \"0\",\r\n      \"abstainCount\": \"0\",\r\n      \"noCount\": \"0\",\r\n      \"noWithVetoCount\": \"0\"\r\n    },\r\n    \"submitTime\": \"2022-03-28T11:50:20.819676256Z\",\r\n    \"depositEndTime\": \"2022-03-30T11:50:20.819676256Z\",\r\n    \"totalDeposit\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ],\r\n    \"votingStartTime\": \"2022-03-28T14:25:26.644857113Z\",\r\n    \"votingEndTime\": \"2022-03-30T14:25:26.644857113Z\",\r\n    \"metadata\": \"AQ==\",\r\n    \"title\": \"Test Proposal\",\r\n    \"summary\": \"testing, testing, 1, 2, 3\"\r\n  }\r\n}\r\n```\r\n\r\n#### Proposals\r\n\r\nThe `Proposals` endpoint allows users to query all proposals with optional filters.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Proposals\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Proposals\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposals\": [\r\n    {\r\n      \"proposalId\": \"1\",\r\n      \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n      \"finalTallyResult\": {\r\n        \"yes\": \"0\",\r\n        \"abstain\": \"0\",\r\n        \"no\": \"0\",\r\n        \"noWithVeto\": \"0\"\r\n      },\r\n      \"submitTime\": \"2022-03-28T11:50:20.819676256Z\",\r\n      \"depositEndTime\": \"2022-03-30T11:50:20.819676256Z\",\r\n      \"totalDeposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000010\"\r\n        }\r\n      ],\r\n      \"votingStartTime\": \"2022-03-28T14:25:26.644857113Z\",\r\n      \"votingEndTime\": \"2022-03-30T14:25:26.644857113Z\"\r\n    },\r\n    {\r\n      \"proposalId\": \"2\",\r\n      \"status\": \"PROPOSAL_STATUS_DEPOSIT_PERIOD\",\r\n      \"finalTallyResult\": {\r\n        \"yes\": \"0\",\r\n        \"abstain\": \"0\",\r\n        \"no\": \"0\",\r\n        \"noWithVeto\": \"0\"\r\n      },\r\n      \"submitTime\": \"2022-03-28T14:02:41.165025015Z\",\r\n      \"depositEndTime\": \"2022-03-30T14:02:41.165025015Z\",\r\n      \"totalDeposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10\"\r\n        }\r\n      ],\r\n      \"votingStartTime\": \"0001-01-01T00:00:00Z\",\r\n      \"votingEndTime\": \"0001-01-01T00:00:00Z\"\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"2\"\r\n  }\r\n}\r\n\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Proposals\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Proposals\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposals\": [\r\n    {\r\n      \"id\": \"1\",\r\n      \"messages\": [\r\n        {\"@type\":\"/cosmos.bank.v1beta1.MsgSend\",\"amount\":[{\"denom\":\"stake\",\"amount\":\"10\"}],\"fromAddress\":\"cosmos1..\",\"toAddress\":\"cosmos1..\"}\r\n      ],\r\n      \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n      \"finalTallyResult\": {\r\n        \"yesCount\": \"0\",\r\n        \"abstainCount\": \"0\",\r\n        \"noCount\": \"0\",\r\n        \"noWithVetoCount\": \"0\"\r\n      },\r\n      \"submitTime\": \"2022-03-28T11:50:20.819676256Z\",\r\n      \"depositEndTime\": \"2022-03-30T11:50:20.819676256Z\",\r\n      \"totalDeposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000010\"\r\n        }\r\n      ],\r\n      \"votingStartTime\": \"2022-03-28T14:25:26.644857113Z\",\r\n      \"votingEndTime\": \"2022-03-30T14:25:26.644857113Z\",\r\n      \"metadata\": \"AQ==\",\r\n      \"title\": \"Proposal Title\",\r\n      \"summary\": \"Proposal Summary\"\r\n    },\r\n    {\r\n      \"id\": \"2\",\r\n      \"messages\": [\r\n        {\"@type\":\"/cosmos.bank.v1beta1.MsgSend\",\"amount\":[{\"denom\":\"stake\",\"amount\":\"10\"}],\"fromAddress\":\"cosmos1..\",\"toAddress\":\"cosmos1..\"}\r\n      ],\r\n      \"status\": \"PROPOSAL_STATUS_DEPOSIT_PERIOD\",\r\n      \"finalTallyResult\": {\r\n        \"yesCount\": \"0\",\r\n        \"abstainCount\": \"0\",\r\n        \"noCount\": \"0\",\r\n        \"noWithVetoCount\": \"0\"\r\n      },\r\n      \"submitTime\": \"2022-03-28T14:02:41.165025015Z\",\r\n      \"depositEndTime\": \"2022-03-30T14:02:41.165025015Z\",\r\n      \"totalDeposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10\"\r\n        }\r\n      ],\r\n      \"metadata\": \"AQ==\",\r\n      \"title\": \"Proposal Title\",\r\n      \"summary\": \"Proposal Summary\"\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"2\"\r\n  }\r\n}\r\n```\r\n\r\n#### Vote\r\n\r\nThe `Vote` endpoint allows users to query a vote for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Vote\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\",\"voter\":\"cosmos1..\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Vote\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"vote\": {\r\n    \"proposalId\": \"1\",\r\n    \"voter\": \"cosmos1..\",\r\n    \"option\": \"VOTE_OPTION_YES\",\r\n    \"options\": [\r\n      {\r\n        \"option\": \"VOTE_OPTION_YES\",\r\n        \"weight\": \"1000000000000000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Vote\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\",\"voter\":\"cosmos1..\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Vote\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"vote\": {\r\n    \"proposalId\": \"1\",\r\n    \"voter\": \"cosmos1..\",\r\n    \"option\": \"VOTE_OPTION_YES\",\r\n    \"options\": [\r\n      {\r\n        \"option\": \"VOTE_OPTION_YES\",\r\n        \"weight\": \"1.000000000000000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n#### Votes\r\n\r\nThe `Votes` endpoint allows users to query all votes for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Votes\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Votes\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votes\": [\r\n    {\r\n      \"proposalId\": \"1\",\r\n      \"voter\": \"cosmos1..\",\r\n      \"options\": [\r\n        {\r\n          \"option\": \"VOTE_OPTION_YES\",\r\n          \"weight\": \"1000000000000000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Votes\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Votes\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votes\": [\r\n    {\r\n      \"proposalId\": \"1\",\r\n      \"voter\": \"cosmos1..\",\r\n      \"options\": [\r\n        {\r\n          \"option\": \"VOTE_OPTION_YES\",\r\n          \"weight\": \"1.000000000000000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\n#### Params\r\n\r\nThe `Params` endpoint allows users to query all parameters for the `gov` module.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Params\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"params_type\":\"voting\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Params\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votingParams\": {\r\n    \"votingPeriod\": \"172800s\"\r\n  },\r\n  \"depositParams\": {\r\n    \"maxDepositPeriod\": \"0s\"\r\n  },\r\n  \"tallyParams\": {\r\n    \"quorum\": \"MA==\",\r\n    \"threshold\": \"MA==\",\r\n    \"vetoThreshold\": \"MA==\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Params\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"params_type\":\"voting\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Params\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votingParams\": {\r\n    \"votingPeriod\": \"172800s\"\r\n  }\r\n}\r\n```\r\n\r\n#### Deposit\r\n\r\nThe `Deposit` endpoint allows users to query a deposit for a given proposal from a given depositor.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Deposit\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    '{\"proposal_id\":\"1\",\"depositor\":\"cosmos1..\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Deposit\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposit\": {\r\n    \"proposalId\": \"1\",\r\n    \"depositor\": \"cosmos1..\",\r\n    \"amount\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Deposit\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    '{\"proposal_id\":\"1\",\"depositor\":\"cosmos1..\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Deposit\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposit\": {\r\n    \"proposalId\": \"1\",\r\n    \"depositor\": \"cosmos1..\",\r\n    \"amount\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n#### deposits\r\n\r\nThe `Deposits` endpoint allows users to query all deposits for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/Deposits\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/Deposits\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposits\": [\r\n    {\r\n      \"proposalId\": \"1\",\r\n      \"depositor\": \"cosmos1..\",\r\n      \"amount\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/Deposits\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/Deposits\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposits\": [\r\n    {\r\n      \"proposalId\": \"1\",\r\n      \"depositor\": \"cosmos1..\",\r\n      \"amount\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\n#### TallyResult\r\n\r\nThe `TallyResult` endpoint allows users to query the tally of a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\ncosmos.gov.v1beta1.Query/TallyResult\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1beta1.Query/TallyResult\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"tally\": {\r\n    \"yes\": \"1000000\",\r\n    \"abstain\": \"0\",\r\n    \"no\": \"0\",\r\n    \"noWithVeto\": \"0\",\r\n    \"option_one_count\": \"1000000\",\r\n    \"option_two_count\": \"0\",\r\n    \"option_three_count\": \"0\",\r\n    \"option_four_count\": \"0\",\r\n    \"spam_count\": \"0\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\ncosmos.gov.v1.Query/TallyResult\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ngrpcurl -plaintext \\\r\n    -d '{\"proposal_id\":\"1\"}' \\\r\n    localhost:9090 \\\r\n    cosmos.gov.v1.Query/TallyResult\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"tally\": {\r\n    \"yes\": \"1000000\",\r\n    \"abstain\": \"0\",\r\n    \"no\": \"0\",\r\n    \"noWithVeto\": \"0\"\r\n  }\r\n}\r\n```\r\n\r\n### REST\r\n\r\nA user can query the `gov` module using REST endpoints.\r\n\r\n#### proposal\r\n\r\nThe `proposals` endpoint allows users to query a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposal\": {\r\n    \"proposal_id\": \"1\",\r\n    \"content\": null,\r\n    \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n    \"final_tally_result\": {\r\n      \"yes\": \"0\",\r\n      \"abstain\": \"0\",\r\n      \"no\": \"0\",\r\n      \"no_with_veto\": \"0\"\r\n    },\r\n    \"submit_time\": \"2022-03-28T11:50:20.819676256Z\",\r\n    \"deposit_end_time\": \"2022-03-30T11:50:20.819676256Z\",\r\n    \"total_deposit\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000010\"\r\n      }\r\n    ],\r\n    \"voting_start_time\": \"2022-03-28T14:25:26.644857113Z\",\r\n    \"voting_end_time\": \"2022-03-30T14:25:26.644857113Z\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposal\": {\r\n    \"id\": \"1\",\r\n    \"messages\": [\r\n      {\r\n        \"@type\": \"/cosmos.bank.v1beta1.MsgSend\",\r\n        \"from_address\": \"cosmos1..\",\r\n        \"to_address\": \"cosmos1..\",\r\n        \"amount\": [\r\n          {\r\n            \"denom\": \"stake\",\r\n            \"amount\": \"10\"\r\n          }\r\n        ]\r\n      }\r\n    ],\r\n    \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n    \"final_tally_result\": {\r\n      \"yes_count\": \"0\",\r\n      \"abstain_count\": \"0\",\r\n      \"no_count\": \"0\",\r\n      \"no_with_veto_count\": \"0\"\r\n    },\r\n    \"submit_time\": \"2022-03-28T11:50:20.819676256Z\",\r\n    \"deposit_end_time\": \"2022-03-30T11:50:20.819676256Z\",\r\n    \"total_deposit\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ],\r\n    \"voting_start_time\": \"2022-03-28T14:25:26.644857113Z\",\r\n    \"voting_end_time\": \"2022-03-30T14:25:26.644857113Z\",\r\n    \"metadata\": \"AQ==\",\r\n    \"title\": \"Proposal Title\",\r\n    \"summary\": \"Proposal Summary\"\r\n  }\r\n}\r\n```\r\n\r\n#### proposals\r\n\r\nThe `proposals` endpoint also allows users to query all proposals with optional filters.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposals\": [\r\n    {\r\n      \"proposal_id\": \"1\",\r\n      \"content\": null,\r\n      \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n      \"final_tally_result\": {\r\n        \"yes\": \"0\",\r\n        \"abstain\": \"0\",\r\n        \"no\": \"0\",\r\n        \"no_with_veto\": \"0\"\r\n      },\r\n      \"submit_time\": \"2022-03-28T11:50:20.819676256Z\",\r\n      \"deposit_end_time\": \"2022-03-30T11:50:20.819676256Z\",\r\n      \"total_deposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000\"\r\n        }\r\n      ],\r\n      \"voting_start_time\": \"2022-03-28T14:25:26.644857113Z\",\r\n      \"voting_end_time\": \"2022-03-30T14:25:26.644857113Z\"\r\n    },\r\n    {\r\n      \"proposal_id\": \"2\",\r\n      \"content\": null,\r\n      \"status\": \"PROPOSAL_STATUS_DEPOSIT_PERIOD\",\r\n      \"final_tally_result\": {\r\n        \"yes\": \"0\",\r\n        \"abstain\": \"0\",\r\n        \"no\": \"0\",\r\n        \"no_with_veto\": \"0\"\r\n      },\r\n      \"submit_time\": \"2022-03-28T14:02:41.165025015Z\",\r\n      \"deposit_end_time\": \"2022-03-30T14:02:41.165025015Z\",\r\n      \"total_deposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10\"\r\n        }\r\n      ],\r\n      \"voting_start_time\": \"0001-01-01T00:00:00Z\",\r\n      \"voting_end_time\": \"0001-01-01T00:00:00Z\"\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"2\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"proposals\": [\r\n    {\r\n      \"id\": \"1\",\r\n      \"messages\": [\r\n        {\r\n          \"@type\": \"/cosmos.bank.v1beta1.MsgSend\",\r\n          \"from_address\": \"cosmos1..\",\r\n          \"to_address\": \"cosmos1..\",\r\n          \"amount\": [\r\n            {\r\n              \"denom\": \"stake\",\r\n              \"amount\": \"10\"\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"status\": \"PROPOSAL_STATUS_VOTING_PERIOD\",\r\n      \"final_tally_result\": {\r\n        \"yes_count\": \"0\",\r\n        \"abstain_count\": \"0\",\r\n        \"no_count\": \"0\",\r\n        \"no_with_veto_count\": \"0\"\r\n      },\r\n      \"submit_time\": \"2022-03-28T11:50:20.819676256Z\",\r\n      \"deposit_end_time\": \"2022-03-30T11:50:20.819676256Z\",\r\n      \"total_deposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000010\"\r\n        }\r\n      ],\r\n      \"voting_start_time\": \"2022-03-28T14:25:26.644857113Z\",\r\n      \"voting_end_time\": \"2022-03-30T14:25:26.644857113Z\",\r\n      \"metadata\": \"AQ==\",\r\n      \"title\": \"Proposal Title\",\r\n      \"summary\": \"Proposal Summary\"\r\n    },\r\n    {\r\n      \"id\": \"2\",\r\n      \"messages\": [\r\n        {\r\n          \"@type\": \"/cosmos.bank.v1beta1.MsgSend\",\r\n          \"from_address\": \"cosmos1..\",\r\n          \"to_address\": \"cosmos1..\",\r\n          \"amount\": [\r\n            {\r\n              \"denom\": \"stake\",\r\n              \"amount\": \"10\"\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"status\": \"PROPOSAL_STATUS_DEPOSIT_PERIOD\",\r\n      \"final_tally_result\": {\r\n        \"yes_count\": \"0\",\r\n        \"abstain_count\": \"0\",\r\n        \"no_count\": \"0\",\r\n        \"no_with_veto_count\": \"0\"\r\n      },\r\n      \"submit_time\": \"2022-03-28T14:02:41.165025015Z\",\r\n      \"deposit_end_time\": \"2022-03-30T14:02:41.165025015Z\",\r\n      \"total_deposit\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10\"\r\n        }\r\n      ],\r\n      \"voting_start_time\": null,\r\n      \"voting_end_time\": null,\r\n      \"metadata\": \"AQ==\",\r\n      \"title\": \"Proposal Title\",\r\n      \"summary\": \"Proposal Summary\"\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"2\"\r\n  }\r\n}\r\n```\r\n\r\n#### voter vote\r\n\r\nThe `votes` endpoint allows users to query a vote for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1/votes/cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"vote\": {\r\n    \"proposal_id\": \"1\",\r\n    \"voter\": \"cosmos1..\",\r\n    \"option\": \"VOTE_OPTION_YES\",\r\n    \"options\": [\r\n      {\r\n        \"option\": \"VOTE_OPTION_YES\",\r\n        \"weight\": \"1.000000000000000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1/votes/cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"vote\": {\r\n    \"proposal_id\": \"1\",\r\n    \"voter\": \"cosmos1..\",\r\n    \"options\": [\r\n      {\r\n        \"option\": \"VOTE_OPTION_YES\",\r\n        \"weight\": \"1.000000000000000000\"\r\n      }\r\n    ],\r\n    \"metadata\": \"\"\r\n  }\r\n}\r\n```\r\n\r\n#### votes\r\n\r\nThe `votes` endpoint allows users to query all votes for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}/votes\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1/votes\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votes\": [\r\n    {\r\n      \"proposal_id\": \"1\",\r\n      \"voter\": \"cosmos1..\",\r\n      \"option\": \"VOTE_OPTION_YES\",\r\n      \"options\": [\r\n        {\r\n          \"option\": \"VOTE_OPTION_YES\",\r\n          \"weight\": \"1.000000000000000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}/votes\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1/votes\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"votes\": [\r\n    {\r\n      \"proposal_id\": \"1\",\r\n      \"voter\": \"cosmos1..\",\r\n      \"options\": [\r\n        {\r\n          \"option\": \"VOTE_OPTION_YES\",\r\n          \"weight\": \"1.000000000000000000\"\r\n        }\r\n      ],\r\n      \"metadata\": \"\"\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\n#### params\r\n\r\nThe `params` endpoint allows users to query all parameters for the `gov` module.\r\n\r\n<!-- TODO: #10197 Querying governance params outputs nil values -->\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/params/{params_type}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/params/voting\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"voting_params\": {\r\n    \"voting_period\": \"172800s\"\r\n  },\r\n  \"deposit_params\": {\r\n    \"min_deposit\": [\r\n    ],\r\n    \"max_deposit_period\": \"0s\"\r\n  },\r\n  \"tally_params\": {\r\n    \"quorum\": \"0.000000000000000000\",\r\n    \"threshold\": \"0.000000000000000000\",\r\n    \"veto_threshold\": \"0.000000000000000000\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/params/{params_type}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/params/voting\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"voting_params\": {\r\n    \"voting_period\": \"172800s\"\r\n  },\r\n  \"deposit_params\": {\r\n    \"min_deposit\": [\r\n    ],\r\n    \"max_deposit_period\": \"0s\"\r\n  },\r\n  \"tally_params\": {\r\n    \"quorum\": \"0.000000000000000000\",\r\n    \"threshold\": \"0.000000000000000000\",\r\n    \"veto_threshold\": \"0.000000000000000000\"\r\n  }\r\n}\r\n```\r\n\r\n#### deposits\r\n\r\nThe `deposits` endpoint allows users to query a deposit for a given proposal from a given depositor.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1/deposits/cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposit\": {\r\n    \"proposal_id\": \"1\",\r\n    \"depositor\": \"cosmos1..\",\r\n    \"amount\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1/deposits/cosmos1..\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposit\": {\r\n    \"proposal_id\": \"1\",\r\n    \"depositor\": \"cosmos1..\",\r\n    \"amount\": [\r\n      {\r\n        \"denom\": \"stake\",\r\n        \"amount\": \"10000000\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n#### proposal deposits\r\n\r\nThe `deposits` endpoint allows users to query all deposits for a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1/deposits\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposits\": [\r\n    {\r\n      \"proposal_id\": \"1\",\r\n      \"depositor\": \"cosmos1..\",\r\n      \"amount\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}/deposits\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1/deposits\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"deposits\": [\r\n    {\r\n      \"proposal_id\": \"1\",\r\n      \"depositor\": \"cosmos1..\",\r\n      \"amount\": [\r\n        {\r\n          \"denom\": \"stake\",\r\n          \"amount\": \"10000000\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagination\": {\r\n    \"next_key\": null,\r\n    \"total\": \"1\"\r\n  }\r\n}\r\n```\r\n\r\n#### tally\r\n\r\nThe `tally` endpoint allows users to query the tally of a given proposal.\r\n\r\nUsing legacy v1beta1:\r\n\r\n```bash\r\n/cosmos/gov/v1beta1/proposals/{proposal_id}/tally\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1beta1/proposals/1/tally\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"tally\": {\r\n    \"yes\": \"1000000\",\r\n    \"abstain\": \"0\",\r\n    \"no\": \"0\",\r\n    \"no_with_veto\": \"0\"\r\n  }\r\n}\r\n```\r\n\r\nUsing v1:\r\n\r\n```bash\r\n/cosmos/gov/v1/proposals/{proposal_id}/tally\r\n```\r\n\r\nExample:\r\n\r\n```bash\r\ncurl localhost:1317/cosmos/gov/v1/proposals/1/tally\r\n```\r\n\r\nExample Output:\r\n\r\n```bash\r\n{\r\n  \"tally\": {\r\n    \"yes\": \"1000000\",\r\n    \"abstain\": \"0\",\r\n    \"no\": \"0\",\r\n    \"no_with_veto\": \"0\"\r\n  }\r\n}\r\n```\r\n\r\n## Metadata\r\n\r\nThe gov module has two locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the gov and group modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure across chains.\r\n\r\n### Proposal\r\n\r\nLocation: off-chain as json object stored on IPFS (mirrors [group proposal](../group/README.md#metadata))\r\n\r\n```json\r\n{\r\n  \"title\": \"\",\r\n  \"authors\": [\"\"],\r\n  \"summary\": \"\",\r\n  \"details\": \"\",\r\n  \"proposal_forum_url\": \"\",\r\n  \"vote_option_context\": \"\",\r\n}\r\n```\r\n\r\n:::note\r\nThe `authors` field is an array of strings, this is to allow for multiple authors to be listed in the metadata.\r\nIn v0.46, the `authors` field is a comma-separated string. Frontends are encouraged to support both formats for backwards compatibility.\r\n:::\r\n\r\n### Vote\r\n\r\nLocation: on-chain as json within 255 character limit (mirrors [group vote](../group/README.md#metadata))\r\n\r\n```json\r\n{\r\n  \"justification\": \"\",\r\n}\r\n```"},"author":{"user":"https://learnblockchain.cn/people/19936","address":"0xbabb650e9755e6d0f6197a4ed013ec5732795709"},"history":"bafkreieo3yu2mf7rpgbf5l7xy4n6j6d56vqqw5pn3f6rzunvfli6toz2zm","timestamp":1721035066,"version":1}