7

Are there any command line tools to vote on The DAO proposals?

I would like to:

  • List the open proposals
  • Check whether I have already voted on these proposals
  • Check my voting history
  • Vote on the proposals for each of my accounts with The DAO token balances
  • Check my account balance, and show me which accounts have The DAO token transfers blocked, by which proposal and the expiry time
  • And do this from the command line

Why would I want to do this from the command line?

  • I want to vote without having to send my details (wallets and passwords) over the Internet.
  • I don't want to wait for the Ethereum Wallet (Mist) to unfreeze, and I cannot view the list of proposals in Mist.
  • And I just wanna use geth (with a simpler interface).
8

Yes. Here Is theDAOVoter

Description

theDAOVoter v1.0000000000000003 is a little Perl script (~808 lines, 738 source lines) that will allow you to:

  • List The DAO proposals.
  • List your accounts, displaying whether The DAO transfers are blocked due to opened votes and expiry time.
  • List the DAO proposals with a listing of your accounts showing which accounts have already voted on each proposal. Past votes can also be listed along with the actual gas used.
  • Vote on The DAO proposals from your accounts.

The script will run in Linux, should run on Mac OS/X and may run on Windows using one of the Perl distributions including Cygwin and Active State Perl.

You will need geth to be installed, and the blockchain to be synced.


Where Can I Find theDAOVoter

theDAOVoter can be found on Github - BokkyPooBah/TheDAOVoter.


How Does theDAOVoter Work?

The script calls the geth with the attach option, running the Go Ethereum JavaScript API to query the Ethereum blockchain.

Read the Perl script - it's only 808 lines. And use the --verbose option if you want to see the exact commands executed by this script.

You only have to enter your geth keystore password when you use the --vote command to vote on proposals.

See below for the list of the Go Ethereum JavaScript API commands used and The DAO functions called.


Sample

# List all your accounts including the totals
user@Kumquat:~$ theDAOVoter --listaccounts
  # Account                                                            ETH                        DAO The DAO transfer blocked by OPEN proposal?
--- ------------------------------------------ --------------------------- -------------------------- ------------------------------------------
  0 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa      111.111111111111111111       111.0000000000000000 #2 OPEN until Sun Jun 12 03:18:37 2016
  1 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb      222.222222222222222222       222.0000000000000000
--- ------------------------------------------ --------------------------- --------------------------
  3 Total                                           333.333333333333333333       333.0000000000000000

# List proposal #2 checking the voting status of this proposal from your accounts
user@Kumquat:~$ theDAOVoter --listproposals --id=2 --checkvotingstatus --checkpastvotes
=========================================================================================================================================
Proposal 2. OPEN until Sun Jun 12 03:18:37 2016
Votes       Yea 2473115 (44.20%) Nay 3122385 (55.80%) Quorum 0.48% of 20%
Creator     0x5a8e70f2d75c1468db4a2241fdd70e5a84f028b8
Recipient   0xbb9bc244d798123fde783fcc1c72d3bb8c189413
Deposit     2 ETH
Amount      0 ETH
New curator N
-----------------------------------------------------------------------------------------------------------------------------------------
Do you believe in god?
-----------------------------------------------------------------------------------------------------------------------------------------

  # Account                                                            ETH                        DAO  Est Gas Voting Status
--- ------------------------------------------ --------------------------- -------------------------- -------- -------------
  0 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa      111.111111111111111111       111.0000000000000000    56287 Voted Nay
  1 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb      222.222222222222222222       222.0000000000000000    70851 Not voted yet
--- ------------------------------------------ --------------------------- -------------------------- -------- -------------
=========================================================================================================================================

# A NO vote on proposal #2 from account #1
user@Kumquat:~$ theDAOVoter --vote --id=2 --account=1 --support=0
Enter password for 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb to vote: 
Transaction Id 0x5555555555555555555555555555555555555555555555555555555555555555


The More Frequently Used Commands

Instructions are on the main page, and here are the more frequently used commands:

Help

theDAOVoter

List accounts and display whether the account is blocked by votes in progress

theDAOVoter --listaccounts

List proposals (excluding splits, open proposals only)

theDAOVoter --listproposals 

List proposals (excluding splits, open proposals only) and check voting status for your accounts

theDAOVoter --listproposals --checkvotingstatus

List proposals #2 and check voting status for your accounts

theDAOVoter --listproposals --id=2 --checkvotingstatus

List open proposals and check voting status and past votes for your accounts

theDAOVoter --listproposals --checkvotingstatus --checkpastvotes

Vote on proposal #2 from account #1, not supporting this vote

theDAOVoter --vote --id=2 --account=1 --support=0


Go Ethereum (geth) JavaScript API Commands Used And The DAO Functions Called

Listing Balance

  • eth.getBalance(account)
  • theDAO.balanceOf(account)
  • theDAO.blocked(account)
  • theDAO.proposals(proposalId)

Listing Proposals

  • theDAO.numberOfProposals()
  • theDAO.proposals(proposalId)
  • theDAO.minQuorumDivisor()
  • theDAO.totalSupply()

Check Voting Status

  • eth.estimateGas(theDAO.vote(...))

Check Voting History

  • theDAO.Voted.watch(...)
  • eth.getTransactionReceipt(...)

Voting

  • personal.unlockAccount(...)
  • theDAO.vote(...)


Warning

This script uses the same method as the Ethereum Wallet (Mist) to unlock your account in geth when you are sending your vote to the Ethereum blockchain. Make sure that you start geth without the --rpc option when using geth with this script. See the following URL about the security issues with this keystore unlocking methodology: How to reduce the chances of your Ethereum wallet getting hacked?


See Also


Enjoy, and vote well. BokkyPooBah 2016.

  • 3
    Perl programmers talking to themselves, I am not surprised ;-) – Roland Kofler Jun 3 '16 at 13:48
  • 2
    Mumble mumble but it is concise (terse). Only 780 lines, 711 without comments. :-) – The Officious BokkyPooBah Jun 3 '16 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.