Giter VIP home page Giter VIP logo

blockchain-development-angular-truffle-box's Introduction

Truffle Box for Angular

This Truffle Box provides a base for working with the Truffle Framework and Angular. It provides a basic working example of the MetaCoin contracts with Angular components. This project is generated with Angular CLI.

Prerequisites

In order to run the Truffle box, you will need Node.js (tested with version 8.9.x). This will include npm, needed to install dependencies. In order install these dependencies, you will also need Python (version 2.7.x) and git. You will also need the MetaMask plugin for Chrome.

Building

  1. Install truffle, Angular CLI and an Ethereum client. If you don't have a test environment, we recommend ganache-cli
npm install -g truffle
npm install -g @angular/cli
npm install -g ganache-cli
  1. Download the box.
truffle unbox Quintor/angular-truffle-box
  1. Run your Ethereum client. For Ganache CLI:
ganache-cli

Note the mnemonic 12-word phrase printed on startup, you will need it later.

  1. Compile and migrate your contracts.
truffle compile && truffle migrate

Configuration

  1. In order to connect with the Ethereum network, you will need to configure MetaMask
  2. Log into the ganache-cli test accounts in MetaMask, using the 12-word phrase printed earlier.
    1. A detailed explaination of how to do this can be found here
      1. Normally, the available test accounts will change whenever you restart ganache-cli.
      2. In order to receive the same test accounts every time you start ganache-cli, start it with a seed like this: ganache-cli --seed 0 or ganache-cli -m "put your mnemonic phrase here needs twelve words to work with MetaMask"
  3. Point MetaMask to ganache-cli by connecting to the network localhost:8545

Running

  1. Run the app using Angular CLI:
npm start

The app is now served on localhost:4200

  1. Making sure you have configured MetaMask, visit http://localhost:4200 in your browser.

  2. Send MetaCoins!

Testing

  1. Running the Angular component tests:
ng test
  1. Running the Truffle tests:
truffle test
  1. Running Protactor end-to-end tests
ng e2e

Releasing

Using the Angular CLI you can build a distributable of your app. Will be placed in dist/

ng build

FAQ

  • Where can I find more documentation?

This Truffle box is a union of Truffle and an Angular setup created with Angular CLI. For solidity compilation and Ethereum related issues, try the Truffle documentation. For Angular CLI and typescript issues, refer to the Angular CLI documentation

blockchain-development-angular-truffle-box's People

Contributors

angular-cli avatar onlyonejmjq avatar pimotte avatar pjullrich avatar sarbogast 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.