Welcome to the Gymkhana Elections DApp, a decentralized application (dApp) that operates on a peer-to-peer (P2P) network of computers connected through the Ethereum blockchain. Unlike traditional applications controlled by a single authority, dApps like ours embrace transparency and autonomy. This enables our campus junta to engage in the election process without fear of censorship or manipulation.
This user manual gives you a gist of the Gymkhana Elections DApp, including its functionalities, how to use the application, and the technologies used.
Please note that the user needs to have MetaMask installed and have testnet Ether (ETH) available to perform actions within the DApp.
This application facilitates the registration of voters and candidates. Voters can cast their vote, and the leader can access the result.Leader is the creator of the election.The voter gives three preferences (which are the indices (natural numbers) corresponding to the intended candidates).The scores corresponding to the three preferences are 5, 3, and 1.That candidate whose total score is the highest is declared as the winner of the election.
- Install dependencies
npm install
- Run the hardhat node. This will create 20 accounts with 10000 ETH each.
npx hardhat node
- Connect the node with Metamask
Go to Metamask > Click on networks tab > Click on add network > Add network manually > Fill in the following details
Network Name: localhost
RPC URL: http://localhost:8545
Chain ID: 31337
Currency Symbol: ETH
- Add some accounts to Metamask (Use the private keys from the hardhat node).
Go to Metamask > Click on account icon > Import account > Paste the private key > Click on Import
- Deploy the contract
npx hardhat run scripts/deploy.js --network localhost
- Load the frontend using the VSCode Live Server extension.
Right-click on index.html > Open with Live Server
- Interact with the frontend.
The Gymkhana Elections DApp offers an elegant and user-friendly interface that allows individuals to take part in the election process with utmost security and transparency. By seamlessly connecting their MetaMask wallets, users can register as voters, exercise their right to cast votes, and access the winning Candidate of the election. The DApp harnesses the power of the Ethereum blockchain and smart contracts to ensure a secure, honest, and accurate election process.
With the aid of the accompanying manual, users can confidently engage in electoral affairs and play a pivotal role in choosing their leaders in the election.