I learned form this site that each member on a channel can have multiple anchor peers to prevent SPOF.
I would like to try multiple anchor peer in fabcar-demo.
Kindly let me know how to configure multiple anchor peers.
In order to have more than one anchor peer per organization you need to configure it with configtx.yaml
, e.g. you should add new anchor peers into the following section:
Organizations:
- &Org1
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org1MSP
# ID to load the MSP definition as
ID: Org1MSP
MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: peer0.org1.example.com
Port: 7051
- Host: peer1.org1.example.com
Port: 7051
- &Org2
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org2MSP
# ID to load the MSP definition as
ID: Org2MSP
MSPDir: crypto-config/peerOrganizations/org2.example.com/msp
AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: peer0.org2.example.com
Port: 7051
- Host: peer1.org2.example.com
Port: 7051
This will define two anchor peers per each organization. Next you need to use configtxgen
to produce config update transaction to include those anchors peers for both orgs:
configtxgen -profile TwoOrgsChannel -channelID mychannel -outputAnchorPeersUpdate=Org1MSPanchors.tx -asOrg=Org1MSP
configtxgen -profile TwoOrgsChannel -channelID mychannel -outputAnchorPeersUpdate=Org2MSPanchors.tx -asOrg=Org2MSP
To update channel run:
# updating anchors for Org1
CORE_PEER_ADDRESS=peer0.org.example.com peer channel update -f Org1MSPanchors.tx -c mychannel -o orderer.example.com:7050
against endorsing peer of each org respectively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With