$ ./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
我在Windows的Docker上运行此操作,不幸的是,我在Internet上发现的所有有用的答案都与关闭Windows不支持的GRPC功能有关。
任何帮助都将不胜感激,我试图卸载所有内容(包括二进制文件)并重新安装,但在过去的两天中没有运气。设置网络和频道创建无需错误/警告,所以我猜这是与Docker相关的通信问题。 问题是,测试网络使用内置的链架构建器和启动器,该链条构建器和启动器需要在Windows设置上访问您的Docker。报告的错误是它无法连接到它。
Https://docs.docker.com/desktop/faqs/,看看您可以将其设置为什么。还要查看将Docker Daemon公开在不安全端口上的选项,这可能会有所帮助。
docker_sock选项已添加到主要的织物样本中,但似乎不在2.2分支中,因此请注意,您没有在此处使用Fabric Lts lts释放。 caveat是我没有尝试过的,所以不能保证它会起作用
目前,Windows目前没有给Windows引起太多关注,因此我目前可以提供的最佳建议是将Linux代替为您的平台(您可以使用WSL2,但是您应该将Google安装到WSL2发行版中,因为它确实需要一些额外的工作)。ththank you @gelu, @david_k
问题是Docker没有正确地将容器暴露于我正在使用的Git-Bash Cli(...)
自第一次尝试以来,测试链代码运行速度非常快,非常顺利!
我在试图为我的最后一年项目部署Hyperledger Fabric Braffic网络的同时面临类似的问题。 您提到,切换到WSL2帮助您解决了问题。您能否分享您遵循的详细步骤:
1。设置WSL2和Ubuntu.
2。安装Hyperledger织物
3。部署网络并成功运行样本链码。 我真的很感谢您的指导,因为我一直在努力解决这个问题。预先感谢您!