0

I am watching a course on Hyperledger Composer development online. I installed all the required prerequisites, docker, docker-compose, nodejs, golang. After cloning the fabric-samples repository from github. There is a file called byfn.sh inside a folder called first-network. On running the command ./byfn.sh up, it's giving the following error:

Error

If, someone has experience working on it, please help. Any help would be appreciated. Thank you.

david_k
  • 5,843
  • 2
  • 9
  • 16
swapn652
  • 7
  • 3
  • It seems you're running it under WSL, not under "real Windows". You should install docker on your WSL system. – Alexander Santos Jul 07 '22 at 15:29
  • @AlexanderSantos when I try to check the version of docker on Ubuntu, it shows Docker version 20.10.17, build 100c701. But when I check if it works correctly by running the command `docker run hello-world`, it shows the same error. – swapn652 Jul 07 '22 at 15:42
  • You're probably checking your docker's version, this doesn't mean the daemon is actually running. This question might help you checking if it's really running or not: https://stackoverflow.com/questions/43978837/how-to-check-if-docker-daemon-is-running. Also might help: https://stackoverflow.com/questions/60708229/wsl2-cannot-connect-to-the-docker-daemon – Alexander Santos Jul 07 '22 at 15:49
  • Please [edit] your question to include your code/commands and errors as **text** rather than as a screenshot. On stack overflow images should not be used for textual content, see _[Discourage screenshots of code and/or errors](//meta.stackoverflow.com/a/307500)_ and _[Why not upload images of code on SO when asking a question](//meta.stackoverflow.com/a/285557)_ for why. For instructions on formatting see _[How do I format my code blocks?](//meta.stackexchange.com/q/22186)_. A [mre] showing what you have tried that did not work would maximize your chances of getting help. See _[ask]_. – hakre Jul 07 '22 at 22:34
  • And don't want to stump on your feets: is this really related to Composer (the PHP utility) or is this related to Docker-Compose? From your vague description I'd say the `composer-php` tag could be removed, but better you clarify. – hakre Jul 07 '22 at 22:38

1 Answers1

0

I think the first thing you should do is stop looking at or trying to use Hyperledger Composer. It is end of life now and some of it's components will have problems even if you install the exact required versions (for example the rest server fails to launch now on node 8 but changing to a newer version of node may break other parts of Composer).

As you had planned to use it with hyperledger fabric I would suggest that you just invest your time in Hyperledger fabric, see https://hyperledger-fabric.readthedocs.io/en/latest/

Regarding your problem with docker, I suspect you tried to install docker through the apt command in your wsl window ? I'm guessing that you are using WSL2, but if you are using WSL1 then docker will never work in a WSL1 environment. If it was WSL2 then the docker daemon doesn't automatically start in that environment you need to start it yourself first. I think the command is service docker start. The important thing here is to make sure you are using WSL2 and not WSL1 (see hyperledger fabric link later which provides guidance on making sure you are using WSL2).

An alternative to installing docker into WSL2 directly would be to install Docker Desktop for Windows and follow the hyperledger fabric instructions here https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#wsl2

david_k
  • 5,843
  • 2
  • 9
  • 16