Project is based on Truffle suite and its Drizzle box.
-
Install Truffle and Ganache CLI globally. If you prefer, the graphical version of Ganache works as well!
npm install -g truffle npm install -g ganache-cli
-
Run the development blockchain, we recommend passing in a blocktime. Otherwise, its difficult to track things like loading indicators because Ganache will mine instantly.
// 3 second blocktime. ganache-cli -b 3
-
Compile and migrate the smart contracts. Note inside the development console we don't preface commands with
truffle
.compile migrate
-
Run the webpack server for front-end hot reloading (outside the development console). Smart contract changes must be manually recompiled and migrated.
Verify that your metamask is connected to correct local testnet port running in ganache-cli
javascript // Serves the front-end on http://localhost:3000 npm run start
-
Run the storybook server.
// Serves the storybook on http://localhost:9001 npm run storybook
-
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.
// If inside the development console. test // If outside the development console.. truffle test
-
Jest is included for testing React components. Compile your contracts before running Jest, or you may receive some file not found errors.
// Run Jest outside of the development console for front-end component tests. npm run test
-
To build the application for production, use the build command. A production build will be in the build_webpack folder.
npm run build