Giter Club home page Giter Club logo

ballot's Introduction

ballot

基于以太坊区块链开发的投票应用

Usage

truffle安装

此Demo是采用truffle开发框架进行开发的,使用之前必须先安装truffle。

npm install -g truffle

Ethereum客户端安装

推荐先在私有区块链网络上进行测试,测试通过之后再部署到正式网络上。可以使用Ganachetruffle develop工具快速搭建以太坊测试网络,对于习惯使用图形界面的用户,推荐使用Ganache。如果对命令行操作比较熟悉的话,也可以使用ganache-cli或truffle develop。

流程

首先打开Ethereum客户端,以truffle develop作为客户端进行说明,truffle develop默认使用的rest API地址为http://127.0.0.1:9545,打开truffle.js,配置好网络。

编译

truffle compile

迁移

truffle migrate

使用浏览器进行访问,要注意的是,访问以太坊Dapp必须使用专用的浏览器。Firefox、Chrome以及Opera等浏览器可以使用metamask插件进行访问。

ballot's People

Contributors

wangsir0624 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ballot's Issues

请教一下关于环境的问题

1.代码中sol用的是^0.4.17,但是语法却不符合该版本的语法规范,需要0.4.22以后的solc才可以。
2.我看到作者commit记录,最开始$.ajaxJSON用的是..build/contracts路径,后面改成了contrats/路径,似乎还是应该用..build/contracts?要么人工去copy到src目录下
3.代码中何处调用了钱包?发起投票会报如下错误:

Error: invalid address
    at v (web3.min.js:2:4288)
    at l (web3.min.js:2:2260)
    at web3.min.js:2:14456
    at Array.map (<anonymous>)
    at i.formatInput (web3.min.js:2:14429)
    at i.toPayload (web3.min.js:2:14658)
    at r.e [as sendTransaction] (web3.min.js:2:14964)
    at c.sendTransaction (web3.min.js:2:6896)
    at c.execute (web3.min.js:2:7725)
    at truffle-contract.js:190:16

猜测原因是没有调用钱包签名直接发起的交易?(迷惑)难道不需要签名吗??

最后一个疑问,这个项目star有几十个,也有很多fork,大家都没有遇到相关问题吗?(可能是我太菜

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.