For English Introduction, please see the last part: English Introduction
- Ubuntu 18.04
- FISCO BCOS v2.1.0
- Python 3.6.3+
- FISCO BCOS Python SDK
- Flask 1.1
- MacOS
- Xcode
- 链端:Loan.sol 合约中实现完整供应链金融平台逻辑
- 后端:python-sdk/Loan_contract_invoke.py实现对Loan合约调用的封装;python-sdk/Loan_contract_flask_backend.py运行服务端,接受外部请求并返回JSON数据
- 前端:Loan_UI中是一个完整的iOSApp工程
Ubuntu配置好依赖环境后,将 Loan.sol
部署到节点上,若成功部署,会得到 合约地址。你可以先在控制台中调用合约,产生一些实例以及发送交易。
用得到的合约地址替换 python-sdk/Loan_contract_flask_backend.py
,Line 9
中的地址,将语句改为:
loan_contract = Loan_Contract(address=your_new_address)
注意保留双引号
假设在你的Ubuntu中,FISCO BCOS Python SDK路径为 $FB-Python-SDK
。
将 Loan.sol
复制到你的 $FB-Python-SDK/contracts
中;
将 python-sdk/Loan_contract_invoke.py
和 python-sdk/Loan_contract_flask_backend.py
复制到你的 $FB-Python-SDK
中
此时运行 Loan_contract_flask_backend.py,服务端会在8383端口监听请求。
请求示例:
- 获取名称为A的公司的信息
GET: {IP}:8383/get_company_inf/?cpName=A
- 获取所有公司A参与交易的单据
GET: {IP}:8383/get_receipt/?cpName=A
- 获取银行bank_1向公司A提供的信用资产的数额
GET: {IP}:8383/get_AmountOfCreditAsset_bank_GiveTo_TrustedCompany/?bName=bank_1&cpName=A
在MacOS中打开 Loan_UI/Loan_UI.xcworkspace
,在Xcode点击运行按钮即可使用前端界面。
注意修改 Loan_UI/Loan_UI/SearchCompanyPage/SearchCompanyViewController.m
,Loan_UI/Loan_UI/SearchReceiptPage/SearchReceiptViewController.m
和 Loan_UI/Loan_UI/SearchCreditAssetPage
里的URL
背景介绍、方案设计和功能测试等详见 17343107_王明业.pdf
。
Demo见本目录下的.mp4视频。
Develop a comprehensive platform encompassing the front end, back end, and blockchain layer using the consortium blockchain platform FISCO-BCOS, maintained by Tencent.
We have three companies: A, B, and C.
- Company A: A large enterprise with excellent credit, substantial risk-bearing capacity, and the ability to secure significant financing from banks and other financial institutions.
- Company B: A smaller company unable to directly secure large financing from financial institutions.
- Company C: Another small company in a similar financial position as Company B.
- Initial Order: Company A places an order with Company B for a batch of goods.
- Supplementary Order: To fulfill this order, Company B needs to procure raw materials from Company C.
- Funding Shortfall: Company A currently lacks sufficient funds but issues a promissory note to Company B, guaranteeing payment for the goods.
- Bank Loan: Company B, leveraging Company A's strong credit, uses this promissory note to secure a loan from a bank.
- Cascading Credit: Similarly, Company B issues a promissory note to Company C, enabling Company C to obtain a loan from the bank.
This traditional process is cumbersome, involving extensive authorization and verification steps.
Our project leverages blockchain technology to streamline this credit transfer process. By implementing a blockchain-based supply chain financial platform, we aim to:
- Increase Efficiency: Automate and expedite the authorization and verification process.
- Enhance Transparency: Provide a tamper-proof ledger of all transactions, ensuring trust among all parties.
- Improve Accessibility: Enable smaller companies to access financing using the creditworthiness of larger companies.
By utilizing the FISCO-BCOS platform, we will create a secure, transparent, and efficient supply chain financing solution.