Skip to content

北理工软件体系结构设计模式大作业,A ShoppingChart demo based on RChain in Ubuntu Linux.

Notifications You must be signed in to change notification settings

Alanxtl/Shopping-Cart-RChain-dApp

 
 

Repository files navigation

Shopping-Cart-RChain-dApp

A rchain shopping cart dapp demo.

See the demonstration here.

We developed login/register page and upload/buy item page based on blockchain.

Our work mainly focus on the usage of blockchain, instead of focusing on the desgination of the frontend.

We use hello-rchain api to interact with rchain blockchain, hello-rchain is the origin repository I forked from, which is based on rchain-toolkit api.

Prerequisites

Environment

Our work is based on node.js v18.18.0 and Ubuntu 20.04.

Deployment

  1. This project uses CLOUDINARY as the online image hosting platform, so you need to configure the CLOUDINARY environment before deploying the project.

    First you need to register a CLOUDINARY account here.

    In a terminal, set your CLOUDINARY_URL environment variable.

    Replace CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME with the API environment variable copied from your product environment credentials:

    export CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME

    You can find more details on CLOUDINARY.

  2. Because the project is based on hello-rchain, you need to clone our project and config the rchain following the guidance of hello-rchain.

  3. change directory to our project root directory, and install node packages.

    cd ~/Shopping-Cart-RChain-dApp
    npm install
  4. change directory to the bin directory, and install node packages.

    cd bin
    npm install

Usage

  1. Make sure you have configed the RChain and Cloudinary environment in Prerequisites Deployment.

  2. change directory to our project root directory.

    cd ~/Shopping-Cart-RChain-dApp
  3. Delete everything in rnode0 directory, copy everything from folder rnode0 (override) to folder rnode0.

    Whenever you want to reset the blockchain, just override rnode0 with rnode0 (override).

  4. Start rchain server

    npm run rnode
  5. In another terminal, cd to the bin directory of our project.

    cd ~/Shopping-Cart-RChain-dApp/bin
  6. Start node.js clinent.

    npm run start
  7. Open your browse and open localhost:3000 to use our dapp.

Credits

Login form: login-form

Cart form: nodejs-shopping-cart

Hello-RChain: Hello-RChain

RChain project: https://github.com/rchain/rchain

RChain key-pair generator: https://tgrospic.github.io/rnode-client-js/

RChain-toolkit (from my knowledge it's the only working RChain api for v0.13.0-alpha3, so great thanks): https://github.com/fabcotech/rchain-toolkit

About

北理工软件体系结构设计模式大作业,A ShoppingChart demo based on RChain in Ubuntu Linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 47.0%
  • Handlebars 20.4%
  • Shell 18.9%
  • Scala 9.1%
  • CSS 4.2%
  • HTML 0.4%