To try out the DVP, follow these steps:
-
Clone the Repository and Checkout a New Branch
mkdir DVP cd ./DVP git clone https://github.com/mvoyevoda/DecentralizedVotingPlatform.git git checkout -b <your-name>
-
Open 3 Separate Terminal Tabs
-
Terminal Commands
-
Tab 1: Start the Blockchain Node
cd ./Decentralized-Voting-Platform/Blockchain npm install npx hardhat node
-
Tab 2: Deploy Contracts and Add a Poll
npx hardhat ignition deploy ./ignition/modules/DVP.js --network localhost npx hardhat run scripts/addSamplePolls.js --network localhost # Create some sample polls
-
Tab 3: Start the Client
cd ./Decentralized-Voting-Platform/Client npm install npm run dev
-
-
Connect a test account to MetaMask
- Go to Tab 1 and copy a private key from one of the 20 default test accounts listed in the terminal output
- Open up a new tab in Chrome
- Login to MetaMask (Avoid secret phrase, use only password for simplicity)
- Import a new wallet using the copied private key
-
Open the DVP in Browser
- Open http://localhost:5173/ in Chrome.
- You should be prompted by MetaMask to connect your wallet to this site. Confirm the connection
-
Configure MetaMask for Localhost
- Go to MetaMask settings and add the localhost network:
- Network Name: localhost
- New RPC URL: http://127.0.0.1:8545
- Chain ID: 31337
- Go to MetaMask settings and add the localhost network:
-
You're all set! (Make sure to clear MetaMask data if restarting the network)