관리자 계정 잠금 해제 Unlock Admin Account | |
---|---|
유권자 등록 Register Voters | |
제안서 등록 Register Proposals | |
투표 Vote | |
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
- copy
json
file toSimpleVotingWeb
project - move to root folder of
SimpleVotingWeb
project (/SimpleVotingWeb
) - install npm dependencies
- execute web project
% cp SimpleVoting/build/contracts/SimpleVoting.json SimpleVotingWeb/contracts/SimpleVoting.json
% cd SimpleVotingWeb
% npm install
% node webserver.js
📦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