Git Product home page Git Product logo

ethereum-webpack-example-dapp's Introduction

ethereum plus webpack

Ethereum Webpack Example Dapp

Example Ethereum (Solidity) smart contract decentralized app with Webpack, demonstrating the following features and behaviors:

  • Simple Ethereum decentralized app (dapp) with:
    • Smart contract written in Solidity
    • A simple viewer written in Vanilla JavaScript.
  • Minimal reinvention. Using only tools that are already familiar for front-end JavaScript developers.
  • Smart contract is based on The Coin from a tutorial on ethereum.org.
  • Direct importing of Solidity code and instantiation of smart contract via Webpack through solc-loader and web3-loader.
    • Interfacing with smart contracts is as simple as import { MyToken } from './contract/MyToken.sol'.
    • See index.js for more details.
  • Be a simple starter kit for creating Ethereum decentralized apps.

How to run

  1. Run a local Ethereum node with JSON-RPC listening at port 8545 (default). testrpc would be the most straight-forward method.
# Using testrpc (recommended)
testrpc

# If you are running Geth, 
# make sure to run in testnet or private net and enable rpc
geth --testnet --rpc
  1. Install dependencies
npm install
  1. Run, during development
npm start

Once webpack build is done, open index.html in your favorite web browser.

Webpack is now started in --watch mode, any changes done at JavaScript or Solidity files would automatically rebuild the affected modules.

  1. Build, for deployment
npm run build

Only the static directory is required to be hosted and served.

  1. Run tests
npm test
  1. Start testrpc and tests concurrently
npm run test-testrpc

Additional notes

  1. web3-loader can be further configured, for example to reuse a deployed contract instead of redeploying at every build. See web3-loader's README for more details.

  2. Similarly for solc-loader.

Comments, bugs & collaborations

Pull requests, bug reports are welcomed.

This example dapp is put together by U-Zyn Chua. Say hi to me at Twitter (@uzyn) or Freenode IRC (my handle: uzyn, usually at #ethereum).

Tips: 0xFfA57D3e88A24311565C9929F180739E43FBD0aA

ethereum-webpack-example-dapp's People

Contributors

graup avatar robsyme avatar uzyn avatar

Watchers

 avatar  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.