如何解决Fabric SDK SDK应用无法在SaveChannel上连接到订购者
我正在尝试将应用程序部署到我的超级账本结构网络的结构SDK中,但是使用SaveChannel函数时出现以下错误:“无法初始化结构SDK:无法保存频道:创建频道失败: SendEnvelope失败:调用订购者'localhost:7050'失败:订购者客户端状态代码:(2)CONNECTION_FAILED。说明:拨号连接超时[localhost:7050]“
当我用docker日志检查订购者容器时,我得到以下信息:“ grpc:Server.Serve无法从“ ipnumber:port”完成安全握手:远程错误:tls:错误的证书”(我没有放帖子上的原始IP和端口)。我曾尝试在容器中禁用TLS,但无法正常工作,并发送错误“传输:http2Server.HandleStreams收到来自客户端的虚假问候”
sdk的config.yaml(仅有关订购者的信息):
orderers:
orderer.app.com:
url: grpc://localhost:7050
# these are standard properties defined by the gRPC library
# they will be passed in as-is to gRPC client constructor
grpcOptions:
ssl-target-name-override: orderer.app.com
# These parameters should be set in coordination with the keepalive policy on the server,# as incompatible settings can result in closing of connection.
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled
keep-alive-time: 0s
keep-alive-timeout: 20s
keep-alive-permit: false
fail-fast: false
# allow-insecure will be taken into consideration if address has no protocol defined,if true then grpc or else grpcs
allow-insecure: false
tlsCACerts:
# Certificate location absolute path
path: ${GOPATH}/src/github.com/pfc/healthapp/crypto-config/ordererOrganizations/orderer.app.com/tlsca/tlsca.orderer.app.com-cert.pem
...
entityMatchers:
orderer:
- pattern: (\w*)orderer.app.com(\w*)
urlSubstitutionExp: grpc://localhost:7050
sslTargetOverrideUrlSubstitutionExp: orderer.app.com
mappedHost: orderer.app.com
我尝试了其他帖子中的一些技巧,例如将url更改为localhost:7050,grpcs:// localhost:7050,但没有任何效果
解决方法
我发现可以使一切正常的“解决方案”是在docker容器上禁用TLS,并在config.yaml上将allow-insecure设置为true。 也许问题与证书有关,我没有时间解决这个问题
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。