Skip to content

imaguru-spain/ethereum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Election Dapp

1. Smoke Test

truffle unbox pet-shop
touch contracts/Election.sol
touch migrations/2_deploy_contracts.js
truffle migrate
truffle console
Election.deployed().then(function(instance) { app = instance })
> app.address
> app.candidate()

2. List Candidates

truffle migrate --reset
app.candidatesCount()
app.candidates(1)
app.candidates(2)

Testing

touch test/election.js
truffle test

Client-Side Application

  • Replace src/index.html
  • Replace src/js/app.js
truffle migrate --reset
npm run dev

In Metamask use "connect to RPC" and use http://localhost:7545 as address

3. Cast Votes

  • Change Election.sol
truffle migrate --reset
truffle test

Client-side voting

  • Change src/index.html
npm run dev
  • Click on vote

4. Watch Events

  • Change Election.sol
truffle migrate --reset
truffle test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published