ENDORSEMENT_POLICY_FAILURE错误分类帐撰写器 [英] ENDORSEMENT_POLICY_FAILURE error hyperledger composer

查看:397
本文介绍了ENDORSEMENT_POLICY_FAILURE错误分类帐撰写器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在两个分别作为Org1和Org2的不同节点上运行组织示例.我能够查询链码.接下来,我尝试在其上安装composer.除尝试对网络执行ping操作外,所有步骤均成功.它给了我ENDORSEMENT_POLICY_FAILURE错误.对于仅Org1和仅Org2的连接配置文件,我仅使用了localhost.而且,即使存在背书失败错误,我也可以看到使用区块链浏览器,并且在两台机器上都使用ping命令生成了日志块. Org1连接配置文件如下:

I am trying run two org example on tow different nodes acting as Org1 and Org2. I am able to query chaincode. Next I tried installing composer over it. All the steps were successful except when I tried pinging the network. It gave me ENDORSEMENT_POLICY_FAILURE error. For Org1-only and Org2-only connection profiles I have used localhost only. Moreover even though there is endorsement failure error, I can see using blockchain explorer and in logs blocks getting generating using ping command in both the machines. Org1 connection profile is given below:

{ "name": "byfn-network-org1", "type": "hlfv1", "mspID": "Org1MSP", "peers": [ { "requestURL": "grpcs://localhost:7051", "eventURL": "grpcs://localhost:7053", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "peer0.org1.example.com" }, { "requestURL": "grpcs://localhost:8051", "eventURL": "grpcs://localhost:8053", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "peer1.org1.example.com" }, { "requestURL": "grpcs://<PC2-IP>:9051", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt", "hostnameOverride": "peer0.org2.example.com" }, { "requestURL": "grpcs://<PC2-IP>:10051", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt", "hostnameOverride": "peer1.org2.example.com" } ], "ca": { "url": "https://localhost:7054", "name": "ca-org1", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "ca.org1.example.com" }, "orderers": [ { "url" : "grpcs://localhost:7050", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt", "hostnameOverride": "orderer.example.com" } ], "channel": "mychannel", "timeout": 300 }

{ "name": "byfn-network-org1", "type": "hlfv1", "mspID": "Org1MSP", "peers": [ { "requestURL": "grpcs://localhost:7051", "eventURL": "grpcs://localhost:7053", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "peer0.org1.example.com" }, { "requestURL": "grpcs://localhost:8051", "eventURL": "grpcs://localhost:8053", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "peer1.org1.example.com" }, { "requestURL": "grpcs://<PC2-IP>:9051", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt", "hostnameOverride": "peer0.org2.example.com" }, { "requestURL": "grpcs://<PC2-IP>:10051", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt", "hostnameOverride": "peer1.org2.example.com" } ], "ca": { "url": "https://localhost:7054", "name": "ca-org1", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", "hostnameOverride": "ca.org1.example.com" }, "orderers": [ { "url" : "grpcs://localhost:7050", "cert": "/home/user/fabric-samples/multi-org-multi-node/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt", "hostnameOverride": "orderer.example.com" } ], "channel": "mychannel", "timeout": 300 }

订购者在PC 1上,所以我使用了本地主机

Orderer is on PC 1 so I used localhost

推荐答案

Composer使用连接配置文件连接到对等容器等,但是对等容器(和订购者)也需要进行通信.因此,您需要在容器内进行地址解析.

The Connection Profiles are used by Composer to connect to the Peer Containers etc, but the Peer Containers (and the Orderer) need to communicate too. So you need to have address resolution within the Containers.

当您在单台计算机上遵循MultiOrg教程时,docker-compose会创建一个专用的网桥,该网桥允许所有容器通过fqdn相互寻址并进行通信.当您分离到两台计算机时,您需要对其进行管理. Docker Compose的extra_hosts功能可以提供帮助,但是仍然存在要管理的端口问题.

When you follow the MultiOrg tutorial on a single Machine docker-compose creates a dedicated network bridge that allows all the containers to address and communicate with eachother by fqdn. When you separate out to 2 Machines you need to manage that. The extra_hosts feature of Docker Compose can help but there are still issues of ports to manage.

在单独的机器上互通docker容器的真正解决方案是使用Kubernetes或Docker Swarm.

The real solution for inter-communicating docker containers on separate machines is to use Kubernetes or Docker Swarm.

这篇关于ENDORSEMENT_POLICY_FAILURE错误分类帐撰写器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆