Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resolve the error on hyperledger fabric?

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?

like image 592
Ayush Gupta Avatar asked Jul 11 '17 11:07

Ayush Gupta


People also ask

What is the latest version of Hyperledger Fabric?

v2. 2.7 Release Notes - July 1, 2022.

Can Hyperledger Fabric be hacked?

Yes, you can enter CouchDB directly using the web interface and modify data.

What can ACL control in Hyperledger Fabric?

Fabric uses access control lists (ACLs) to manage access to resources by associating a Policy with a resource. Fabric contains a number of default ACLs. In this document, we'll talk about how they're formatted and how the defaults can be overridden.


6 Answers

The key of you problem is in the last sentence:

cryptogen tool not found. exiting

You need to make sure to have cryptogen tool compiled prior to trying run the example with ./byfn.sh. Just run from fabric home folder:

make cryptogen configtxgen peer orderer peer-docker orderer-docker tools-docker

Update

You are missing: "Platform specific binaries", see here how to get them.

like image 85
Artem Barger Avatar answered Oct 01 '22 03:10

Artem Barger


Please follow below steps to resolve this issue:

1.Download the platform-specific binaries using command

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0"

Once you run the command it will download various tools like cryptogen, configtxgen etc under bin directory.

1.add the bin directory to your PATH variable using below command export PATH=./bin:$PATH

like image 37
Thao Nguyen Tien Avatar answered Oct 01 '22 01:10

Thao Nguyen Tien


If you're using a mac, do the following in terminal:

brew tap hyperledger/fabric

brew install fabric-tools

and then try again with ./byfn.sh -m generate command

like image 35
Robert Tomas G IV Avatar answered Oct 01 '22 02:10

Robert Tomas G IV


I got the answer now. This issue is caused by the lack of cryptogen, which is indeed a command tool. The simplest way to get it is to download the platform specific binaries into your local machine, here is the sh:

cd fabric-samples
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.1.sh | bash

This sh will download a bash file which would pull the latest Fabric docker images and the platform specific tools, its content is as below:

#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

export VERSION=1.0.1
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386
MARCH=`uname -m`

dockerFabricPull() {
  local FABRIC_TAG=$1
  for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do
      echo "==> FABRIC IMAGE: $IMAGES"
      echo
      docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
      docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
  done
}

dockerCaPull() {
      local CA_TAG=$1
      echo "==> FABRIC CA IMAGE"
      echo
      docker pull hyperledger/fabric-ca:$CA_TAG
      docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}

: ${CA_TAG:="$MARCH-$VERSION"}
: ${FABRIC_TAG:="$MARCH-$VERSION"}

echo "===> Downloading platform binaries"
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz

echo "===> Pulling fabric Images"
dockerFabricPull ${FABRIC_TAG}

echo "===> Pulling fabric ca Image"
dockerCaPull ${CA_TAG}
echo
echo "===> List out hyperledger docker images"
docker images | grep hyperledger*

Now it is based on Fabric 1.0.1, you can find the latest version of this bash from here : http://hyperledger-fabric.readthedocs.io/en/latest/samples.html

After the sh execution is completed, there will be a folder named bin in current directory, then copy the files under this folder into a searchable folder, such as

cp ./bin/*  $GOROOT/bin

Then you can test if the cryptogen exists by type command:

which cryptogen
like image 45
chan zanway Avatar answered Oct 01 '22 01:10

chan zanway


The main problem is in the last line of error which says "cryptogen tool not found. exiting"

Please follow below steps to resolve this issue-

  1. Download the platform-specific binaries using command

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

Once you run the command it will download various tools like cryptogen, configtxgen etc under bin directory.

  1. add the bin directory to your PATH variable using below command

export PATH=$PATH:[path-to-bin-directory]

now try to build the network again. I hope this helps someone.

like image 36
Anand Soni Avatar answered Oct 01 '22 02:10

Anand Soni


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.

like image 27
Thanga Mariappan P Avatar answered Oct 01 '22 03:10

Thanga Mariappan P