dYdX Chain Technical Docs
  • πŸ‘‹dYdX Chain Technical Documentation
  • Getting Started
    • πŸ’‘Developer Tools
      • dYdX Chain Client for Javascript
        • Example #1: Accessing Subaccount Data
        • Example #2: Faucet Endpoints
        • Additional Javascript Client Examples
      • dYdX Chain Client for Python
        • Example #1: Placing, Replacing, and Canceling Orders
        • Exmaple #2: Trading with HRN
        • Additional Python Client Examples
      • dYdX CLI
        • Setup the dYdX CLI
        • EOA Wallets
        • Multisig wallet
        • Submit a governance proposal
    • ✨Developer Guides
    • 🦊User Guides
      • How to use Squid UI for cross-chain deposits to dYdX V4
      • How to use CCTP UI for cross-chain deposits to dYdX V4
      • How to withdraw and transfer funds from a subaccount using Command Line
    • ❓FAQ & Resources
    • πŸ–₯️Open Source Repositories
  • Validators
    • πŸ› οΈGetting set up
      • Hardware Requirements
      • Required Node Configs
      • Running a Validator
      • Running a Full Node
      • Snapshots
      • Validator Upgrades
    • ❓FAQ & Resources
    • πŸ§‘Active Validator Slack
  • Front End & Wallets
    • πŸ“šArchitecture Overview
    • 🌎Web Front End
    • ❓FAQ & Resources
  • Data Dashboards & Open APIs
    • πŸ“ŠPublic Dashboards
    • ❓FAQ & Resources
  • Disclaimers
    • πŸ“„Disclaimer
    • πŸ”“Privacy Policy
Powered by GitBook
On this page
  • Submit a Governance Proposal via CLI (Mac)
  • Prerequisites
  • Create an address to submit the proposal
  • Preparing a governance proposal
  1. Getting Started
  2. Developer Tools
  3. dYdX CLI

Submit a governance proposal

PreviousMultisig walletNextDeveloper Guides

Last updated 1 year ago

Submit a Governance Proposal via CLI (Mac)

In this guide, we will provide a step-by-step walkthrough on how to submit a governance proposal using the Command Line Interface (CLI).

Prerequisites

  • Have homebrew:

  • Install Go 1.21, git

  • Follow the dYdX setup guide below

Create an address to submit the proposal

Set up a dYdX Chain address:

$ dydxprotocold keys add <address name>

- address: dydx1m5...dfpe3
  name: <address name>
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"BrarpF..Q1"}'
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

Some mnemonic words...

Preparing a governance proposal

  1. Do a test transaction to initialize the address or the chain will not know you initialized a new address. This can be done by receiving some funds in your new wallet.

//testproposal.json
{
	"title": "Title of test proposal",
	"deposit": "200000adv4tnt",
	"summary": "Summary of the test proposal",
	"metadata": "Link to DRC, or other relevant metadata",
	"messages": [
		{
			"@type": "/cosmos.gov.v1.MsgExecLegacyContent",
			"content": {
				"@type": "/cosmos.gov.v1beta1.TextProposal",
				"title": "Title of TextProposal message",
				"description": "Description of TextProposal message"
			},
			"authority": "dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky"
		}
	]
}
//proposal.json
{
	"title": "Title of test proposal",
	"deposit": "10000000000000000000000adydx",
	"summary": "Summary of the test proposal",
	"metadata": "Link to DRC, or other relevant metadata",
	"messages": [
		{
			"@type": "/cosmos.gov.v1.MsgExecLegacyContent",
			"content": {
				"@type": "/cosmos.gov.v1beta1.TextProposal",
				"title": "Title of TextProposal message",
				"description": "Description of TextProposal message"
			},
			"authority": "dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky"
		}
	]
}

  • deposit cannot be less than the minimum deposit amount, which is 2000 DYDX, or 2000000000000000000000adydx . In the example above, we use 10000 DYDX, which will make the proposal active upon publishing.

  • messages can contain more than one message for sub-items of the proposal, but cannot be empty, i.e. a proposal needs at least one motion. Adding more than one message would look like follows

"messages": [
    {
        [MESSAGE 1]
    },
    {
        [MESSAGE 2]
    },
    ...
   ]
  • authorityuse the same authority for each message - dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky

  1. Create the proposal Tx.

πŸ’‘ This step can be executed from any workstation. It is not even necessary to have added neither walletA , walletB , walletC nor ourMultisig .

Submit the proposal first on Testnet and if succssful, submit the proposal on mainnet.

$ dydxprotocold tx gov submit-proposal \<JSONfilename>.json \
    --chain-id dydx-testnet-4 \
    --yes --broadcast-mode sync \
    --fees 5000000000000000adv4tnt \
    --from dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smh \
    --node https://testnet-dydx-rpc.lavenderfive.com:443
    
auth_info:
  fee:
    amount:
    - amount: "5000000000000000"
      denom: adv4tnt
    gas_limit: "200000"
    granter: ""
    payer: ""
  signer_infos: []
  tip: null
body:
  extension_options: []
  memo: ""
  messages:
  - '@type': /cosmos.gov.v1.MsgSubmitProposal
    initial_deposit:
    - amount: "200000"
      denom: adv4tnt
    messages:
    - '@type': /cosmos.gov.v1.MsgExecLegacyContent
      authority: dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky
      content:
        '@type': /cosmos.gov.v1beta1.TextProposal
        description: Description of TextProposal message
        title: Title of TextProposal message
    metadata: Link to DRC, or other relevant metadata
    proposer: dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smh
    summary: Summary of the test proposal
    title: Title of test proposal
  non_critical_extension_options: []
  timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: F45964CE07EC68FC0BF826D...6572790E004FE555C7FAD
dydxprotocold tx gov submit-proposal \<JSONfilename>.json \
    --chain-id dydx-mainnet-1 \
    --yes --broadcast-mode sync \
    --fees 2500000000000000adydx \
    --from dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smh \
    --node https://dydx-rpc.lavenderfive.com:443
  • dydx1z79c98w069eugzjme0dkd6quuhm8vfh2a00smh is the address of the multisig from which we send tokens - in case you have instantiated the multisig locally, you can use it’s name, e.g. ourMultisig

  • proposalFile.json is the path to the file where you have store the proposal JSON

  • fees value 5000000000000000adydx may need adjustment; the transaction will fail only when broadcasted if this amount is not enough

Create a new JSON file based on previous proposals to get the correct format. Refer to previous proposals here: , for example:

πŸ’‘
https://brew.sh/
Setup the dYdX CLI
https://www.mintscan.io/dydx/proposals