Giter VIP home page Giter VIP logo

truffle-ballot-dapp's Introduction

Truffle-Ballot-Dapp

Node Truffle Solidity

Language

简体中文 | Engish

Overview

The Truffle-Ballot-Dapp is a Ethereum-Based Ballot demo, including the features like giving ballot to the person you want based on smart-contart and making sure that any address(voters) only have one ballot. Further more, The program contains ABI(Application Binary Interface) to link Contract Layer to Application Layer. Fore more detail, you could clone this repositories.

Front-End page is as follow:

ouAgm9.png

Dependencies

  1. Npm

For more information , Get from https://nodejs.org/en/

  1. Metamask

A crypto wallet & gateway to blockchain apps, Get from https://metamask.io

  1. Yarn(optional)

Yarn is a package manager that doubles down as project manager, which can fix some bug from NPM.

Quick Start

You should install the Dependencies above before getting start.

  1. Install Truffle globally.
npm install -g truffle
  1. Run the development console.
truffle develop
  1. You can alternatively choose one step as follow.
  • Compile and migrate the smart contracts. Note inside the development console we don't preface commands with truffle.(Recommand)
compile
migrate
  • Using Ganache-CLI for build (Alternatively).

It's as easy as modifying the config file! Check out the documentation on adding network configurations. Depending on the port you're using, you'll also need to update line 29 of client/src/utils/getWeb3.js.

⚠️Note That if you do this, you can dump the step 3. and run bash as follow

truffle compile
truffle migrate
  1. Start React pages

In the client directory, we run the React app. Smart contract changes must be manually recompiled and migrated.

cd client

And then ,

npm install

or if you have Yarn

yarn
  1. Open the URL at Chrome or FireFox with metamask

You should login the Account with metamask and have a ballot. To pay the gas you should have some ETH. You can import the privacy key in metamask and get about 100 ETH in your test network.

Limitation

  • Adding new candidates
  • Anonymous Accounts to ballot
  • Privacy protect method

To-Do-List

  • Using random-response for ballot result
  • Take some privacy method such as differential privacy (DP) to protect the Accounts' ballot result.

Reference

https://github.com/truffle-box/react-box

https://goethereumbook.org/en/

https://zhuanlan.zhihu.com/p/38452188

truffle-ballot-dapp's People

Contributors

favorhau avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.