fabirc版本是2.5.0, test-network网络是在虚拟机里面部署的。
测试代码是复制的官方代码,本地调试的时候报错。
我的报错内容
Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: a6bf3843f42f555a56e4048f2cb784ae165b7b5cb3fbc3d1a453e2b51aa0bf85 to Peer{ id: 3, name: peer0.org1.example.com, channelName: mychannel, url: grpcs://192.168.159.133:7051, mspid: Org1MSP} failed because of: gRPC failure=Status{code=UNAVAILABLE, description=io exception
Channel Pipeline: [HttpProxyHandler$HttpClientCodecWrapper#0, HttpProxyHandler#0, ProtocolNegotiators$ProxyProtocolNegotiationHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0], cause=io.grpc.netty.shaded.io.netty.handler.proxy.HttpProxyHandler$HttpProxyConnectException: http, none, /118.24.84.60:3128 => 192.168.159.133:7051, status: 403 Forbidden
at io.grpc.netty.shaded.io.netty.handler.proxy.HttpProxyHandler.handleResponse(HttpProxyHandler.java:200)
at io.grpc.netty.shaded.io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java:257)
网上找了很多解决方案都不行。但是可以肯定的是网络问题。
最后还是没解决,就把服务改成web应用,打包发到虚拟机里面,curl命令调用,是能够正常返回结果的。