Deploy dapp locally

Build, Deploy and Test

1. Using a terminal (or command prompt), change to the folder containing the project files and type:

npm start

This will run the "deploy" and "dapp" scripts which compile and deploy the Smart Contracts, then build and run the client-side dapp.

2. To view your dapp, open your browser to http://localhost:8000

Other Scripts

If you prefer to run scripts individually, the order is:

npm install npm run deploy npm run dapp npm run server (must be run in a separate terminal window)

Smart Contract

npm run deploy to compile contracts/*.sol files, deploy them to the blockchain.

Dapp

Run the dapp in a separate terminal. You must have run npm run deploy for the dapp to see most recent smart contract changes.

npm run dapp runs the dapp on http://localhost:8000 using webpack dev server

Server

Run the server in a separate terminal. You must have run npm run deploy for the dapp to see most recent smart contract changes.

npm run server runs NodeJs server app on port 3000 with Express

Testing

test-config.js contains settings used by test scripts

Run tests using npm test [test file] (example: npm test ./test/dapp-tests.js)

Production Builds

DappStarter currently does not provide blockchain migration scripts to be used in production. However, here are the scripts for generating production builds:

npm run dapp:prod generates dapp bundle for production using webpack

npm run server:prod generates NodeJs server bundle for production using webpack