FlightSurety is a flight insurance simulation on Ethereum blockchain. It is a decentralized application (dApp) that allows passengers to purchase flight insurance and get compensated in case of flight delay or cancellation.
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. Set Ganache to allow for 25+ accounts.
To install, download or clone the repo, then:
npm install
npm run compile
To run app tests:
npm run test
To use the dapp:
npm run migrate
npm run dapp
To view dapp:
http://localhost:3000
Always connect to MetaMask every time you change pages.
npm run server
To run oracle tests:
npm run test-oracles
To build dapp for prod:
npm run dapp:prod
- Truffle v5.8.0 (core: 5.8.0)
- Ganache v7.7.6
- Solidity - ^0.8.16 (solc-js)
- Node v18.14.2
- Web3.js v1.8.2
The Dapp consists of 3 sections
- Flight
- Insurance
- Airlines
- Register a flight
- Fetch flight status
- Purchase flight insurance
- Withdrawal insurance amount
- Register an airline