java配置多个grpc client_使用fabric-client-sdk,无法对多个对等方进行grpc调用

在Windows 7上使用Hyperledger Fabric V1.0时,遇到使用fabric-sdk-java调用peer0.org2.example.com失败的问题,出现"UNAVAILABLE: Channel closed while performing protocol negotiation"错误。尽管可以成功连接到peer0.org1.example.com,但尝试连接到具有不同端口映射(8051)的peer0.org2.example.com时失败。错误可能与端口映射配置或gRPC通信问题有关。
摘要由CSDN通过智能技术生成

通过使用fabric-sdk-java客户端,我尝试使用 docker images 在 Windows 7 本地Hyperledger fabric V1.0 network设置中调用已安装和实例化的对等链代码 . 我能够调用和查询链代码到对等 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.access$100(ClientCallImpl.java:60)

at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493)

at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422)

at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.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 的对等端获得上述错误 . 为什么?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值