An electronic voting system with distributed trust
- Install Docker and Docker Compose https://docs.docker.com/compose/install/
- Clone the repository
- cd into the directory
cd voteright/
- run
docker-compose up
- Install golang 1.12 https://blog.golang.org/go1.12
- clone the repo into your gopath
- go get .
- go run main.go
- Install Docker and Docker Compose https://docs.docker.com/compose/install/
- Clone the repository
- cd into the directory
cd voteright/
- Configure verification server locations, and port in voteright.json
- Configure the election in dump.json
- run
docker build . -t voteright
- prepare the dump.json file to be used for the creation of verification servers
- docker run --net="host" -d voteright
- Note port flags and other docker flags can be used if necessary
- Install Docker and Docker Compose https://docs.docker.com/compose/install/
- Clone the repository
- cd into the directory
cd voteright/
- Configure set the verification field to true in voteright.json
- copy the provided dump.json into the directory
- run
docker build . -t voteright verification -f Dockerfile.verification
- docker run --net="host" -d voteright
- Note port flags and other docker flags can be used if necessary
Primary Vote server - Serves voting booth, ballot Voting Booth - Frontend where user casts their vote Verification Cluster - Cluster to verify votes
How to run an election
- Primary Vote server is online, and given a list of addresses for a verification cluster, if no cluster exists, election may be run without
- Voting booth opened on All Polling stations to be used in the election, more cannot be added later
- Vote server begins attempting to establish a connection with each server in the verification cluster
- Upon establishing a connection, the Primary voting server sends the addresses of the other servers in the cluster to each server it connects to
- Verification servers connect to eachother, election may be secured once two or more verification servers are established
- Upon securing the election, the addresses of the verification servers are sent to the frontend
Election now may be conducted. Verification servers must regularly request verification on votes throughout the duration of the election, if any problem occurs, it is displayed on the voting booth.
If a verification server has an error, or a dissagreement, that server's votes are ignored and it is invalidated, this is displayed to the voter
In the event that less than two verification servers remain online, the election is invalidated.
Primary voting server
GET /
- Serves main voting booth page
GET /voters
- Get all voters in the election (admin only)
POST /voters/validate
- Check is a voter is valid and has not voted. Post body should contain voter id. Returns the json blob representing the voter if valid, null if not
Request
{"ID": 1}
Response
{
"StudentID": 1,
"Cohort": 1,
"Name": "Joey Lyon"
}
POST /voters/verifyself
- Uses the id stored in the session cookie to verify the voter
Response
{"Voted": true}
POST /voters/vote
- Uses the id stored in the session cookie, and json body to cast the user's vote. Body should be a json array containing the ids of the candidates to vote for. Response contains random ids
Request
[{"ID":2},{"ID":3}]
Response
{
"RandomID": 557700679194777,
"Candidates": [
{
"Name": "Stan Marsh",
"Cohort": 1,
"ID": 2
},
{
"Name": "Randy Marsh",
"Cohort": 1,
"ID": 3
}
]
}
GET /candidates
- Get all candidates in the election
[
{
"Name": "Eric Cartman",
"Cohort": 1,
"ID": 1
},
{
"Name": "Stan Marsh",
"Cohort": 1,
"ID": 2
},
{
"Name": "Randy Marsh",
"Cohort": 1,
"ID": 3
},
{
"Name": "Kenny",
"Cohort": 1,
"ID": 4
}
]
GET /candidates/votes
- Get all candidates and vote totals (admin only)
[
{
"Candidate": {
"Name": "Eric Cartman",
"Cohort": 1,
"ID": 1
},
"Votes": 3
},
{
"Candidate": {
"Name": "Stan Marsh",
"Cohort": 1,
"ID": 2
},
"Votes": 1
},
{
"Candidate": {
"Name": "Randy Marsh",
"Cohort": 1,
"ID": 3
},
"Votes": 1
},
{
"Candidate": {
"Name": "Kenny",
"Cohort": 1,
"ID": 4
},
"Votes": 3
}
]