在Hyperledger Fabric上部署链码失败 [英] Chaincode deploying fails on Hyperledger Fabric

查看:31
本文介绍了在Hyperledger Fabric上部署链码失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从Fabric-Samples文件夹运行示例测试网络,但是由于某种原因,链码安装失败,给我一个错误。以下是我尝试运行deployCC命令时得到的所有信息:

    Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: cannot connect to Docker endpoint
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed

$ ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-java -ccl java
deploying chaincode on channel 'mychannel'
executing with the following
- CHANNEL_NAME: mychannel
- CC_NAME: basic
- CC_SRC_PATH: ../asset-transfer-basic/chaincode-java
- CC_SRC_LANGUAGE: java
- CC_VERSION: 1.0
- CC_SEQUENCE: 1
- CC_END_POLICY: NA
- CC_COLL_CONFIG: NA
- CC_INIT_FCN: NA
- DELAY: 3
- MAX_RETRY: 5
- VERBOSE: false
Compiling Java code...
~/Desktop/fabric-samples/asset-transfer-basic/chaincode-java ~/Desktop/fabric-samples/test-network
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
<-------------> 0% INITIALIZING [118ms]
<-------------> 0% INITIALIZING [627ms]
<-------------> 0% CONFIGURING [919ms]
<-------------> 0% CONFIGURING [2s]
> root <==-----------> 20% EXECUTING [3s]
> r<======-------> 53% EXECUTING [3s]
<===========--> 86% EXECUTING [4s]tRuntimeClasspath

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 12s
10 actionable tasks: 2 executed, 8 up-to-date
~/Desktop/fabric-samples/test-network
Finished compiling Java code
+ peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-java/build/install/basic --lang java --label basic_1.0
+ res=0
Chaincode is packaged
Installing chaincode on peer0.org1...
Using organization 1
+ peer lifecycle chaincode install basic.tar.gz
+ res=1
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: cannot connect to Docker endpoint
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed

我在Docker for Windows上运行此程序,不幸的是,我在Internet上找到的所有有用答案都与关闭Windows中不支持的GRPC功能有关。

如有任何帮助,我将不胜感激,我已尝试卸载所有内容(包括二进制文件)并重新安装,但在过去两天没有成功。

设置网络和创建频道时没有错误/警告,所以我猜这是与坞站相关的通信问题。

推荐答案

问题是测试网络使用内置的链码生成器和启动器,这需要访问Windows安装程序上的停靠。报告的错误是它无法连接到它。

如果您正在使用Fabric-Samples的主分支,那么可以在窗口shell中启动测试网络之前尝试设置DOCKER_SOCK环境变量。请看一下https://docs.docker.com/desktop/faqs/,看看您可以将其设置为什么。另请查看在不安全端口上公开docker后台进程的选项,这可能会有所帮助。

docker_sock选项已添加到Main中的Fabric-Samples中,但似乎不在2.2分支中,因此请注意此处使用的不是Fabric LTS版本

需要注意的是,我还没有尝试过,因此不能保证它会起作用

遗憾的是,Windows目前在使用Fabric方面没有得到太多关注,因此我目前能给您的最好建议是使用Linux作为您的平台(您可以使用WSL2,但您应该在WSL2发行版中使用Google安装docker,因为这确实需要一些额外的工作)

这篇关于在Hyperledger Fabric上部署链码失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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