How do I resolve the error on hyperledger fabric?

Viewed 14028

While trying to follow tutorial on building your first network I've got following output:

$  ./byfn.sh -m generate

Generating certs and genesis block for with channel 'mychannel' and CLI timeout of '10000' Continue (y/n)? y proceeding ... which: no cryptogen in (/c/users/ayush/fabric-samples/first-network/../bin:/c/users/ayush/fabric-samples/first-network:c:/users/ayush/bin:/c/Users/ayush/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program Files/Docker Toolbox:/c/Users/ayush/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/ayush/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files/Docker/Docker/Resources/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Gradle/gradle-3.3/bin:/c/Go/bin:/c/Program Files/nodejs:/c/Users/ayush/AppData/Local/Programs/Python/Python36/Scripts:/c/Users/ayush/AppData/Local/Programs/Python/Python36:/c/Users/ayush/AppData/Local/Microsoft/WindowsApps:/c/python:/c/Program Files/Docker Toolbox:/c/Users/ayush/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/core_perl) cryptogen tool not found. exiting

What is the problem and how can I get it solved?

11 Answers

Step1: cd fabric-samples

Step2:

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v1.0.5/scripts/bootstrap.sh | bash -s 1.0.5

Step3: cd fabric-samples/first-network

Step4: ./byfn.sh -m generate

You will see a brief description as to what will occur, along with a yes/no command line prompt. Respond with a y or hit the return key to execute the described action.

cryptogen command is under the bin directory where you installed (or uncompressed) the fabric tarball. So you just need to update your $PATH variable so that the shell knows where the cryptogen command can be found. This code should work:

export "$PATH:/<home>/<fabric>/bin"

Where <home> is your home directory, such as /home/sindelio and <fabric> is where the fabric was installed.

Unless you close the terminal, following solution works:

export PATH=$PATH:PATH_TO_FABRIC_SAMPLES/bin

Download the platform-specific binaries after cd into your workspace.

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v1.4.0/scripts/bootstrap.sh | bash

and make sure your version of binaries matches your configuration file.

Related