我正在尝试将我的应用程序部署到我的超级账本结构网络的 fabric sdk 中,但是在使用 SaveChannel 函数时出现以下错误:“无法初始化 Fabric SDK:无法保存通道:创建通道失败:SendEnvelope 失败:调用 orderer 'localhost:7050' 失败:Orderer 客户端状态代码:(2) CONNECTION_FAILED。描述:拨号连接超时 [localhost:7050]"
当我使用 docker 日志检查 orderer 容器时,我得到以下信息:“grpc:Server.Serve 无法完成来自“ipnumber:port”的安全握手:远程错误:tls:错误证书”(我没有放原始 ip和端口上的帖子)。我曾尝试在容器中禁用 TLS,但它不起作用,发送错误“传输:http2Server.HandleStreams 从客户端收到虚假问候”
sdk的config.yaml(只有orderer的信息):
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,但没有任何效果