FlightSurety is a sample application project to demonstrate the feasibility of decentralizing the transfer of risk among peers on Ethereum.
Smart Contract Separation
- Contracts have been separated into FlightSuretyData.sol and FlightSuretyApp.sol
Dapp Created and Used for Contract Calls
Oracle Server Application
Operational Status Control Implemented
- Run truffle.cmd test to view "Separation of Concerns and Operational Control" test criteria passes
Fail Fast Contract
- "Require()" calls have been implemented in the beginning of each function body within each contract
Airline Contract Initialization
- First airline is registered with contract deployment
Multiparty Consensus
- Criteria: Airlines (Fund and Register Airlines)
- Run truffle.cmd test to view "Multi-party consensus: Allow the registration of the 5th and beyond airline through a voting process" test criteria passes
Airline Ante
- Run trufffle.cmd test to view "Only registered AND funded airlines should be able to register a flight" test criteria passes
Passenger Airline Choice
Passenger Payment
- Run trufffle.cmd test to view "Criteria: Airlines (Register Flights) and Passengers (Buy Insurance)" test criteria passes
Passenger Repayment && Passenger Withdraw && Insurance Payouts
- Run truffle.cmd test to view "Criteria: Oracle (Oracle Functions, Oracle Initialization, Updates) && Passengers (Passenger Repayment, Withdraw, and Insurance Payouts)" test criteria passes
Functioning Oracle
- Run trufffle.cmd test to view oracle.js tests pass
Oracles Initialization
Oracle Updates
Oracle Functionality
- Run trufffle.cmd test to view "Criteria: Oracle (Oracle Functions, Oracle Initialization, Updates) && Passengers (Passenger Repayment, Withdraw, and Insurance Payouts)" tests pass
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.cmd compile
In the Command Prompt terminal run:
ganache-cli -m "spirit supply whale amount human item harsh scare congress discover talent hamster" -e 500 -a 40 -l 10000000
Then in a new Command Prompt terminal run:
truffle.cmd test
In the Command Prompt terminal run:
ganache-cli -m "spirit supply whale amount human item harsh scare congress discover talent hamster" -e 500 -a 40 -l 10000000
Then in a new Command Prompt terminal run:
truffle.cmd migrate --network development
npm run dapp
To view dapp:
http://localhost:8000
npm run server
To build dapp for prod:
npm run dapp:prod
Deploy the contents of the ./dapp folder