簡體   English   中英

在Hyperledger Fabric中傳播私有數據的問題

[英]Issue with dissemenation of private data in hyperledger fabric

我的網絡結構非常簡單,有兩個對等組織和一個訂購者。

  • orderer.org0
  • peer0.org1
  • peer1.org1
  • peer0.org2

私有數據收集的定義如下:

---
- StaticCollectionConfig:
    name: topSecret
    SignaturePolicyEnvelope:
      identities:
        - org1member:
            role:
              name: member
              mspId: Org1MSP
      policy:
        1-of:
          - signed-by: org1member
  requiredPeerCount: 1
  maximumPeerCount: 1
  blockToLive: 0
  memberOnlyRead: true

因此,它應該僅允許org1成員允許使用私有數據。

在現實中,如果我在ORG1它拋出以下在同行日志錯誤回報的同齡人運行一些PrivateData相關的操作:

[gossip.privdata] func1 -> ERRO 84e Failed disseminating private RWSet for TxID <TxId> , namespace mychcode collection topSecret : Requested to send to at least 1 peers, but know only of 0 suitable peers to distributed private collection

為什么會這樣呢? 據我了解,requiredPeerCount:1應該成立,因為我在org0中有兩個同級。

PS內部八卦已配置,可以在日志中看到以下消息

2019-07-08 16:17:03.725 UTC [gossip.discovery] sendMemResponse -> DEBU 2853 Entering endpoint:"peer0.org1.example.com:7051" pki_id:"\2057\365\305\215\007*\025\277[\313\270t\020\"\355\301\247\214 \r\267\350T\260\375+G\333a\202\246" 
2019-07-08 16:17:03.725 UTC [gossip.comm] Send -> DEBU 2854 Entering, sending GossipMessage: Channel: , nonce: 0, tag: EMPTY MembershipResponse with Alive: 2, Dead: 0, Envelope: 509 bytes, Signature: 0 bytes to  1 peers
2019-07-08 16:17:03.725 UTC [gossip.comm] sendToEndpoint -> DEBU 2855 Entering, Sending to peer0.org1.example.com:7051 , msg: GossipMessage: Channel: , nonce: 0, tag: EMPTY MembershipResponse with Alive: 2, Dead: 0, Envelope: 509 bytes, Signature: 0 bytes
2019-07-08 16:17:03.725 UTC [gossip.discovery] sendMemResponse -> DEBU 2856 Exiting, replying with alive:<payload:"\030\001*O\n?\n\033peer0.org1.example.com:7051\032 \2057\365\305\215\007*\025\277[\313\270t\020\"\355\301\247\214 \r\267\350T\260\375+G\333a\202\246\022\014\010\333\256\243\376\211\323\336\327\025\020l" signature:"0E\002!\000\261sVO\351\007\346\302A-1\360\002j\233\013;\204e\245\320W\014\263\337y\303\273+\220\217\t\002 m\210\351\332\262\032\323\215\343\372t\24450\004\034\036\023IiaJ?9 O-m\365l\343\325" secret_envelope:<payload:"\n\033peer0.org1.example.com:7051" signature:"0E\002!\000\344\261\203.A\221\272\345\314\240\223~\342\001\206\343\206\021^\311\033\005Q\233%\370\014#\250\rf\230\002 *m\307Jh\312q\371\014\302w\000>\232g\227\233\003\372\205\357\363&L?\262yH\366\240\225I" > > alive:<payload:"\030\001*2\n\"\032 2\320\014\223K\373\265\215E\375f\261\324\021\356\244\330o\370u>l\322[\033\005\240\363R\236\334F\022\014\010\331\340\224\370\204\323\336\327\025\020j" signature:"0D\002 E@\032!\313#\331\211\\|\334)R/n\221\347%\226\265\214\032\353}\323\302D\271\355\245\366\021\002 rL\327\346\244\022\235\360-\376\350\235\003\262K#\"C\t{\324\370\231\"P\365\376\341\014wM*" secret_envelope:<payload:"\n\033peer1.org1.example.com:7051" signature:"0E\002!\000\3777\226V\000\212>\235\232\334 \022\231\371\010\370\256\037\231\340\001\225\305r7\324\317\356K1\200\321\002 \001\215\321!\263L\342s\233\014#\334q\264\332,\261xOm\317\2555\352\330\252\326R\307`\363?" > > 

在“ 私有數據收集”定義中 ,關鍵策略只能圍繞“或”條件進行包裝,也許這就是導致錯誤和錯誤的原因。

這是一個很好解釋的鏈接

該問題與本地八卦配置不當有關。 這又是導致我在configtx.yaml中錯誤的策略配置的原因

我使用了以下角色:'Org1MSP.client''Org1MSP.peer'

但是看起來它們僅在配置NodeOU時才起作用(請參閱https://hyperledger-fabric.readthedocs.io/en/release-1.4/msp.html#identity-classification )。 在將它們替換為“ Org1MSP.member”之后,它開始工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM