Error connecting to orderer.example.com:7050 due to x509: certificate signed by unknown authority

  • 前言
  • 解决步骤
  • 引用

前言

问题发生在测试fabric的过程中,【https://www.cnblogs.com/studyzy/p/6973334.html】根据这篇博文进行学习测试的过程中出现的
主要是这一步:接下来是Instantiate,也就是初始化实例,设置a账户有100元,b账户有200元。
peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile   **/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem** -C mychannel -n devincc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"

问题如下:

2018-05-29 02:36:19.191 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-05-29 02:36:19.191 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
Error: Error getting broadcast client: Error connecting to orderer.example.com:7050 due to x509: certificate signed by unknown authority


解决步骤

最后虽然解决了 但是过程不堪回首 查了一堆博文 stackoverflow翻了一下 都没啥干货
然后自己觉着指定的ca证书可能有问题,就尝试着换个试试

不行?换个证书再来一次

root@241d433ba845:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com# peer chaincode instantiate -o orderer.example.com:7050 –tls $CORE_PEER_TLS_ENABLED –cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n devincc -v 1.0 -c ‘{“Args”:[“init”,”a”, “100”, “b”,”200”]}’ -P “OR (‘Org1MSP.member’,’Org2MSP.member’)”
这就可以了。。。。
尴尬的是markdown的编辑器传图片有问题 :(
不过成功的结果可以在上面那篇博文中可以看到!

引用

【1】https://www.cnblogs.com/studyzy/p/6973334.html

你可能感兴趣的:(区块链,ERRORS)