FlightSurety is a sample application project for Udacity's Blockchain course.
##Version Info
Truffle v4.1.14 (core: 4.1.14) Solidity v0.4.24 (solc-js) Ganache CLI v6.2.5 (ganache-core: 2.3.3)
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
###Tests
Start Ganache CLI in the terminal using
ganache-cli -p 8545 -m "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" -a 45 -l 80000000000
To run truffle tests:
In a second terminal window run the following commands
truffle test ./test/flightSurety_1.js
truffle test ./test/flightSurety_2.js
truffle test ./test/oracles.js
To use the dapp:
truffle migrate
npm run dapp
To view dapp:
http://localhost:8000
npm run server
truffle test ./test/oracles.js
In terminal run
truffle compile
truffle migrate --reset
In second terminal run
npm run dapp
In third terminal run
npm run server2
-- For Windows
OR
npm run server
-- For Mac/Linux
In your browser open
http://localhost:8000
The Operating status of the App is displayed on top
-
The first airline is registered and funded by default in the App. You can fund the rest of the airlines in the 'Airline Section'.
-
In the passenger section you can
- Purchase flight Insurance by selecting the flight from the dropdown.
- Check flight status and claim Insurance.
- Check Insurance credit issued by the App.
- Check the account balance.
- Withdraw the Insurance credits.
To build dapp for prod:
npm run dapp:prod
Deploy the contents of the ./dapp folder