基于区块链的毕业设计FlightSurety – 飞行担保
本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计FlightSurety – 飞行担保 是一篇很好的国外资料
FlightSurety
FlightSurety is a sample application project for Udacity’s Blockchain course.
Versions
- Truffle v5.1.61
- Solidity – 0.6.12
- Node v15.5.1
- Web3.js v1.2.9
- Ganache v1.2.3
Install
This repository contains Smart Contract code in Solidity (using Truffle), tests (also using Truffle), dApp scaffolding (using React, Chakra-U ) and server app scaffolding.
To install, download or clone the repo, then:
npm install
npm --prefix ./src/dapp install ./src/dapp
truffle compile
Develop Client
To run truffle tests:
./start-ganache.sh
- In another Terminal :
truffle test ./test/flightSurety.js
truffle test ./test/oracles.js
truffle test ./test/oracleLate.js
truffle test ./test/oraclesOnTime.js
To use the server and dapp :
./start-ganache.sh
truffle migrate --reset
( another Terminal)npm run server
./start-dapp.sh
The server is used for 3 purposes :
- Register oracles
- Reigstering a list of Airlines in the FlightSurety contract (in the startup)
- Serve an API, to retrieve flights list and to manage the flight status returned by the oracles ( for simulation purpose)
To view dapp:
http://localhost:8000
Dapp Snappshots
Info Tab
-
All the registered Airlines, retrieved by calling the FlightSuretyApp (smart contract )
-
The flights list is retrieved from the backend server
-
The passenger accounts ( from the truffle config)
Management Tab
- It is used to disable or enable the FlightSuretyApp smart contract
-
And to set the flight status that will be retrieved by the registered oracles
-
After disabling the contract, the airlines list could not be fetched anymore
Insurance Tab
- From this tab the user can buy the insurance , open request to check the flight status and pay out the insurance
- Case :The flight is late
-
Case : The flight is on time
-
Withdraw the insurance : pay out the passenger
Resources
- How does Ethereum work anyway?
- BIP39 Mnemonic Generator
- Truffle Framework
- Ganache Local Blockchain
- Remix Solidity IDE
- Solidity Language Reference
- Ethereum Blockchain Explorer
- Web3Js Reference
安装
FlightSurety是Udacity区块链blockchain课程的一个示例应用项目。
开发客户端
- Truffle v5.1.61
- Solidity-0.6.12
- 节点v15.5.1
- Ganache v1.2.3
- npm安装
Dapp快照
此存储库包含可靠的智能合约代码(使用Truffle)、测试(也使用Truffle)、dApp支架(使用React、Chakra-U)和服务器应用程序支架。
安装、下载或克隆repo,然后:
- npm–前缀./src/dapp安装。/src/dapp
- /start-加纳什.sh
truffle compile
信息选项卡
运行truffle测试:
- 在另一个终端:块菌测试。/test/飞行保证.js松露试验/神谕.js松露试验/oracleLate.js松露试验/oraclesOnTime.js松露试验/飞行保证.js松露试验/神谕.js松露测试/测试/oracleLate.js松露试验/oraclesOnTime.js
- /开始-加纳什.sh
使用服务器和dapp:
- 在飞行担保合同中重新提供航空公司名单(在初创期)
- 提供一个API,用于检索航班列表和管理oracles返回的航班状态(用于模拟目的)
- 通过调用FlightSuretyApp(智能合约)检索的所有注册航空公司
- 航班列表从后端服务器
服务器用于3个目的:
- 乘客帐户(从truffle)检索config)
- 它用于禁用或启用FlightSuretyApp智能合约,并设置在禁用合约后由注册的oracle检索的航班状态,无法再获取航空公司列表
- 用户可以从该选项卡购买保险,打开请求检查航班状态并支付保险金案例:航班晚点案例:航班准时退保以太坊eth如何工作?BIP39助记符生成器
查看dapp:
http://localhost:8000所有注册航空公司,通过调用FlightSuretyApp(智能合约)检索航班列表从后端服务器检索乘客帐户(从truffle配置)并设置注册oracle检索的航班状态禁用合同后,将无法再获取航空公司列表,例如:航班准点,取消保险,为乘客支付保险
安装
开发客户端
Dapp快照
信息选项卡
管理选项卡
保险选项卡
资源
All the registered Airlines, retrieved by calling the FlightSuretyApp (smart contract ) The flights list is retrieved from the backend server The passenger accounts ( from the truffle config) And to set the flight status that will be retrieved by the registered oracles After disabling the contract, the airlines list could not be fetched anymore Case : The flight is on time Withdraw the insurance : pay out the passenger 管理选项卡
保险选项卡
资源
Insurance Tab
Resources
部分转自网络,侵权联系删除区块链源码网
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计FlightSurety – 飞行担保