Giter VIP home page Giter VIP logo

rlread's Introduction

区块链期末project。

软件题目

软件名称为外语安读,通过智能合约解决用户和提供商的之间的信任问题。用户购买提供商的书籍有以下规则:

  • 用户购买后外语书籍后,提供商将在80天内每天提供书中一部分给用户进行阅读(一般预测平均阅读时长为5-10分钟),每天阅读完即可打卡。每天连续打卡至成功读完整本书,提供商将会全额返回用户购买书籍的费用。
  • 一旦打卡中断,则会根据持续打卡的最长天数返还对应的费用,其余费用则由提供商获得。

选题背景、依据

当下越来越多的人希望能够学好一门外语,提高自己的外语沟通能力,但常常由于缺少动力和空闲时间较短而无法付诸实施或者坚持不下去。外语安读则针对这两个问题提出了解决方案,外语安读提供给用户需要的书籍,收取用户购买书籍的费用后,以返还费用提供给用户动力坚持进行学习。同时每天提供的阅读内容平均阅读的时间是10-20分钟,也解决了空闲时间较短的问题。更重要的是,外语安读通过智能合约解决了用户和提供商之间的信任问题。

智能合约的基本规则如下:

  • 提供商将书籍以智能合约的形式存储在区块链上,用户选择好书籍后只要进行付款,合约就会每天提供书籍的一定量的阅读内容给用户进行阅读,用户阅读完后在合约上打卡。
  • 用户所付费用并不会马上转给提供商,而是会在阅读期限到了之后,根据用户的打卡天数再将本次购买书籍的费用进行分配。只要天数一到,便会立即分配。从而避免了提供商早早拿到费用却之后耍赖不返还的诈骗行为的出现。

项目的创建使用了webpack,前端框架使用了Vue作为框架,另外使用了truffle进行合约的部署。

使用前需要在本地创建私链,设置私链的端口号和网络ID,更改truffle.jssrc/plugins/web3.js中的端口号与其一致,才能成功连接。

关闭chrome浏览器的安全模式,避免跨域问题:

"chrome.exe" --disable-web-security --user-data-dir=C:\DownloadSoftware\ChromeTempData

使用方式,在根目录下:

    # 下载依赖
    npm install
    
    # 连接私链部署合约
    truffle migrate
    
    # 启用服务测试端口 localhost:8080
    npm run dev

rlread's People

Contributors

ninanshoulewozaizhe 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.