-
Install Ganache from https://www.trufflesuite.com/ganache and truffle using
npm i -g truffle
or usenpx truffle ...
-
Create a new Ethereum workspace with at least 50 accounts (configurable during creation)
-
Run
truffle migrate --reset
-
CD into server
-
Run
npm i
-
Run
npm run server
- this will register all oracles and prepare for flight status requests
-
Copy accs from output or ganache into config/testConfig and replace testAddresses
-
Setup Metamask
- Install metamask
- Create account if necessary
- Import first ganache account by clicking on the circle top-right in metamask -> Import and pasting the private key of the very first ganache acc
- Change network to Localhost 7545, if it doesn't exist, create it:
- Network name: Localhost 7545
- New RPC Url: http://localhost:7545
- Chaid ID: 1337
- Connect account (below fox on top-right)
-
Open new terminal
-
Run
truffle test
to confirm all tests pass -
CD into client
-
Run
npm i
-
Run
npm start
-
A new tab should be opened with website at localhost:3000
-
Purchase insurance for a flight
-
Request Flight insurance until the withdraw button becomes available (waiting for a specific status, which has a 1/5 chance of being picked)
-
Withdraw
Fin