A Multi Organization Application in Hyperledger Fabric



$ sudo apt install docker.io
$ sudo apt install docker-compose
$ sudo apt-get update
$ sudo apt-get install golang-go

Linux: https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz

Windows: https://dl.google.com/go/go1.13.5.windows-amd64.msi

MacOS: https://dl.google.com/go/go1.13.5.darwin-amd64.pkg

$ export GOPATH=$HOME/go
$ export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
$ source ~/.profile
$ go version
$ go version go1.11 linux/amd64 orderer.multi.org.ledger.com ca.org1.multi.org.ledger.com peer0.org1.multi.org.ledger.com peer1.org1.multi.org.ledger.com peer0.org2.multi.org.ledger.com peer1.org2.multi.org.ledger.com peer0.org3.multi.org.ledger.com peer1.org3.multi.org.ledger.com peer0.org4.multi.org.ledger.com peer1.org4.multi.org.ledger.com

Setup the Blockchain network

MultiOrgLedger is a four organization based Hyperledger application and each organization supports two peer nodes. There are few prerequisites to follow to set up and install a blockchain network in the docker container.

./bin/cryptogen generate --config=./crypto-config.yaml
./bin/configtxgen -profile FourOrgsOrdererGenesis -outputBlock ./artifacts/orderer.genesis.block
./bin/configtxgen -profile FourOrgsChannel -outputCreateChannelTx ./artifacts/multiorgledger.channel.tx -channelID multiorgledger
./bin/configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./artifacts/Org1MSPanchors.tx -channelID multiorgledger -asOrg Org1MSP
./bin/configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./artifacts/Org2MSPanchors.tx -channelID multiorgledger -asOrg Org2MSP
./bin/configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./artifacts/Org3MSPanchors.tx -channelID multiorgledger -asOrg Org3MSP
./bin/configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./artifacts/Org4MSPanchors.tx -channelID multiorgledger -asOrg Org4MSP
docker-compose up -d // the docker-compose.yaml has to be located at same command location

Deploy the network

policy “OR(‘Org1MSP.member’,’Org2MSP.member’,’Org3MSP.member’,’Org4MSP.member’)”

Run the application

Users list reading from Hyperledger per Orgnization



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store