2017-08-10 6 views
2

チャンネルの各メンバーがSPOFを防ぐために複数のアンカーピアを持つことができるフォームthis siteを学びました。複数のアンカーピアを設定する方法

私はfabcar-demoで複数のアンカーピアを試してみたいと思います。

複数のアンカーピアを設定する方法を教えてください。

答えて

2

組織ごとに複数のアンカーピアを設定するには、configtx.yamlで設定する必要があります。次のセクションに新しいアンカーピアを追加する必要があります。

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 

これは、組織ごとに2つのアンカーピアを定義します。それぞれ各組織のピアを支持に対して

# updating anchors for Org1 
CORE_PEER_ADDRESS=peer0.org.example.com peer channel update -f Org1MSPanchors.tx -c mychannel -o orderer.example.com:7050 

:チャネルの実行を更新するには

configtxgen -profile TwoOrgsChannel -channelID mychannel -outputAnchorPeersUpdate=Org1MSPanchors.tx -asOrg=Org1MSP 
configtxgen -profile TwoOrgsChannel -channelID mychannel -outputAnchorPeersUpdate=Org2MSPanchors.tx -asOrg=Org2MSP 

:次は、両方のORGSのものアンカーピアを含めるように設定更新トランザクションを生成するためにconfigtxgenを使用する必要があります。

関連する問題