This box it our most bare official implementation with Webpack. Includes contracts, migrations, tests, user interface and webpack build pipeline.
- Install Truffle and Ganache globally.
npm install -g truffle
npm install -g ganache-cli
ganache-cli
- Download and Install Application.
git clone https://github.com/thorpe/truffle_webpack_box.git
cd truffle_webpack_box
npm install
- Compile and migrate the smart contracts. Note inside the development console we don't preface commands with
truffle
.
truffle compile
truffle migrate
- Run the webpack server for front-end hot reloading (outside the development console). Smart contract changes must be manually recompiled and migrated. you have to accept this port in firwall rules
// Serves the front-end on http://YOURIPADDRESS:8080
npm run dev
- Truffle can run tests written in Solidity or JavaScript against your smart contracts. Note the command varies slightly if you're in or outside of the development console.
truffle test