HyperledgerHandsOn / trade-finance-logistics

Trade Finance and Logistics based on Letter of Credit and Proof of Shipment
Apache License 2.0
174 stars 1.49k forks source link

Receiving "cryptogen tool not found. exiting" upon running ./trade.sh generate -c tradechannel #47

Closed Luiserebii closed 5 years ago

Luiserebii commented 5 years ago

Hello,

After having some difficulty following and executing the commands in the book on my instance of Ubuntu 16.04, I decided to attempt to follow the GitHub documentation. Unfortunately, after running "./trade.sh generate -c tradechannel" inside the network folder, I get:

$ ./trade.sh generate -c tradechannel
Generating certs and genesis block with channel 'tradechannel'
Continue? [Y/n] Y
proceeding ...
cryptogen tool not found. exiting

I believe I followed all of the setup as written, as well, I ran make configtxgen cryptogen configtxlator in the fabric directory, as well as export PATH=$PATH:$GOPATH/src/github.com/hyperledger/fabric/build/bin to add it to the PATH. To double-check, I ran the make command again and got:

$ make configtxgen cryptogen configtxlator
make: Nothing to be done for 'configtxgen'.
make: Nothing to be done for 'cryptogen'.
make: Nothing to be done for 'configtxlator'.

Is there something wrong I might be doing? Sorry if there's something obvious I'm overlooking, I am new to using Docker. Thank you!

VRamakrishna commented 5 years ago

The book has some errors, but they should be addressed in the errata page on the Packt site. Can you check that out once before you attempt to build and run?

One point that was not made explicit in the book (but has been added to the errata) is that the fabric code ought to be downloaded (or cloned) to the path $GOPATH/src/github.com/hyperledger/fabric/. I assume you've done that, but do confirm.

The error you are seeing has nothing to do with Docker. Your executables are not in the system path. Check $GOPATH/src/github.com/hyperledger/fabric/build/bin to ensure that cryptogen and configtxgen exist.

Luiserebii commented 5 years ago

Hello @VRamakrishna, apologies for not checking the errata page. I looked through the Preface for help, but I guess I missed the part on looking for errata on the official website. I've made the edits from the errata, and will let you know how things go soon! Thank you so much for replying so quickly! :smiley:

GaJain commented 5 years ago

Hello @VRamakrishna , I am going through the book as well as the website for Configuring and Launching the Trade Network . I did the following steps as is in same sequence - mkdir -p $GOPATH/src/github.com/hyperledger cd $GOPATH/src/github.com/hyperledger git clone https://github.com/hyperledger/fabric/ cd fabric make configtxgen cryptogen configtxlator make docker

Now , cd trade-finance-logistics/ network cryptogen generate --config=./crypto-config.yaml Error : -bash: cryptogen: command not found Attaching screenshots for your perusal . Screenshot 2019-04-17 at 1 59 34 PM Screenshot 2019-04-17 at 1 59 54 PM Screenshot 2019-04-17 at 2 00 25 PM

VRamakrishna commented 5 years ago

You haven't built the core Fabric executables. Please check out the book errata on the Packt site. There was an omission in the book (i.e., specific building steps were not mentioned, though I think it says that you need to have downloaded and built Fabric and Fabric-CA. ) But this was covered in the errata a few months ago.

GaJain commented 5 years ago

Hey @VRamakrishna , followed and executed the steps mentioned at errata page . Both cryptogen and configtxgen exist at $GOPATH/src/github.com/hyperledger/fabric/build/bin . Then , cd trade-finance-logistics/network/ MacBook-Pro:network gauravjain$ cryptogen generate --config=./crypto-config.yaml -bash: cryptogen: command not found Screenshot 2019-04-18 at 1 19 38 PM

GaJain commented 5 years ago

Hello @VRamakrishna, apologies for not checking the errata page. I looked through the Preface for help, but I guess I missed the part on looking for errata on the official website. I've made the edits from the errata, and will let you know how things go soon! Thank you so much for replying so quickly! 😃

@Luiserebii : Were you able to generate certificates by either of the methods ?

VRamakrishna commented 5 years ago

@GaJain The folder containing cryptogen and configtxgen needs to be in your system path. (In the PATH environment variable, that is.) Check what the equivalent is on your Mac and add the location to the path.

GaJain commented 5 years ago

@GaJain The folder containing cryptogen and configtxgen needs to be in your system path. (In the PATH environment variable, that is.) Check what the equivalent is on your Mac and add the location to the path. @VRamakrishna : Already set it in my ~/.bash_profile . Screenshot 2019-04-18 at 2 34 26 PM

VRamakrishna commented 5 years ago

@GaJain I think you need to remove the space before the =. Try export PATH=$PATH:....

GaJain commented 5 years ago

@GaJain I think you need to remove the space before the =. Try export PATH=$PATH:....

Oops , my bad . Really appreciate your timely response @VRamakrishna . It's working , bravo :)

Sumanbhimavarapu commented 2 years ago

The book has some errors, but they should be addressed in the errata page on the Packt site. Can you check that out once before you attempt to build and run?

One point that was not made explicit in the book (but has been added to the errata) is that the fabric code ought to be downloaded (or cloned) to the path $GOPATH/src/github.com/hyperledger/fabric/. I assume you've done that, but do confirm.

The error you are seeing has nothing to do with Docker. Your executables are not in the system path. Check $GOPATH/src/github.com/hyperledger/fabric/build/bin to ensure that cryptogen and configtxgen exist.

I checked. It exists. I can not run the command. Do I need to check anything else?

VRamakrishna commented 2 years ago

@Sumanbhimavarapu This is an obsolete (and unmaintained) code repository, and the edition of our book that refers to code from this repository has been superceded.

Please check out the new edition of our book (if you wish): https://www.amazon.com/Blockchain-Hyperledger-Fabric-decentralized-applications/dp/1839218754.

The code this edition refers to lies in trade-network, trade-contracts, and trade-apps. Start with trade-apps, which imports the other two as git modules.

sumanbheemavarapu commented 2 years ago

Thanks so much. VRamakrishna