A decentralized voting system based on Ethereum blockchain technology.
A brief explanation on the basic workflow of the application.
- Admin will create a voting instance by launching/deploying the system in a blockchain network (EVM), then create an election instance and start the election with the details of the election filled in (including candidates for voters to vote).
- Then the likely voters connect to the same blockchain network register to become a voter. Once the users successfully register, their respective details are sent/displayed in the admins' panel (i.e. verification page).
- The admin then will check if the registration information (blockchain account address, name, and phone number) is valid and matches with his record. If yes, then the admin approves the registered user making them eligible to take part and cast their respective vote in the election.
- The registered user (voter) following the approval from the admin casts their vote to the candidate of interest (from the voting page).
- After some time, depending on the scale of the election the admin ends the election. As that happens the voting is closed and the results are displayed announcing the winner at the top of the results page.
-
Download and install NodeJS
node.js
v14.15.4
Download NodeJS from here.
-
Install truffle and ganache-cli
truffle
v5.2.4
ganache-cliv6.12.2
npm install -g truffle npm install -g ganache-cli
-
Install metamask browser extension
Download and install metamask from here.
-
Clone this repository
git clone [email protected]:vijith07/electionDAP.git cd electionDAP
-
Run local Ethereum blockchain
ganache-cli
Note: Do not close
ganache-cli
(the blockchain network needs to be running all the time) -
Configure metamask on the browser with following details
New RPC URL:
http://localhost:8545
Chain ID:1337
-
Import accounts using private keys from ganache-cli to the metamask extension on the browser
-
Deploy smart contract to the (local) blockchain
# on the dVoting directory truffle migrate
Note: Use
truffle migrate --reset
for re-deployments -
Launch the development server (fronted)
cd client npm install npm start