Skip to content

Latest commit

 

History

History
157 lines (142 loc) · 3.13 KB

README.md

File metadata and controls

157 lines (142 loc) · 3.13 KB

🗳️ Simple Voting DApp 🗳️

관리자 계정 잠금 해제 Unlock Admin Account
유권자 등록 Register Voters
제안서 등록 Register Proposals
투표 Vote

Installation

terminal

  • run geth console
% geth --datadir "data" \
--http  \
--http.addr "0.0.0.0" \
--http.port "8545" \
--http.api "web3,eth,personal,net" \
--http.corsdomain "*" \
--allow-insecure-unlock \
--nodiscover console
  • execute migration
% cd SimpleVoting
% truffle migrate

geth

  • connect to blockchain
> miner.start()
> miner.stop()

terminal

  1. copy json file to SimpleVotingWeb project
  2. move to root folder of SimpleVotingWeb project (/SimpleVotingWeb)
  3. install npm dependencies
  4. execute web project
% cp SimpleVoting/build/contracts/SimpleVoting.json SimpleVotingWeb/contracts/SimpleVoting.json
% cd SimpleVotingWeb
% npm install
% node webserver.js

Structure

📦SimpleVoting
 ┣ 📂contracts
 ┃ ┗ 📜SimpleVoting.sol
 ┣ 📂migrations
 ┃ ┗ 📜1_deploy_contracts.js
 ┗ 📜truffle-config.js
📦SimpleVotingWeb
 ┣ 📂assets
 ┃ ┣ 📜admin.html
 ┃ ┗ 📜voter.html
 ┣ 📂contracts
 ┃ ┗ 📜SimpleVoting.json
 ┣ 📂src
 ┃ ┣ 📜registerProposal.js
 ┃ ┣ 📜registerVoter.js
 ┃ ┣ 📜tallyVotes.js
 ┃ ┣ 📜util.js
 ┃ ┗ 📜vote.js
 ┣ 📜index.js
 ┣ 📜package-lock.json
 ┗ 📜package.json