Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Land Registry on Hyperledger Fabric

Table of Contents

About

Land Registry using Hyperledger Fabric

Getting Started

Prerequisites

Hyperledger-Fabric Golang Node.js Docker

Creating a Test-Network, Channel and Installing the chaincode

A step by step series of instructions that tell you how to run this in a development env.

Step 1: Clone the repo to a folder in your machine Step 2: Follow the below steps to ensure the required Chaincode dependencies are available

cd chaincode/
go mod init landregistry-application-chaincode 
go get -u github.com/hyperledger/fabric-contract-api-go
go mod tidy
go mod vendor

Step 3: Build the Chaincode - i.e. compile the Chaincode(Smart Contract) and ensure a successful compilation

go build

Step 4: Deploy the chaincode;

  1. Change into test-network directory
cd landregistry/test-network
  1. Bring the Network Down
./network.sh down
  1. Bring the network Up
./network.sh up
  1. Create channel using createChannel
./network.sh createChannel
  1. Check docker containers
docker ps -a
  1. Deploy Chaincode
./network.sh deployCC -ccn landreg -ccl go -ccp ../chaincode -cci InitLedger
  1. Prepare to use command line arguments
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
  1. Set the Endorsing peers information
source ./scripts/setPeerConnectionParam.sh 1 2
  1. Set the context for Org1
source ./scripts/setOrgPeerContext.sh 1

Interacting with Chaincode

Query the Property Details - using QueryProp function - one example below;

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 landreg $PEER_CONN_PARAMS -c '{"function":"QueryProp","Args":["PROP1"]}'

Output will look like below;


2021-11-22 14:07:46.156 IST [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200 payload:"{\"proptype\":\"Ind House\",\"propcity\":\"Bengaluru\",\"propstate\":\"KA\",\"propsqft\":\"3200\",\"propowner\":\"Abraham\"}" 

About

A Land Registry and Management Hyperledger Fabric Chaincode

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages