首页 > 解决方案 > hyperledger fabric byfn.sh up 失败,脚本 scripts.sh 未找到

问题描述

我想在 WSL 中构建第一个超级账本结构网络

我从 git 获取简单代码,然后按照https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#start-the-network中的指南下载特定于平台的二进制文件。但是当我运行命令 ./byfn.sh up 时,发生了错误

root@LENOVO-PC:~/go/src/github.com/hyperledger/fabric-samples/first-network# ./byfn.sh up
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
LOCAL_VERSION=1.4.0
DOCKER_IMAGE_VERSION=1.4.3
=================== WARNING ===================


    > Local fabric binaries and Docker images are out of sync. This may
    > cause problems.

Starting peer1.org1.example.com ... done                                                                                                                     Starting peer1.org2.example.com ... done                                                                                                                     Starting peer0.org2.example.com ... done                                                                                                                     Starting orderer.example.com    ... done                                                                                                                     Starting peer0.org1.example.com ... done                                                                                                                     cli is up-to-date
CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS                  PORTS                      NAMES
95f095123a0d        hyperledger/fabric-tools:latest     "/bin/bash"         5 hours ago         Up 5 hours                                         cli
adb4c6d2d4ce        hyperledger/fabric-peer:latest      "peer node start"   5 hours ago         Up Less than a second   0.0.0.0:10051->10051/tcp   peer1.org2.example.com
d9c4813c8d22        hyperledger/fabric-peer:latest      "peer node start"   5 hours ago         Up Less than a second   0.0.0.0:9051->9051/tcp     peer0.org2.example.com
026b1d3e85aa        hyperledger/fabric-peer:latest      "peer node start"   5 hours ago         Up Less than a second   0.0.0.0:7051->7051/tcp     peer0.org1.example.com
add0499d007b        hyperledger/fabric-orderer:latest   "orderer"           5 hours ago         Up Less than a second   0.0.0.0:7050->7050/tcp     orderer.example.com
b15463852d31        hyperledger/fabric-peer:latest      "peer node start"   5 hours ago         Up Less than a second   0.0.0.0:8051->8051/tcp     peer1.org1.example.com
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"scripts/script.sh\": stat scripts/script.sh: no such file or directory": unknown
ERROR !!!! Test failed

docker exec cli scripts/script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE $NO_CHAINCODE在 byfn.sh 中发现了错误的命令。
然后我进入文件夹scripts,将命令更改为docker exec cli script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE $NO_CHAINCODE并执行它。获取输出

root@LENOVO-PC:~/go/src/github.com/hyperledger/fabric-samples/first-network/scripts# docker exec cli script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOU
T $VERBOSE $NO_CHAINCODE
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"script.sh\": executable file not found in $PATH": unknown

WSL导致docker的环境变量有问题吗?

标签: dockerhyperledger-fabricwindows-subsystem-for-linux

解决方案


推荐阅读