Example Truffle project integrated with Angular. Includes contracts, migrations, tests, user interface and Angular build pipeline.
Node v.6+ and npm v.3+
Truffle. See: http://truffleframework.com/
An ethereum client. See: http://truffleframework.com/docs/getting_started/client
To initialize a project with this example, clone the project and run npm install
.
- First run
truffle compile
to compile the contracts - Then run
truffle migrate
to deploy the contracts onto your network of choice (default "development"). - Finally run
truffle build
to build the app and serve it on http://localhost:3000
To compile new smart contracts and expose them to the app, store them in the 'contracts' directory and run truffle compile
and truffle migrate
again. The contract's ABIs will be generated, converted to .ts files and stored in 'src/app/web3/contracts' directory for you. Now you can conveniently import them into your services.
Project based on:
https://github.com/trufflesuite/truffle-init-webpack
https://github.com/angular/quickstart
Note that running truffle build (or npm start) using bash for windows will fail. Use windows command line instead