Decentralized (Peer-owned Orderer) Setup with No System Channel

Introduction

Overview

Fabric Network Setup

Demonstration

Step 1: Prepare a Fabric host and obtain the setup

cd fabric-samples/
git clone https://github.com/kctam/peerowned-nosyschannel.git
cd peerowned-nosyschannel

Step 2: Create crypto material for the whole network

docker-compose downmkdir -p /tmp/hyperledger/
rm -rf /tmp/hyperledger/*
docker-compose up -d rca-org1 rca-org2 ca-tls
sudo chown -R vagrant:vagrant /tmp/hyperledger/*
./allCAnReg.sh./enrollAllOrgs.sh

Step 3: Bring up all components

docker-compose up -d
no system channel is running in orderer in our setup

Step 4: Create application channel and join all components to the channel

source term-org1
source term-org2
Terminal for org1 orderer1-org1 is used
Terminal for org2 orderer1-org2 is used
configtxgen -profile SampleAppChannelEtcdRaft -configPath ${PWD} -outputBlock mychannel.block -channelID mychannel
# to show channel status
osnadmin channel list -o localhost:7080 --ca-file $ORDERER_CA --client-cert /tmp/hyperledger/org1/admin/tls-msp/signcerts/cert.pem --client-key /tmp/hyperledger/org1/admin/tls-msp/keystore/key.pem
# join channel
osnadmin channel join --channelID mychannel --config-block mychannel.block -o localhost:7080 --ca-file $ORDERER_CA --client-cert /tmp/hyperledger/org1/admin/tls-msp/signcerts/cert.pem --client-key /tmp/hyperledger/org1/admin/tls-msp/keystore/key.pem
No system channel and application channels are in orderer1-org1
Join orderer1-org1 to application channel
orderer1-org1 joins mychannel
# to show channel status
osnadmin channel list -o localhost:8080 --ca-file $ORDERER_CA --client-cert /tmp/hyperledger/org2/admin/tls-msp/signcerts/cert.pem --client-key /tmp/hyperledger/org2/admin/tls-msp/keystore/key.pem
# join channel
osnadmin channel join --channelID mychannel --config-block mychannel.block -o localhost:8080 --ca-file $ORDERER_CA --client-cert /tmp/hyperledger/org2/admin/tls-msp/signcerts/cert.pem --client-key /tmp/hyperledger/org2/admin/tls-msp/keystore/key.pem
orderer1-org2 joins mychannel
peer channel join -b mychannel.block
Join peer1-org1 to mychannel
Join peer1-org2 to mychannel
Joining components to mychannel

Step 5: Test the network with chaincode sacc

Summary

Visit http://www.ledgertech.biz/kcarticles.html for all my works. Reach me on https://www.linkedin.com/in/ktam1/ or follow me @kctheservant in Twitter.

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