使用 fabric-client-sdk,无法对多个对等点进行 grpc 调用

Using fabric-client-sdk, unable to make grpc call to multiple peers

通过使用 fabric-sdk-java client I am trying to invoke chaincode installed and instantiated in peers on my Hyperledger fabric V1.0 networkWindows 7 中使用 docker 图像 进行本地设置。我能够调用和查询链代码到对等方 peer0.org1.example.com,但是当我尝试对对等方 peer0.org2.example.com 出现以下错误

2017-09-13 13:22:45,382 main ERROR Channel:2241 - Sending proposal to peer0.org2.example.com failed because of: gRPC failure=Status{code=UNAVAILABLE, description=Channel closed while performing protocol negotiation, cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
    at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2241)
    at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2155)
    at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:2089)
    at com.ibs.blockchain.client.utility.BlockChainUtility.sendProposal(BlockChainUtility.java:232)
    at com.ibs.blockchain.client.utility.BlockChainUtility.createFlight(BlockChainUtility.java:80)
    at com.ibs.blockchain.client.test.BCAPITest.main(BCAPITest.java:9)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Channel closed while performing protocol negotiation
    at io.grpc.Status.asRuntimeException(Status.java:526)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:427)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419)
    at io.grpc.internal.ClientCallImpl.access0(ClientCallImpl.java:60)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access0(ClientCallImpl.java:422)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImplStreamClosed.runInContext(ClientCallImpl.java:525)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

查看 docker-compose.yaml 端口映射就像

peer0.org1.example.com  
    ports:
      - 7051:7051
      - 7053:7053

peer0.org2.example.com    
        ports:
      - 8051:7051
      - 8053:7053

它仅适用于端口与 tcp 端口相同的对等方 (7051) 但在具有不同端口 8051[= 的对等方出现上述错误26=]。为什么?

请澄清问题。在8051:7051表示法中,8051是"outside"可达端口,7051是docker镜像内的匹配端口。此外,"UNAVAILABLE: Channel" 错误似乎表明您在同行加入某处的结构通道名称中存在拼写错误,请仔细检查?