github.com/decred/politeia@v1.4.0/politeiawww/cmd/politeiavoter/README.md (about)

     1  # Politeia Voter
     2  
     3  `politeiavoter` is a command line utility that can be used to issue votes on
     4  proposals.
     5  
     6  Configuration and logs Linux/BSD/POSIX:
     7  The tool keeps logs and configuration files in the ~/.politeiavoter directory
     8  
     9  Configuration and logs Windows:
    10  The tool keeps logs and configuration files in the %LOCALAPPDATA%\Politeiavoter
    11  directory
    12  
    13  Configuration and logs macOS/OSX:
    14  The tool keeps logs and configuration files in the ~/Library/Application
    15  Support/Politeiavoter directory
    16  
    17  In the following examples the config file contained the following entry:
    18  ```
    19  testnet=1
    20  ```
    21  
    22  If you want to run multiple pivoters on the same machine while keeping them
    23  physically separated use the `appdata` setting in the config file. Then launch
    24  `politeiavoter` and point it to the config file using the `-C` option.  For
    25  example:
    26  ```
    27  $ politeiavoter -C ~/.politeiavoter2/politeiavoter.conf
    28  ```
    29  Excerpt from the `politeiavoter.conf` file:
    30  ```
    31  appdata=~/.politeiavoter2
    32  ```
    33  
    34  ## Requirements
    35  
    36  Voting requires access to wallet GRPC. Therefore this tool needs the wallet's
    37  server certificate to authenticate the server, as well as a local client keypair
    38  to authenticate the client to `dcrwallet`.  The server certificate by default
    39  will be found in `~/.dcrwallet/rpc.cert`, and this can be modified to another
    40  path using the `--walletgrpccert` flag.  Client certs can be generated using
    41  [`gencerts`](https://github.com/decred/dcrd/blob/master/cmd/gencerts/) and
    42  `politeiavoter` will read `client.pem` and `client-key.pem` from its application
    43  directory by default.  The certificate (`client.pem`) must be appended to
    44  `~/.dcrwallet/clients.pem` in order for `dcrwallet` to trust the client.
    45  
    46  For example:
    47  
    48  ```
    49  $ gencerts ~/.politeiavoter/client{,-key}.pem
    50  $ cat ~/.politeiavoter/client.pem >> ~/.dcrwallet/clients.pem
    51  ```
    52  
    53  In order to sign votes ```politeiavoter``` requires the wallet passphrase.
    54  
    55  In order to use the "vote trickler" functionality one must use Tor. Without Tor
    56  the server administrator will still know where the votes came from rendering
    57  the trickling worthless.
    58  
    59  ## Workflow
    60  
    61  ```politeiavoter``` supports four commands:
    62  
    63  ```
    64    inventory - Retrieve all proposals that are being voted on
    65    vote      - Vote on a proposal
    66    tally     - Tally votes on a proposal
    67    verify    - Verify a or ALL votes
    68  ```
    69  
    70  First one obtains the list of active proposals that are up for voting:
    71  ```
    72  politeiavoter inventory
    73  ```
    74  
    75  This will output all eligible votes.
    76  ```
    77  Vote: 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67
    78    Proposal        : This is a description
    79    Start block     : 282899
    80    End block       : 284915
    81    Mask            : 3
    82    Eligible tickets: 9
    83    Vote Option:
    84      Id                   : no
    85      Description          : Don't approve proposal
    86      Bits                 : 1
    87      To choose this option: politeiavoter vote 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67 no
    88    Vote Option:
    89      Id                   : yes
    90      Description          : Approve proposal
    91      Bits                 : 2
    92      To choose this option: politeiavoter vote 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67 yes
    93  ```
    94  
    95  In this example the user has **9** eligible tickets to vote.
    96  
    97  The vote choice is printed during inventory and one can simply copy & paste
    98  that into the shell.
    99  
   100  ```
   101  politeiavoter vote 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67 yes
   102  ```
   103  The tool will prompt for the wallet decryption passphrase and then takes a few
   104  seconds to vote.
   105  
   106  ```
   107  Enter the private passphrase of your wallet:
   108  Votes succeeded: 9
   109  Votes failed   : 0
   110  ```
   111  
   112  Note: that the tool at this time votes the same choice for **all available**
   113  tickets.
   114  
   115  To get the current tally of votes.
   116  ```
   117  politeiavoter tally 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67
   118  Vote Option:
   119    Id                   : no
   120    Description          : Don't approve proposal
   121    Bits                 : 1
   122    Votes received       : 0
   123    Percentage           : 0%
   124  Vote Option:
   125    Id                   : yes
   126    Description          : Approve proposal
   127    Bits                 : 2
   128    Votes received       : 9
   129    Percentage           : 100%
   130  ```
   131  
   132  ## Cross verification of vote data
   133  
   134  The `verify` command verifies the local journals against the `politeia` recoded
   135  voting activity. The point of this command is to enable the human to determine
   136  if vote failures occured and provides the necessary data to debug issues. For a
   137  non-developer this option is only interesting to see if the journals match the
   138  server data. The verify action can only be run on a completed vote.
   139  
   140  Display all votes that have occured:
   141  ```
   142  $ politeiavoter verify
   143  Votes:
   144    012b4e335f25704e28ef196d650316dca421f730225d39e37b31b3c646eb8497
   145    023091831f6434f743f3a317aacf8c73a123b30d758db854a2f294c0b3341bcc
   146  ```
   147  
   148  Verify a single vote:
   149  ```
   150  $ politeiavoter verify 023091831f6434f743f3a317aacf8c73a123b30d758db854a2f294c0b3341bcc
   151  == NO failed votes proposal 023091831f6434f743f3a317aacf8c73a123b30d758db854a2f294c0b3341bcc
   152  ```
   153  
   154  Verify all votes:
   155  ```
   156  $ politeiavoter verify ALL
   157  == NO failed votes proposal 012b4e335f25704e28ef196d650316dca421f730225d39e37b31b3c646eb8497
   158  == NO failed votes proposal 023091831f6434f743f3a317aacf8c73a123b30d758db854a2f294c0b3341bcc
   159  ```
   160  
   161  ## Privacy considerations
   162  
   163  By default, ```politeiavoter``` votes all eligible tickets in a single shot.
   164  Thus giving away to the server operator which IP address controls which
   165  tickets.  While this information is NOT visible externally the more privacy
   166  conscience user may want to spread voting out over time and using tor to mask
   167  IP address.
   168  
   169  ```politeiavoter``` has three settings to control this behavior. First there is
   170  the ```--trickle``` setting. This must be set to enable trickling. The second
   171  setting is ```--proxy```. This setting makes ```politeiavoter``` use a Tor
   172  proxy and is *REQUIRED* when trickling votes since it makes no sense to trickle
   173  votes from the same IP.
   174  
   175  The third setting is ```--voteduration```. This sets the maximum duration to
   176  trickle out votes. Valid modifiers are h for hours, m for minutes and s for
   177  seconds (e.g. 3h18m15s). If this setting is NOT set then ```politeiavoter```
   178  will try to spread the votes out over the remaining vote duration minus one
   179  day.  If it can't autodetect a proper duration it will error out so that the
   180  user can provide one.
   181  
   182  E.g. running Tor software on the local machine with 10 votes:
   183  ```
   184  politeiavoter --proxy=127.0.0.1:9050 --trickle --voteduration=30m vote 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67 yes
   185  ```
   186  
   187  Running Tor software on the local machine with 10 votes and autodetect duration:
   188  ```
   189  politeiavoter --proxy=127.0.0.1:9050 --trickle vote 8bdebbc55ae74066cc57c76bc574fd1517111e56b3d1295bde5ba3b0bd7c3f67 yes
   190  ```