FlightSurety is a sample application based on smart contracts running on the Ethereum blockchain.
Passengers can purchase flight insurance, airlines can register new airlines and flights. Oracles simulate insurance case after which passenger can get a payout.
This project was developed as part of Udacity's Blockchain Developer Nanodegree Program.
npm install
npm i -g truffle
npm i -g ganache
ganache -a 40 -m "cool alpha pact nasty salon duck teach web reject economy army donate"
truffle migrate --reset
To start the flight status simulation server:
cd server
npm install
npm run dev
You can check server status and simulating oralces number at localhost:3000.
To start the dApp run following commands in a separate terminal:
cd dapp
npm install
npm run dev
Open localhost:8080 in your browser.
Accounts registered as airline can register flights and new airlines. Registration of fifth and subsequent airlines requires multi-party consensus of 50% of registered airlines. So airline accounts can access the voting.
Passengers can purchase insurance, invoke the simulation of flight fault due airline company and then get a payout.
Flights and airlines are statically programmed. The list with allowed for registration flights and airlines is printed in the developer console.
To run truffle tests:
truffle test