Giter Site home page Giter Site logo

stevenhankin / flightsurety Goto Github PK

View Code? Open in Web Editor NEW

This project forked from udacity/flightsurety

0.0 0.0 0.0 922 KB

Udacity Blockchain Nanodegree Course 6 "Flight Surety" Project

License: MIT License

JavaScript 95.30% CSS 1.60% HTML 3.10%

flightsurety's Introduction

FlightSurety

FlightSurety is a sample application project for Udacity's Blockchain course.

Requirements

These are the software versions I have tested the project with

  • Node v10.15.3
  • npm 6.4.1
  • yarn 1.15.2

Install

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:

git clone https://github.com/stevenhankin/FlightSurety.git
cd FlightSurety
npm install
truffle compile

Run Tests

This requires running two components in two shells The first is a local Ethereum node (using Ganache) whilst running the tests

In shell #1 start Ganache:

ganache-cli -a 50 -e 1000 -m "quote ensure arrive vote dinosaur illegal wood equal disagree teach tray planet" 

The flag -a 50 will create 50 funded test addresses on your local node

The specific -m mnemonic is needed since the address of first airline is passed for migration of Data Contract.

In shell #2 launch the Contract and Oracle tests:

rm -f ./src/dapp/src/build/contracts/*.json
truffle test ./test/flightSurety.js
truffle test ./test/oracles.js

Run Application

In shell #1 start Ganache (as was done for tests above):

ganache-cli -a 50 -e 1000 -m "quote ensure arrive vote dinosaur illegal wood equal disagree teach tray planet" 

The flag -a 50 will create 50 funded test addresses on your local node

The specific -m mnemonic is needed since the address of first airline is passed for migration of Data Contract.

In shell #2 compile/migrate the contracts AND launch the Oracles Service Removing an old build (if it exists) is sometimes necessary for migrations to work:

rm -f ./src/dapp/src/build/contracts/*.json
truffle migrate --reset
npm run server

In shell #3 start the Web App Server

cd src/dapp
yarn install
yarn start

Finally access the application in a browser

http://localhost:3001

(Port 3000 is reserved for the Server API)

Deploy

To build dapp for prod:

npm run dapp:prod

Deploy the contents of the ./dapp folder

Resources

flightsurety's People

Contributors

stevenhankin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.