Before setting up this project, ensure you have the following pre-requisites installed:
For detailed installation instructions of HyperLedger -Fabric, refer to the Hyperledger Fabric documentation.
This repository contains the following folder:
Blockchain_frontend
- Contains frontend part of the applicationborderpay
- it contains chaincodes and API-server inrest-api-go
folderCS731_Project_Report
- It contains Project Report
To install and run the frontend, follow these steps:
-
Clone the repository:
git clone https://github.com/havibohra/BorderPay.Io.git
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the frontend server:
npm start
5.Access the application in your browser at http://localhost:3000
.
Follow these steps to set up and run the project:
- Copy the
borderpay
folder from the repo inside the folderfabric-samples
of Hyperledger-Fabric
#To avoid any permissions problem:
sudo bash
# navigate to test-network folder in fabric-samples
# Start with creating channel named mychannel and setting Peer state database to deploy: couchdb with ca
./network.sh up createChannel -c mychannel -ca -s couchdb
# deploying chaincodes to peers
./network.sh deployCC -ccn basictest -ccp ../borderpay/chaincode-go -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg '../borderpay/chaincode-go/collections_config.json' -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
./network.sh deployCC -ccn paytest -ccp ../borderpay/chaincode2-go -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg '../borderpay/chaincode2-go/collections2_config.json' -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
# required environment variables setup
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
# Environment variables for Org1, login as peer0.org1
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
export CORE_PEER_ADDRESS=localhost:7051
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n paytest --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'
#Start a new terminal
# navigate to rest-api-go folder(run this command if you're in test-network currently)
cd ../borderpay/rest-api-go
# start api-server (It will start api-sever on port:3002)
go run main.go