aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[aptos-cli] Add governance commands

Open gregnazario opened this issue 3 years ago • 2 comments

Description

This provides a simple submit proposal and vote flow. It does need some work on printing out the proposal, but it does generate the hash of the metadata and the metadata parsing on its own.

We can create a separate PR and command for showing the proposal next.

Test Plan

I can sort of run the governance, but I need to do the extra steps to allocate stake etc.

 cargo build -p aptos && aptos governance propose --pool-address local --metadata-url https://gist.githubusercontent.com/gregnazario/dae573cbb50ef25f8ab138a0c3daedae/raw/0ea04e4ea498b83bfd02a78a5e9091ff1696ee75/gistfile1.txt --execution-hash 0000000000000000000000000000000000000000000000000000000000000000 --profile local
    Finished dev [unoptimized + debuginfo] target(s) in 0.35s
Proposal:
        Title:TestProposal
        Description:This is a test proposal
        Script URL:https://gist.githubusercontent.com/movekevin/b842818ab748136cfa8d538982d3e3b0/raw/950dd73841216ab73d2c324da903d6407e78976e/gistfile1.txt
        Script hash:3fe6c4a4693798ad3fa64cc04958871d8441b8855f7fc149a29f821263330491
Do you want to submit this proposal? [yes/no] >
yes
{
  "Error": "API error: Request failed: RestError { code: 404, message: \"resource not found by address(0x7c386c9efa349dd81eb695561e0b7e45d96b817a5e1d94cc77aa47f330043f7a), struct tag(0x1::account::Account) and ledger version(133)\", aptos_ledger_version: Some(U64(133)) }"
}

This change is Reviewable

gregnazario avatar Jul 20 '22 05:07 gregnazario

I see this only seems to support one file for the source- how would a multifile source work?

CapCap avatar Jul 28 '22 17:07 CapCap

I see this only seems to support one file for the source- how would a multifile source work?

I don't think even a single file source would work, you would need to give a folder or a zip that contains the move.toml with the source

gregnazario avatar Jul 29 '22 06:07 gregnazario

:white_check_mark: Forge test success on ac708d9e0d9d32f9ab5efa855cea670f60fdc315

all up : 4334 TPS, 3935 ms latency, 7000 ms p99 latency,no expired txns

github-actions[bot] avatar Aug 01 '22 17:08 github-actions[bot]