Giter Site home page Giter Site logo

truffle3-frontend-example's Introduction

truffle3-frontend-example

In order to build and run the frontend code LOCALLY, run

  1. yarn install or npm install depending on your preference
  2. make sure you have testrpc running , and change truffle.js to point to that network. e.g. localhost:8545.
  3. truffle compile to create the json contract artifacts
  4. truffle migrate to deploy the contracts onto the network
  5. change the web3 provider in app/main.js to point to the testrpc server.
  6. npm run build to compile the javascript and html assets into the build folder
  7. truffle serve to serve the assets in the build folder
  8. navigate to the host and port that truffle is serving (default, localhost:8080) in order to see the served assets

In order to build and run the frontend code IN DOCKER, run

  1. docker-compose -f docker/docker-compose.yml up -d
  2. once the container starts, find the hash of the truffle3_container service and run docker attach <hash>
  3. yarn install or npm install depending on your preference
  4. change truffle.js to point to that network. this is testrpc:8545 from inside the container
  5. truffle compile to create the json contract artifacts
  6. truffle migrate to deploy the contracts onto the network
  7. change the web3 provider in app/main.js to point to the testrpc server. !! this will be localhost:7000 !!
  8. npm run build to compile the javascript and html assets into the build folder
  9. truffle serve to serve the assets in the build folder
  10. navigate to localhost:7001/index.html in your browser to see the served assets

Possible upgrades

  • Use the webpack hotloader to sense when contracts or javascript have been recompiled and rebuild the application

truffle3-frontend-example's People

Contributors

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