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.
Our work is based on node.js v18.18.0
and Ubuntu 20.04
.
-
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.
-
Because the project is based on hello-rchain, you need to clone our project and config the rchain following the guidance of hello-rchain.
-
change directory to our project root directory, and install node packages.
cd ~/Shopping-Cart-RChain-dApp npm install
-
change directory to the bin directory, and install node packages.
cd bin npm install
-
Make sure you have configed the RChain and Cloudinary environment in
Prerequisites Deployment
. -
change directory to our project root directory.
cd ~/Shopping-Cart-RChain-dApp
-
Delete everything in
rnode0
directory, copy everything from folderrnode0 (override)
to folderrnode0
.Whenever you want to reset the blockchain, just override
rnode0
withrnode0 (override)
. -
Start rchain server
npm run rnode
-
In another terminal, cd to the
bin
directory of our project.cd ~/Shopping-Cart-RChain-dApp/bin
-
Start node.js clinent.
npm run start
-
Open your browse and open
localhost:3000
to use our dapp.
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