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
.
truffle compile
to compile the contractstruffle migrate
to deploy the contracts onto your network of choice (default "development").truffle build
to build the app and serve it on http://localhost:3000To 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