v1.4 版本执行 ./byfn.sh up时,报如下错误

Error: error getting chaincode deployment spec for mycc: error getting chaincode package bytes: failed to calculate dependencies: incomplete package: github.com/hyperledger/fabric/core/chaincode/shim
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

跟脚本代码是从(github)以下逻辑报出的

installChaincode() {
PEER=$1
ORG=$2
setGlobals $PEER $ORG
VERSION=${3:-1.0}
set -x
peer chaincode install -n mycc -v ${VERSION} -l ${LANGUAGE} -p ${CC_SRC_PATH} >&log.txt // 此处
res=$?
set +x
cat log.txt
verifyResult $res "Chaincode installation on peer${PEER}.org${ORG} has failed"
echo "===================== Chaincode is installed on peer${PEER}.org${ORG} ===================== "
echo
}

跟下逻辑,意思是说,以下依赖未找到(github

import (
"fmt"
"strconv" "github.com/hyperledger/fabric/core/chaincode/shim" // 未找到
pb "github.com/hyperledger/fabric/protos/peer"
)

经过对比仓库分支代码,发现release-1.4是有的,最新的master分支已经删掉了。
直接参考2.0版本修改下吧
修改chaincode_example02.go

import (
"bytes"
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"os" "github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer"
)

并在同级目录新建go.mod

module github.com/hyperledger/fabric/scripts/fabric-samples/chaincode/chaincode_example02/go

go 1.14
require (
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200128192331-2d899240a7ed
github.com/hyperledger/fabric-protos-go v0.0.0-20200124220212-e9cfc186ba7b
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 // indirect
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 // indirect
golang.org/x/text v0.3.2 // indirect
google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 // indirect
)

然后更新依赖

go mod vendor

再次重新执行测试就好了

./byfn.sh down
./byfn.sh up

或者

go mod init chaincode
go get github.com/hyperledger/fabric/common/util@v1.4
go get github.com/hyperledger/fabric/core/chaincode/shim@v1.4
go get github.com/hyperledger/fabric/protos/peer@v1.4

Chaincode installation on peer0.org1 has failed的更多相关文章

  1. Error: error getting chaincode bytes: failed to calculate dependencies报错解决办法

    Error: error getting chaincode bytes: failed to calculate dependencies: incomplete package: github.c ...

  2. failed to normalize chaincode path: 'go list' failed with: go

    在运行./network.sh deployCC是出现如下错误: Error: failed to normalize chaincode path: 'go list' failed with: g ...

  3. 基于Debian搭建Hyperledger Fabric 2.4开发环境及运行简单案例

    相关实验源码已上传:https://github.com/wefantasy/FabricLearn 前言 在基于truffle框架实现以太坊公开拍卖智能合约中我们已经实现了以太坊智能合约的编写及部署 ...

  4. Hyperledger Fabric 1.0 从零开始(七)——启动Fabric多节点集群

    5:启动Fabric多节点集群 5.1.启动orderer节点服务 上述操作完成后,此时各节点的compose配置文件及证书验证目录都已经准备完成,可以开始尝试启动多机Fabric集群. 首先启动or ...

  5. Hyperledger fabric 1.3版本的安装部署(原创多机多Orderer部署

    首先,我们在安装前,要考虑一个问题 Hyperledger Fabric,通过指定的节点进行背书授权,才能完成交易的存储 延伸开来,就是为了实现容错.高并发.易扩展,需要zookeeper来选择排序引 ...

  6. Hyperledger Fabric 1.0 学习搭建 (五)--- 启动Fabric多节点集群

    5.1.启动orderer节点服务 上述操作完成后,此时各节点的compose配置文件及证书验证目录都已经准备完成,可以开始尝试启动多机Fabric集群. 首先启动orderer节点,切换至order ...

  7. 搭建基于hyperledger fabric的联盟社区(四) --chaincode开发

    前几章已经分别把三台虚拟机环境和配置文件准备好了,在启动fabric网络之前我们要准备好写好的chaincode.chaincode的开发一般是使用GO或者JAVA,而我选择的是GO语言.先分析一下官 ...

  8. Hyperledger Fabric——balance transfer(四)安装和实例化chaincode

    详细解析blance transfer示例的安装(install)和实例化(Instantiate)链码(chaincode)的过程.安装chaincode会根据本地的链码文件生成chaincode镜 ...

  9. Hyperledger Fabric 1.2 --- Chaincode Operator 解读和测试(二)

    本文接上一节是测试部分 搭建一个模拟测试环境 作者将fabric release1.2工程中的 example-e2e进行了改造来进行本次实验: (1)首先我们将examples/e2e_cli/sc ...

  10. 2647673 - HANA Installation Failure with signal 11 core dumped

    Symptom HANA 2.0 SPS03 installation using hdblcmgui failed due to the below error message. [Error] / ...

随机推荐

  1. webgl和canvas的区别

    webgl和canvas的区别 WebGL和Canvas的主要区别在于它们的渲染方式.功能复杂性.以及编程难度.12 渲染方式:Canvas使用2D渲染上下文来绘制图形和图像,基于像素的绘图系统, ...

  2. python中字典的运算

    问题: 如何查找在两个字典中相同的键.值元素? dict1 = {'a': 1, 'b': 2, 'c': 3} dict2 = {'a': 10, 'y': 11,'b': 2} dict1.key ...

  3. 【Azure Cloud Service】使用Key Vault Secret添加.CER证书到Cloud Service Extended Support中

    问题描述 因为Key Vault的证书上传功能中,只支持pfx格式的证书,而中间证书,根证书不能转换为pfx格式,只能是公钥证书格式 cet 或者 crt,能通过文本工具直接查看base64编码内容. ...

  4. 云原生周刊 | 在 Grafana 中显示 K8s Service 之间的依赖关系

    开源项目推荐 Caretta 这个项目可以在 Grafana 监控面板中显示 K8s Service 之间的依赖关系.底层使用的是 eBPF,对应用无侵入. busuanzi 这是一个基于 Golan ...

  5. 使用 Cursor 和 Devbox 快速开发并上线 Gin 项目

    作为开发者,最让我们头疼的事情是什么?那必须是环境配置.版本控制以及各种部署配置等等繁琐的工作. 想象一下,如果你只需点击几下鼠标,就能拥有一个完全配置好的开发环境,支持从 Java 到 Python ...

  6. Java常见面试真题之中级进阶

    前言 本来想着给自己放松一下,刷刷博客,突然被几道面试题难倒!java反射的作用于原理?说说List,Set,Map三者的区别?Object 有哪些常用方法?大致说一下每个方法的含义?Java 创建对 ...

  7. 模算术 modular arithmetic

    https://en.wikipedia.org/wiki/Modular_arithmetic#Integers_modulo_n 模算术: 整数达到特定值时会' 折返 ' 回来-- 模数 modu ...

  8. 基于sqli-labs Less-1的sql联合注入详解

    SQLi Labs 是一个专为学习和测试 SQL 注入漏洞设计的实验平台,旨在帮助安全研究人员.开发者和网络安全爱好者深入理解并实践各种 SQL 注入攻击.该平台提供了一系列精心设计的实验环境,模拟真 ...

  9. 记录CentOS 部署 express 项目

    第一步.安装 node.js1.在服务器上 /opt 下创建 node 文件夹,并进入该文件夹mkdir /opt/nodecd /opt/node 2.下载 node.js3.下载的 node.js ...

  10. gal game 杂谈——前言

    gal game 杂谈--前言 大年三十凌晨(早上)打算开始写了吧,作为第一篇先写一些前言好了. 第一次接触gal game还是在B站上看到有人玩<我和她的世界末日>当时觉得挺有意思的,加 ...