rddill-IBM / ZeroToBlockchain

Tutorial for Zero to Blockchain series
342 stars 924 forks source link

Chapter07 : Business network buildAndDeploy error #12

Closed mlecjm closed 6 years ago

mlecjm commented 6 years ago

Hello,

Could you help me to figure out what is wrong with the Chapter07 - Business Network deployment. I got an error message while running the ./buildAndDeploy command from Chapter07. Please find in the attached file the error message mentioned earlier.

Do I need to shut down a business network deployed for a previous chapter every time when I want to build and deploy the business network for the next chapter while experimenting the demos provided in this tutorial? Could you give me the sequence of steps which must be done after running the experiment for each chapter before starting the next chapter experiment?

image

rddill-IBM commented 6 years ago

The first part of your question, do you have to shutdown prior to building the network for the next chapter? No. The buildAndDeploy exec will do that for you. You do have to run 'npm install in each chapter'. The sequence of steps for each chapter is:

(1) npm install
(2) edit the required code in each chapter, this frequently includes edits in the ==>network<== folder. This is required for buildAndDeploy to work correctly
(3) buildAndDeploy 
(4) npm start (or node index)

However, I note at the top of your image an important error message, which says that createComposerProfile is deprecated. You appear to be running an older version of the tutorial, which has been updated because of significant changes in hyperledger composer. Please review the release notes as you appear to be on an older version of the tutorial which will not work with current composer tools. The release notes will tell you what commands you have to run after updating your copy of the repository.

Your buildAndDeploy process should present output like this, starting from the "Starting Network" message: image

mlecjm commented 6 years ago

Hello Sir,

After following the steps mentioned in the latest release (1.3.1) notes and updating the repository on my local system, I got the following error while trying to build and deploy the business network (./buildAndDeploy command) from the Chapter07 folder.

Moreover using a clean and fresh installed Ubuntu 16.04.3 system, I tried to set up the development environment and rebuild and deploy the test network using the latest release repository 1.3.1. However, I still facing some issues as you can see in the opened issue #13.

image

image

rddill-IBM commented 6 years ago

I can see from your buildAndDeploy output that you're still running an older version of the command line tools, which means that the ./setup_xxx script(s) were not run for your system after downloading the latest version of the tutorial from github. You appear to be running in an Ubuntu image. So, after logging into that image, you need to open a terminal window, navigate to the base folder for this tutorial (ZeroToBlockchain) and run the following commands:

(1) run the setup part 1 command with options:
./setup_Ubuntu_Part_1.sh -g false
(2) run the part 2 command:
./setup_Ubuntu_Part_2.sh

These two commands will replace the nodejs SDK for your system with the 0.16 version and they will replace the command line interface to Hyperledger Composer with V0.16

To check and make sure that you have the correct version on your system, before you run these commands, open the setup_Ubuntu_Part_1.sh file and look at the function starting at line 159. You should see the following:

function installNodeDev ()
    {
        if [[ $SDK_INSTALL == "true" ]]; then
            showStep "The composer-cli contains all the command line operations for developing business networks."
            npm uninstall -g composer-cli
            npm install -g --python=python2.7 composer-cli@0.16.0
            showStep "The generator-hyperledger-composer is a Yeoman plugin that creates bespoke applications for your business network."
            npm uninstall -g generator-hyperledger-composer
            npm install -g --python=python2.7 generator-hyperledger-composer@0.16.0
            showStep "The composer-rest-server uses the Hyperledger Composer LoopBack Connector to connect to a business network, extract the models and then present a page containing the REST APIs that have been generated for the model."
            npm uninstall -g composer-rest-server
            npm install -g --python=python2.7 composer-rest-server@0.16.0
            showStep "Yeoman is a tool for generating applications. When combined with the generator-hyperledger-composer component, it can interpret business networks and generate applications based on them."
            npm install -g --python=python2.7 yo
        else   
            showStep "${RED}skipping NODE SDK for HyperLedger install"
        fi
    }

You're looking to make sure that your system shows @0.16.0 on each of the install lines. If it does not, you have an old version of the repository. If it does, please run the commands listed above. This will resolve your issue.