尝试连接到业务网络时出错

Error trying to connect to business network

我已经创建了一个同行管理卡。成功安装业务网络。尝试使用 :

开始业务网络
composer network start --networkName  procurement-phase --networkVersion 0.0.87 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card

执行结果:

Starting business network procurement-phase at version 0.0.87

Processing these Network Admins: userName: admin

✖ Starting a business network definition. This may take a minute... Error: Error trying to start a business network. Error: Failed to receive commit notification from 192.168.1.164:9051 for transaction '02339b7d2f056310c6659430e51e6dd2c99f6ecfbc094b7696ab14fc726716b5' within the timeout period Command failed

如果我再次执行相同的命令并且出现另一个错误,例如:

Starting business network definition. This may take a minute... Error: Error trying to start business network. Error: Peer localhost:7051 has rejected transaction '9704b94187a74aaa6d190441326edff60d675ef377607f91f69d333d6c70749a' with code ENDORSEMENT_POLICY_FAILURE Command failed.

我检查了 docker 个容器日志 运行。在订购者 docker 容器中出现错误。

我已经通过进行以下更改解决了上述问题: 添加orderer的tls(server.key-私钥文件,ca.crt文件,server.crt文件)在 docker-compose.yaml 文件中 orderer 部分的 enviroment 变量中。

  - ORDERER_GENERAL_TLSENABLED=true
  - ORDERER_GENERAL_TLS_PRIVATEKEY=./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
  - ORDERER_GENERAL_TLS_CERTIFICATE=./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
  - ORDERER_GENERAL_TLS_ROOTCAS=./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt

docker-[=35= 的 peers 部分的 volumes 中添加以下部分] file.Specify tls文件夹的路径

 ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/peer/tls