【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

简介: 【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

fabric提交链码时报错:Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)


peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name oilcc --version 1.0 --sequence 1 --init-required --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.department1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department1.example.com/peers/peer0.department1.example.com/tls/ca.crt




报错说得很明白,department2节点没有进行背书。

先查询一下链码定义是否已经被所有组织批准: peer lifecycle chaincode queryapproved --channelID mychannel --name oilcc --sequence 1 --output json



两个组织都为true,说明问题应该不是出在背书策略上。

返回去查看commit命令,发现该命令只写了一个department1组织,但该网络中一共有两个组织,必须所有的组织都进行提交才能将链码正常运行在fabric通道中。结合报错的大意:department1提交成功,但department2缺少相应背书策略。

补上另一个组织department2:


peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name oilcc --version 1.0 --sequence 1 --init-required --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.department1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department1.example.com/peers/peer0.department1.example.com/tls/ca.crt --peerAddresses peer0.department2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department2.example.com/peers/peer0.department2.example.com/tls/ca.crt


提交成功:



目录
相关文章
|
机器学习/深度学习 数据采集 监控
深度学习之可视化工具
基于深度学习的可视化工具旨在帮助研究人员和实践者更好地理解和解释深度学习模型的行为、性能和决策过程。这些工具通过图形界面和可视化技术,使得复杂的模型和数据变得更为直观和易于理解。
295 0
|
11月前
|
算法 量子技术
量子计算与艺术:创造性的新领域
量子计算与艺术的结合开辟了全新的创作领域。基于量子力学的计算技术,量子计算以其强大的并行处理能力和量子纠缠特性,为艺术家提供了前所未有的工具和视角,推动艺术形式的创新与优化,激发新的创作灵感。
|
Python
turtle库的几个简单案例,代码可直接运行(python经典编程案例)
该文章提供了多个使用Python的turtle库绘制不同图形的简单示例代码,如画三角形、正方形、多边形等,展示了如何通过turtle进行基本的绘图操作。
1131 5
|
11月前
|
调度 iOS开发 MacOS
python多进程一文够了!!!
本文介绍了高效编程中的多任务原理及其在Python中的实现。主要内容包括多任务的概念、单核和多核CPU的多任务实现、并发与并行的区别、多任务的实现方式(多进程、多线程、协程等)。详细讲解了进程的概念、使用方法、全局变量在多个子进程中的共享问题、启动大量子进程的方法、进程间通信(队列、字典、列表共享)、生产者消费者模型的实现,以及一个实际案例——抓取斗图网站的图片。通过这些内容,读者可以深入理解多任务编程的原理和实践技巧。
587 1
|
12月前
|
安全 Linux 网络安全
Kali渗透测试:远程控制程序基础
Kali渗透测试:远程控制程序基础
199 0
Kali渗透测试:远程控制程序基础
|
存储 中间件 数据安全/隐私保护
中间件中OAuth 2.0 和 OpenID Connect
【6月更文挑战第4天】
552 5
|
算法 数据挖掘 数据库
[软件工程导论(第六版)]第5章 总体设计(复习笔记)
[软件工程导论(第六版)]第5章 总体设计(复习笔记)
|
Shell Linux 开发工具
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
【异常解决】vim编辑文件时提示 Found a swap file by the name “.start.sh.swp“的解决方案
1020 0
|
Docker 容器
【Docker】修改Docke上传/下载并发线程数(解决docker: unexpected EOF.)
下载或上传镜像时,有可能因为网络问题导致报出docker: unexpected EOF.的错误,这时候可以考虑通过修改上传/下载并发线程数来解决
4561 0