FlightSurety is a sample application project for Udacity's Blockchain course.
Project rubric can be found here.
This repository contains Smart Contract code in Solidity (using Truffle), tests (also using Truffle), dApp scaffolding (using HTML, CSS and JS) and server app scaffolding.
To install, download or clone the repo, then:
npm install
truffle compile
Start ganache. If you're running ganache-cli and using the mnemonic in class, it would look something like:
ganache-cli -a 50 -l 99999999 -m "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"
If you are running the Ganache GUI, just do quick start and change number of accounts to 50.
Truffle config already points to port 8545 in case of ganache cli, change it to 7545.
To migrate:
truffle migrate
if you are migratng again:
truffle migrate --reset
OR
make migrate
To run truffle tests:
truffle test ./test/flightSurety.js
truffle test ./test/oracles.js
make test
To use the dapp:
truffle migrate
npm run dapp
if You are facing issue with the run, change to latest version of webpack. Also change ports in the generated config as per ganache cli or GUI.
To view dapp:
http://localhost:8000
npm run server
truffle test ./test/oracles.js
To build dapp for prod:
npm run dapp:prod
Deploy the contents of the ./dapp folder