初始化链码出现错误1
错误1: Error: error getting broadcast client: orderer client failed to connect to orderer.xxx.com:7050: failed to create new connection: context deadline exceeded
查看ororder发现错误2:docker logs ororder.xxx.com
错误2:2021-02-01 05:50:58.890 UTC [core.comm] ServerHandshake -> ERRO 594 TLS handshake failed with error tls: first record does not look like a TLS handshake server=Orderer remoteaddress=172.21.0.12:48822
2021-02-01 05:50:58.890 UTC [grpc] handleRawConn -> DEBU 595 grpc: Server.Serve failed to complete security handshake from "172.21.0.12:48822": tls: first record does not look like a TLS handshake
查看ca发现错误:docker logs ca.xxx.com
错误3:Error: Failed to find private key for certificate in '/etc/hyperledger/fabric-ca-server-config/ca.org2.xxx.com-cert.pem': Could not find matching private key for SKI: Failed getting key for SKI [[16 217 25 175 125 240 163 247 3 225 161 212 252 71 186 93 166 44 140 70 186 126 138 215 190 38 27 71 190 221 230 200]]: Key with SKI 10d919af7df0a3f703e1a1d4fc47ba5da62c8c46ba7e8ad7be261b47bedde6c8 not found in /etc/hyperledger/fabric-ca-server/msp/keystore
如果同时出现以上问题或其中一个,那么恭喜你,你配置的证书有问题,请仔细检查fabric使用的证书是否正确,
或者可以尝试使用github.com/hyperledger/fabric-samples/first-network里面的配置先启动一份进行尝试
参考:
https://www.edureka.co/community/29586/hyperledger-orderer-client-connect-orderer-failed-connection
https://learnblockchain.cn/question/124
https://lists.hyperledger.org/g/fabric/topic/31696729