git clone https://github.com/eduardopezzi/LandRegistry-Hyperledger-GBC.git
Make sure you have docker installed on your machine.
Please run the hyperledger scripts by going to fabric-samples/fabcar/
sh startFabric.sh javascript
This will bootstrap the 2 org 2 node setup and install the javascript chaincode on the nodes.
git clone https://github.com/mathaip/GBHyperledger-FabCar.git
cd GBHyperledger-FabCar
Copy the connection profile generated by the step 1 above. The connection profile is located in
/fabric-samples/first-network/connection-org1.json
Copy this profile inside config
folder
node enrollAdmin.js
node registerUser.js
These commands will generate admin certificates and a user certificate for a user called user1
and save them into the wallet folder.
npm install
node start
This will start the express server at http://localhost:3000
. If you are in GCP, it will start the server at http://<your GCP external IP>:3000
. Please note that you have to enable the firewall rules to allow port 3000 to be exposed in your GCP Compute Engine.
To test the installation, initiate a GET
request to http://localhost:3000/query
Our chaincode you will find at /fabric-samples/chaincode/realstate/javascript/
.
docker exec -it cli bash
peer chaincode install -l node -n realstate -v 1.0 -p /opt/gopath/src/github.com/chaincode/realstate/javascript/
peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n realstate -v 1.0 -c '{"Args":["initLedger"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n realstate -c '{"Args":["queryAllHouses"]}'
peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n realstate -c '{"Args":["queryHouse","HOUSE0"]}'
peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n realstate -c '{"Args":["changeHouseOwner","HOUSE9","Wilmar"]}'
peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n realstate -c '{"Args":["createHouse", "HOUSE10","55 Mill St, Toronto, ON M5A 3C4","(416) 364-1177","appartment","Wilmar"]}'
A) Navigate to ./FrontEndHyperledger
B) Run npm install
C) Run npm start. The NodeJs app and React app must be running in parallel
D) Go to http://localhost:3000/dashboard