O'Reilly logo

Truffle Quick Start Guide by Nikhil Bhaskar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part 2

In another Terminal window/tab, run ganache-cli to start a local blockchain.

And then, in the original tab, run the following:

  1. truffle compile to compile your contracts.
  2. truffle migrate to deploy those contracts to the network.
  3. ng serve to start your application.
  4. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
  5. Make sure there are no errors in browser console.
You can also run npm run compile-start to run the first three steps automatically. Since you have ganache-cli running, make sure MetaMask is switched off as this could cause problems with web3 being set correctly.

On http://localhost:4200/, you should see the following screen:

If you look in app.html in the src/app ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required