Git Product home page Git Product logo

trust-vote-site's Introduction

trust-vote-site

Dash Trust Elections - MNO Voting Site

Uses @dashevo/dashcore-lib to verify signatures in-browser.

Hint: Messages are signed the same in Dash-QT as with dash-cli:

./private-key.wif:

XK5DHnAiSj6HQNsNcDkawd9qdp8UFMdYftdVZFuRreTMJtbJhk8i
my_private_key="$(cat ./private-key.wif)"

my_vote='dte2019-efigaro|lcole|sfigaro|cchere'

dash-cli signmessagewithprivkey \
    "${my_private_key}" \
    "${my_vote}"
H3B3fGVZM2joBDmuTptj7gPI0bTFWWE1YZEPoB/5TtYudBRmiP0zszPmtUPqVQJrQzzL2rVgEOdcUAcZNbEzne0=

Alternatively, you can use dashmsg:

curl https://webinstall.dev/dashmsg | bash
export PATH="$HOME/.local/bin:$PATH"
dashmsg sign ./private-key.wif  "dte2019-efigaro|lcole|sfigaro|cchere"
H3B3fGVZM2joBDmuTptj7gPI0bTFWWE1YZEPoB/5TtYudBRmiP0zszPmtUPqVQJrQzzL2rVgEOdcUAcZNbEzne0=

Project Structure

.
├── README.md
├── example.env
├── package-lock.json
├── package.json
├── public/
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
├── build/
│   └── ...
└── src/
    ├── apis/
    │   └── dtevote.js
    ├── candidates.json
    ├── components/
    │   ├── App.js
    │   ├── CandidateList.css
    │   ├── CandidateList.js
    │   ├── CandidateSelector.css
    │   ├── CandidateSelector.js
    │   ├── Closed.js
    │   ├── DashLogo.js
    │   └── VoteMessage.js
    ├── index.js
    └── logo.svg

Pre-Reqs

  1. Get Node.js
    # Mac & Linux
    curl https://webinstall.dev/node | bash
    # Windows
    curl.exe -A MS https://webinstall.dev/node | powershell

Setup

  1. Clone the project

    git clone https://github.com/dashevo/trust-vote-site
    pushd ./trust-vote-site/
  2. Configure with .env

    rsync -avhP ./example.env ./.env

    .env:

    # necessary to get the fatty mcfat-fat react app to build
    NODE_OPTIONS='--max-old-space-size=4096'
    
    # season to taste
    PUBLIC_URL='https://vote.example.com'
    
    REACT_APP_API_URL='https://vote-api.example.com'
    
    REACT_APP_CANDIDACY_FORM_URL='https://docs.google.com/forms/...'
    
    # the ISO+Offset time when voting will start and end
    REACT_APP_VOTING_END_DATE='2022-04-03T00:00:00Z'
    REACT_APP_VOTING_END_DATE='2022-04-15T00:00:00Z'
    
    # a unique vote identifier as part of the message hash
    REACT_APP_VOTE_PREFIX='dte2022-'
    
    REACT_APP_DASH_NETWORK='testnet'
    
    # additional REACT_APP_* will be made available to the browser
  3. Manually update candidates.json

    [
      {
        "alias": "name3",
        "text": "Cyrus Tafti",
        "value": "ctafti",
        "key": "ctafti"
      }
    ]
  4. Run the build

    npm ci
    npm run build

Dev-Only Setup

npm run start

Note: Probably best to avoid running in "dev mode" since it doesn't closely resemble production mode... however, it is a LOT faster.

CRApp

This project was bootstrapped with Create React App.

License

MIT © Dash Core Group, Inc.

trust-vote-site's People

Contributors

coolaj86 avatar nmarley avatar

Watchers

 avatar

Forkers

dbbrowne

trust-vote-site's Issues

Trust Protector Software Specification

Update vote.dashtrust.org:

  • describe the candidate application process and link to the blog post
  • include a link to the candidate form
  • update to not accept votes (or display candidates?) yet.
  • possibly give timeline on site itself (even though it's on the blog post and application form)
  • add note about Dash Incubator being the independent 3rd party facilitator and auditor (including that Dash Incubator controls the vote software - something like:

    This voting tool is hosted by the Dash Incubator and can be accessed directly at 123.45.67.89, the Trust Protector provided URL vote.dashtrust.org is provided for convenience and the Trust Protectors are not hosting or running this election.

  • link to voting summary videos (below), possibly embed video instead
  • link to profile page for each candidates who provide one
  • link to source code (the README of this trust-vote-site repo)
  • Display warning if vote is from an address not currently in the ENABLED masternode list.
  • Review and merge #6

Tests to know software is complete and working

  • Prospective candidate can submit Google form to become a candidate
  • Candidate can edit form to update their info (including revoking their application)
  • Auditor (AJ / Rion) can see candidates on Google form spreadsheet
  • Masternode voter can cast vote for candidates (test using testnet masternode)
  • Masternode voter can cast additional votes for candidates to update their vote
  • Vote site rejects invalid votes and submits valid votes
  • Vote collector rejects invalid votes and accepts valid votes and stores them in database
  • Auditor can see raw votes in database
  • Auditor can use vote tally tool to check/validate/count final vote
  • Community member (no special privileges) can use vote tally tool as above
  • voting keys that represent multiple nodes are counted for all nodes, not just one

Summary Videos

  • Make (and link voting site to) video(s) showing how to do the following:
    • Apply to be a Trust Protector candidate
    • Vote for candidates (as a masternode voter)
    • Tally votes (as an auditor)

Notes for editing and supplementing the draft summary videos:

  • Explain that Dash Core wallet's debug console is the same as the dash-cli tool - that it accepts the same commands, just without the dash-cli part. Show them how to get to the console in their wallet.
  • Add a clip showing MNOs visually how to get their voting address from the masternode tab of the Dash Core wallet, as an alternative to using masternode list json ENABLED in the debug console.
  • Add a clip showing MNOs how to sign a message using the sign message menu in the Dash Core GUI.
  • Mention that MNOs can ask their operator to do this for them if their nodes are hosted by someone.
  • Maybe remove the part about signing with a private key (file) in case some MNOs try to do that with their collateral private keys where something could go wrong, or at least give proper warnings.

Finalize voting

  • Create video of final vote tallying
    • ***** out names to protect the innocent (keep votes private until April 17 0:00 UTC)
    • Review and merge Duncan's PR #7
    • Tighten up contstraints
    • Prepare logic for votes page
    • Explain the discarded votes (each type with some examples)
    • Explain steps taken to get mnlist here: https://github.com/dashhive/vote-tally/blob/master/results/README.md
    • Make results go live at April 17th 0:00 UTC on vote.dashtrust.org
    • Remove the part about "(from x voters)" from the results output
    • Include TP profiles on the results page

Resources

tidying up

  • deploy on testnet
  • test on testnet
  • merge PR
  • Demo how to vote

Trust Protector Election Administration

Tasks for Rion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.