项目作者: marlowl

项目描述 :
Simple Ethereum voting dApp example, using Vue CLI, Truffle and Web3
高级语言: Vue
项目地址: git://github.com/marlowl/vue-voting-dapp.git
创建时间: 2018-12-23T19:34:45Z
项目社区:https://github.com/marlowl/vue-voting-dapp

开源协议:MIT License

下载


Vue Voting dApp



This project was generated with vue-cli version 3.2.1

An Vue truffle voting mechanism dApp.

Sample contract is deployed on the Kovan testnetwork

Demo

Project setup

MetaMask and Infura account are both required for this project to work!

MetaMask

I would like to refer to this article for a simple tutorial on how to setup MetaMask and get some free test Ether on your Kovan account! After that you have your ETH address you need for the .env file

Infura

Infura is a hosted Ethereum node cluster that lets you run your application without requiring them to set up their own Ethereum node or wallet. Register an account here and require your API key you need for the .env file!

Get ganache-cli and truffle running on your environment

  1. npm install -g truffle ganache-cli

Start ganache-cli

  1. ganache-cli

After running this command you should be able to find your MNEMONIC you need for the .env file

Install dependencies

  1. git clone https://github.com/marlowl/vue-voting-dapp/
  1. npm install

Update the .env file

  1. VUE_APP_ETHADDRESS= "your ETH address"
  2. MNEMONIC= "your ganache MNEMONIC"
  3. INFURA_API_KEY= "your infura key"

Run the development server

  1. npm run serve

Compile your own smart contracts

Add your smart contract to the /contracts folder

Compile the contract

  1. truffle compile

Migrate your contract to the ropsten network

  1. truffle migrate --network ropsten

Change the current address to your deployed contract address

  1. let myContract = new web3.eth.Contract(
  2. MyContract.abi,
  3. "Your deployed contract address"
  4. );