Skip to content

Latest commit

 

History

History
100 lines (71 loc) · 2.71 KB

README.md

File metadata and controls

100 lines (71 loc) · 2.71 KB

asal-reviews

Our Online Review Creation/Management solution using Blockchain named "AsalReviews"

We have three folders for three different layers

Network

This folder contains all Hyperledger Fabric related cryptographic material, channel artifacts, genesis block,chaincode and docker-compose YAML files.

asal-reviews-api

This folder is a Web server based on Node.js and Express.js framework. It facilitates following things -

  • Acts like a Web server that wraps all the Fabric interaction logic as REST API (GET, POST endpoints).
  • Acts as client for Fabric network by using Fabric-Client NODE SDK
  • Bridge between an user interface layer and fabric network layer.

asal-reviews-ui

This folder is Customer's interface developed using Angular 6. This consumes REST API to contact with Web server.

Demo video

Watch the video

Prerequisites:

  • Node.js version 8.9.0+ (but not higher than 9.0)
  • Docker and Docker Compose (latest)
  • Golang (latest) with $GOPATH set
  • Chaincode installed to $GOPATH/src/github.com/chaincode

HyperLedger Fabric Composition

Members and Components

Network consortium consists of:

Orderer organization - Used RAFT ordering mechanism with one orderer node

Two Organization each consisting of two peer nodes each.
Peer organization 1 - Asalreviews.com
Peer organization 2 - Seller.com

World State Database - CouchDB
External Database - MongoDB

Bringing up the network.

Make sure you are in the Network directory.

cd network/fabric-network
./network.sh up createChannel -c review -ca -s couchdb

./network.sh deployCC -ccn review -ccp ../chaincode/ -ccl go -c review -ccv 1.0 -ccs 1

couchDB is running on port 7984 and 8984

Node-Express-SDK

Starting the node app + SDK

Make sure you are in the WebServer directory

cd ../asal-reviews-api

Install the node modules

Note: I am using node version 8.17.0 with npm version 6.13.4

You cannot use a node version above 9.0!!!

npm install

Starting the node app server

nodemon app.js

The server will started on port 9084 (localhost:5000)

This uses a module called 'nodemon' to restart the server whenever a change is made

Front-end

Start the Angular app Make sure you are in the FrontEnd directory

cd ../asal-reviews-ui

Install the node modules

npm install
ng serve

The server will started on port 4200 (localhost:4200)

Login as "customer" or as "guest" (no login needed)