HomeBlockchainBlockchain DIYDecentralized Setup with No System Channel

Decentralized Setup with No System Channel

Introduction

Overview

Fabric Network Setup

Decentralized Setup with No System Channel 2

Demonstration

Step 1: Prepare a Fabric host and obtain the setup

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

Step 2: Create crypto material for the whole network

docker-compose downmkdir -p /tmp/hyperledger/
rm -rf /tmp/hyperledger/*

Decentralized Setup with No System Channel 3

docker-compose up -d rca-org1 rca-org2 ca-tls
Decentralized Setup with No System Channel 4
Decentralized Setup with No System Channel 5
sudo chown -R vagrant:vagrant /tmp/hyperledger/*
Decentralized Setup with No System Channel 6
./allCAnReg.sh./enrollAllOrgs.sh
Decentralized Setup with No System Channel 7
Decentralized Setup with No System Channel 8

Step 3: Bring up all components

docker-compose up -d
Decentralized Setup with No System Channel 9
Decentralized Setup with No System Channel 10
https://miro.medium.com/max/4800/0*RvtMJK9skEFUeNGf
Decentralized Setup with No System Channel 11

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

source term-org1
source term-org2
Decentralized Setup with No System Channel 12
Terminal for org1 orderer1-org1 is used
Decentralized Setup with No System Channel 13
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
Decentralized Setup with No System Channel 14
No system channel and application channels are in orderer1-org1
Decentralized Setup with No System Channel 15
Join orderer1-org1 to application channel

Now check again.

Decentralized Setup with No System Channel 16
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
Decentralized Setup with No System Channel 17
orderer1-org2 joins mychannel
peer channel join -b mychannel.block
Decentralized Setup with No System Channel 18
Join peer1-org1 to mychannel
Decentralized Setup with No System Channel 19
Join peer1-org2 to mychannel
Decentralized Setup with No System Channel 20
Joining components to mychannel

Step 5: Test the network with chaincode sacc

Decentralized Setup with No System Channel 21

Decentralized Setup with No System Channel 22

Decentralized Setup with No System Channel 23

Decentralized Setup with No System Channel 24

Summary

This article has been published from the source link without modifications to the text. Only the headline has been changed.

Source link

Most Popular