Giter Club home page Giter Club logo

flightsurety's Introduction

FlightSurety

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

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, download or clone the repo, then:

npm install truffle compile

Develop Client

To run truffle tests:

truffle test ./test/flightSurety.js truffle test ./test/oracles.js

To use the dapp:

truffle migrate npm run dapp

To view dapp:

http://localhost:8000

Develop Server

npm run server truffle test ./test/oracles.js

Deploy

To build dapp for prod: npm run dapp:prod

Deploy the contents of the ./dapp folder

Resources

flightsurety's People

Contributors

sudkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flightsurety's Issues

Requirements

What all things should we have before starting the project. For eg: node js,web3 etc.
Can u list all the requirements?
And with the version name plz.
This would be a great help.

Problem when running test

after truffle test ./test/flightSurety.js

Error: while migrating Migrations: sender doesn't have enough funds to send tx. The upfront cost is: 134439500000000000 and the sender's account only has: 0

Error when 'npm install'

node version: v14.17.0
npm version: 7.13.0

Error message:

npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command /Users/xxxx/Programs/node-v14/bin/node /Users/xxxx/Programs/node-v14/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/xxxx/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command git --no-replace-objects clone --mirror -q ssh://[email protected]/gulpjs/gulp.git /Users/xxxx/.npm/_cacache/tmp/git-clone-abb37d14/.git
npm ERR! npm ERR! fatal: destination path '/Users/xxxx/.npm/_cacache/tmp/git-clone-abb37d14/.git' already exists and is not an empty directory.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/xxxx/.npm/_logs/2021-05-18T00_32_12_504Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxx/.npm/_logs/2021-05-18T00_32_18_974Z-debug.log

Error when running the npm run dapp

When executing the "npm run dapp" command I am getting the following error (the "npm install" runs

correctly):> webpack-dev-server --mode development --config webpack.config.dapp.js
ℹ 「wds」: Project is running at http://localhost:8000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/jamyo9/Desarrollo/Udacity/Project04/dapp
✖ 「wdm」: 835 modules
ERROR in ./src/dapp/dom.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/jamyo9/Desarrollo/Udacity/Project04/src/dapp/dom.js: Support for the experimental syntax 'classProperties' isn't currently enabled (5:14):
3 | export default class DOM {
4 |
5 | static a = (...args) => DOM.makeElement(a, ...args);
| ^
6 | static button = (...args) => DOM.makeElement(button, ...args);
7 | static div = (...args) => DOM.makeElement(div, ...args);
8 | static h1 = (...args) => DOM.makeElement(h1, ...args);
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
at Parser._raise (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:742:17)
at Parser.raiseWithData (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:735:17)
at Parser.expectPlugin (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:8762:18)
at Parser.parseClassProperty (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:12110:12)
at Parser.pushClassProperty (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:12070:30)
at Parser.parseClassMemberWithIsStatic (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:12003:14)
at Parser.parseClassMember (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:11940:10)
at /Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:11885:14
at Parser.withTopicForbiddingContext (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:10956:14)
at Parser.parseClassBody (/Users/jamyo9/Desarrollo/Udacity/Project04/node_modules/@babel/parser/lib/index.js:11862:10)
ℹ 「wdm」: Failed to compile.

Porblem starting the project

As of right now if you clone the project and try to start the dapp, you get an error.

Step to reproduce:
git clone [email protected]:udacity/FlightSurety.git
cd /to/folder
npm i
npm run dapp

The error is:

[email protected] dapp /var/www/FlightSurety
webpack-dev-server --mode development --config webpack.config.dapp.js

internal/modules/cjs/loader.js:550
throw err;
^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/var/www/FlightSurety/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:1)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)

Node version: v9.11.2
Npm version: 5.6.0

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.