A decentralized voting system based on Ethereum blockchain technology (designed for corporate use).
Below is a brief explanation of the basic workflow of the dVoting 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 and adding candidates for voters to vote. Then voters with their blockchain account connect to the same blockchain network register to become a voter. When a user registers to be a voter the registration details are displayed in the admins' panel (i.e. verification page) and the admin will check if the registration information (blockchain account address, name and phone number/nic number) is valid and matches with his record. If the registration is valid then the admin approves the registered user and the registered user becomes eligible to take part in the created election. The registered user (voter) then from the voting page casts his/her voter the candidate of his/her interest. After some time, depending on the scale of the election the admin ends the election. As soon as the election ends the voting is closed and the results are displayed avouching 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 https://github.com/itsnue/u-vote_project.git cd u-vote_project
-
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 [CLI] :
https://localhost:8545
New RPC URL [GUI] :https://localhost:7545
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 redeployments -
Launch the development server (fronted)
cd client npm install npm start
# That is all.