GithubHelp home page GithubHelp logo

rddill-ibm / zerotoblockchain Goto Github PK

View Code? Open in Web Editor NEW
342.0 63.0 926.0 76.42 MB

Tutorial for Zero to Blockchain series

CSS 1.66% HTML 2.95% JavaScript 87.80% Shell 5.95% Gherkin 1.64%
blockchain hyperledger-composer hyperledger-fabric nodejs tutorial

zerotoblockchain's Introduction

ZeroToBlockchain

Tutorial on getting started with Blockchain on IBM Bluemix

Please use the README.md or README.pdf files in each chapter for the latest documentation for that chapter.

Base concept is:

Chapter 1 What is Blockchain? Concept and Architecture overview

Chapter 2 What's the story we'll implement

Chapter 2.1 Architecture for the Story

Chapter 3 Creating the Blockchain Development Environment

Chapter 4 Building your first network

Chapter 5 Building the Admin User Experience

Chapter 6 Building the Buyer User Experience

Chapter 7 Building the Seller User Experience

Chapter 8 Building the Provider User Experience

Chapter 9 Building the Shipper User Experience

Chapter 10 Building the Finance Company User Experience

Chapter 11 Building the Unified User Experience

Chapter 12 Events

Chapter 13 Deploying a demo on Bluemix/Kubernetes

Chapter 14 Debugging HyperLedger Composer inside Docker

zerotoblockchain's People

Contributors

danjdk avatar hckim16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerotoblockchain's Issues

Latest release (1.3.1) repository package test network build and deploy error

Hello,
Using a clean and fresh installed Ubuntu 16.04.3 system and the latest released (1.3.1) repository, after setup_Ubuntu_Part_1 & 2 have been successfully executed, I got the following results while trying to install npm node and build the test network from the Chapter03 of the cloned tutorial repository.
Cloud you help me to figure out what is wrong and how can I fix it?

image
image
image
image
image

Debian stretch not supported

Unable to install development environment on Debian 9 (stretch)
curl -H 'Accept: application/vnd.github.v3.raw' https://raw.githubusercontent.com/rddill-IBM/ZeroToBlockchain/master/setup_Ubuntu_Part_2.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6481 100 6481 0 0 12270 0 --:--:-- --:--:-- --:--:-- 12297
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
No LSB modules are available.
Error: Ubuntu stretch is not supported

nodejs-legacy is required

couldn't install the composer-cli - noticed your script hasn't installed nodejs-legacy - once I've installed it composer-cli got installed

Chapter 6 : Cannot load orders belonging to buyers nor execute any new order

z2b-buyer.js calls hlcClient.js which in turn tries to execute a named query on the fabric and fails with the exception logged on the console below:

{result: "failed", error: "businessNetwork: Cannot convert undefined or null to object"}
error
:
"businessNetwork: Cannot convert undefined or null to object"
result
:
"failed"

The license header file does'nt exist

Hi,

So I have executed till ./buildAndDeploy.sh which ran perfectly and launched the docker container and rest-server. However when I try to do npm test as described in Chapter 04 it is failing with following error, can you please help me fix this ?

ubuntu@ip-172-31-18-205:~/ZeroToBlockchain/Chapter04/network$ npm test

[email protected] pretest /home/ubuntu/ZeroToBlockchain/Chapter04/network
npm run lint

[email protected] lint /home/ubuntu/ZeroToBlockchain/Chapter04/network
eslint ./network

[email protected] postlint /home/ubuntu/ZeroToBlockchain/Chapter04/network
npm run licchk

[email protected] licchk /home/ubuntu/ZeroToBlockchain/Chapter04/network
license-check

events.js:183
throw er; // Unhandled 'error' event
^
Error: The license header file doesnt exist header.txt at readLicenseHeaderFile (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/gulp-license-check/index.js:113:53) at isLicenseHeaderPresent (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/gulp-license-check/index.js:172:23) at checkHeaderFromBuffer (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/gulp-license-check/index.js:81:7) at DestroyableTransform._transform (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/gulp-license-check/index.js:41:5) at DestroyableTransform.Transform._read (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_transform.js:172:83) at doWrite (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_writable.js:418:64) at writeOrBuffer (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_writable.js:407:5) at DestroyableTransform.Writable.write (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_writable.js:334:11) at DestroyableTransform.ondata (/home/ubuntu/ZeroToBlockchain/Chapter04/network/node_modules/readable-stream/lib/_stream_readable.js:619:20) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] licchk: license-check`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] licchk script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2018-03-28T14_08_10_751Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postlint: npm run licchk
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postlint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2018-03-28T14_08_10_778Z-debug.log
npm ERR! Test failed. See above for more details.

Chapter 4 : npm run test fails

My buildAndDeploy went fine and smooth. But when I try npm run test it fails with the following error.
Can you PLEASE help me out!

  1. Finance Network "before all" hook:
    Error: Failed to load connector module "composer-connector-undefined" for connection type "undefined". Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'
    at Promise.resolve.then (node_modules/composer-common/lib/connectionprofilemanager.js:136:42)
    at

npm test error Chapter 04

After I run the command npm test I do not get the results as shown in the video. I am getting Test Failed. But localhost is giving the required interface.

Answers-Documentation

Hello,
This is not an issue but a question regarding the "answers" documentation. It looks like the code there is the same as the code in the working files which is very different than the code you are referencing on your presentation. You mentioned copying and pasting answers to the working files. But the answer file seems the same as the working files (currently bouncing back and forth between ch. 5 and ch. 6).
Thank you.

Error: namespace already exists

Environment: macOS 10.13.2 (17C205), npm : 5.6.0, node: v8.9.4

I am following the video for Chapter04. Executing the npm install command (minute 16.45 in the video) from the ZeroToBlockchain/Chapter04 folder results in the following error:

$ pwd
/Users/olivieri/git/ZeroToBlockchain/Chapter04

$ npm install
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> [email protected] prepublish /Users/olivieri/git/ZeroToBlockchain/Chapter04
> mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna

Creating Business Network Archive


Looking for package.json of Business Network Definition
	Input directory: /Users/olivieri/git/ZeroToBlockchain/Chapter04
Error: namespace already exists
Command failed

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepublish: `mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/olivieri/.npm/_logs/2018-01-30T17_23_13_638Z-debug.log

Any ideas what I could be doing wrong? Thanks.

PS Just fyi, executing npm install from the Chapter03 folder worked just fine as expected:

$ npm install

...

> [email protected] postinstall /Users/olivieri/git/ZeroToBlockchain/Chapter03/network/node_modules/protobufjs
> node scripts/postinstall

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> [email protected] prepublish /Users/olivieri/git/ZeroToBlockchain/Chapter03/network
> mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna

Creating Business Network Archive


Looking for package.json of Business Network Definition
	Input directory: /Users/olivieri/git/ZeroToBlockchain/Chapter03/network

Found:
	Description: Zero to Blockchain tutorial network
	Name: zerotoblockchain-network
	Identifier: [email protected]

Written Business Network Definition Archive file to 
	Output file: ./network/dist/zerotoblockchain-network.bna

Command succeeded

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

added 1588 packages in 50.893s

[{"code":400,"message":"Authorization failure"}]]

Hi Bob,

At Chapter06, when I'm trying to Display Order status, Im getting this error :
image

And when I'm trying to Add a Order, getting the same authorization problem:
image

Could you help me to understand how to fix it ?

Chapter 6 card not found

Hi,

I have met with below issue and I don't know how to fix this issue. Can you help me please?

[13] at: 10:54:39.923 Url is: /composer/client/getMyOrders
getMyOrders req.body.userID is: [email protected]
getMyOrders req.body.userID is: [email protected]
businessNetwork connect failed { Error: Card not found: [email protected]
at store.get.then.catch (/Users/userm/Blockchain/ZeroToBlockchain/Chapter06/node_modules/composer-common/lib/cardstore/walletbackedcardstore.js:74:27)
at
cause:
{ Error: ENOENT: no such file or directory, stat '/Users/userm/.composer/cards/[email protected]'
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/Users/userm/.composer/cards/[email protected]' } }

This issue occur by method geMyOrders(Display Order Status), well also by creating order.
I know that it doesn't work because there is no user card in the wallet. Is there any script that creating also users card, that I could miss somehow or any other solution?

Thank you for your answer.

ZerotoBlockchain Chapter06

Dear Mr @rddill-IBM , I deployed ZerotoBlockchain with Chapter06 successfully. But when I create a member with Name and Email, I get this error. It stops service and stop port 6001, then I have to run "node index" command to continue.

user@user-virtual-machine:~/Chapter06$ node index
Listening locally on port 6001
[1] at: 14:30:11.202 Url is: /api/getSupportedLanguages
[2] at: 14:30:11.244 Url is: /composer/admin/getMembers
[3] at: 14:30:11.326 Url is: /composer/admin/getMembers
[4] at: 14:30:11.333 Url is: /composer/admin/getMembers
[5] at: 14:30:11.338 Url is: /composer/admin/getMembers
[6] at: 14:30:12.125 Url is: /api/selectedPrompts
[7] at: 14:30:13.124 Url is: /api/getTextLocations
[8] at: 14:31:28.748 Url is: /api/getSupportedLanguages
[9] at: 14:31:28.752 Url is: /composer/admin/getMembers
[10] at: 14:31:28.757 Url is: /composer/admin/getMembers
[11] at: 14:31:28.765 Url is: /composer/admin/getMembers
[12] at: 14:31:28.770 Url is: /composer/admin/getMembers
[13] at: 14:31:28.780 Url is: /api/getTextLocations
[14] at: 14:31:28.793 Url is: /api/selectedPrompts
[15] at: 14:31:31.083 Url is: /composer/admin/getRegistries
[16] at: 14:32:01.992 Url is: /composer/admin/addMember
[email protected] not in Buyer registry.
/home/user/Chapter06/controller/restapi/features/composer/queryBlockChain.js:122
bcEvents.registerBlockEvent(function(event) {svc.cs_connection.sendUTF(JSON.stringify(e vent));});
^

TypeError: Cannot read property 'sendUTF' of null
at /home/user/Chapter06/controller/restapi/features/composer/queryBlockChain.js:122:88
at /home/user/Chapter06/node_modules/fabric-client/lib/EventHub.js:761:4
at Array.forEach ()
at EventHub._processBlockOnEvents (/home/user/Chapter06/node_modules/fabric-client/lib/EventHub.js:759:36)
at ClientDuplexStream. (/home/user/Chapter06/node_modules/fabric-client/lib/EventHub.js:312:10)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at ClientDuplexStream.Readable.push (_stream_readable.js:208:10)

image

Node index chapter06

Following the tutorial, when I run the command node index, I got the following error:

Omar-MBP:chapter06 mac$ node index
module.js:550
throw err;
^

Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/Users/mac/Documents/ZTB/Chapter06/index.js:19:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Omar-MBP:chapter06 mac$ npm install

I tried to install the missing modules by running the npm install command /-

Command succeeded

npm notice created a lockfile as package-lock.json. You should commit this file.
added 1438 packages from 1163 contributors and audited 25128 packages in 211.59s
found 168 vulnerabilities (46 low, 112 moderate, 9 high, 1 critical)
run npm audit fix to fix them, or npm audit for details
Omar-MBP:chapter06 mac$ npm audit fix
npm ERR! code E400
npm ERR! 400 Bad Request - POST https://registry.npmjs.org/-/npm/v1/security/audits

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac/.npm/_logs/2018-12-11T11_14_15_521Z-debug.log
Omar-MBP:chapter06 mac$ ./Users/mac/.npm/_logs/2018-12-11T11_14_15_521Z-debug.log
-bash: ./Users/mac/.npm/_logs/2018-12-11T11_14_15_521Z-debug.log: No such file or directory
Omar-MBP:chapter06 mac$ npm install-missing

-/ and npm-install-missing:
Omar-MBP:chapter06 mac$ npm-install-missing

Package Current Wanted Latest Location
chai 3.5.0 3.5.0 4.2.0 zerotoblockchain-network
chai-as-promised 6.0.0 6.0.0 7.1.1 zerotoblockchain-network
composer-admin 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-client 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-common 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-connector-embedded 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-cucumber-steps 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-runtime 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
composer-runtime-hlfv1 0.16.6 0.16.6 0.20.5 zerotoblockchain-network
cucumber 2.3.1 2.3.1 5.0.3 zerotoblockchain-network
eslint 3.19.0 3.19.0 5.10.0 zerotoblockchain-network
fabric-client 1.2.2 1.2.2 1.3.0 zerotoblockchain-network
mocha 3.5.3 3.5.3 5.2.0 zerotoblockchain-network
nyc 11.9.0 11.9.0 13.1.0 zerotoblockchain-network
vcap_services 0.3.4 0.3.4 0.6.0 zerotoblockchain-network
npm-install-missing: No modules seem to be missing. Huzzah!

after retrying the node index command, I got:

Omar-MBP:chapter06 mac$ node index
/Users/mac/Documents/ZTB/Chapter06/node_modules/express/lib/router/route.js:202
throw new Error(msg);
^

Error: Route.get() requires a callback function but got a [object Undefined]
at Route.(anonymous function) [as get] (/Users/mac/Documents/ZTB/Chapter06/node_modules/express/lib/router/route.js:202:15)
at Function.proto.(anonymous function) [as get] (/Users/mac/Documents/ZTB/Chapter06/node_modules/express/lib/router/index.js:510:19)
at Object. (/Users/mac/Documents/ZTB/Chapter06/controller/restapi/router.js:35:8)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)

bash: ./buildAndDeploy.sh: No such file or directory

I on Chapter04 of ZeroToBlockchain and while executing the command: ./buildAndDeploy.sh I am facing the following error : bash: ./buildAndDeploy.sh: No such file or directory

Earlier I did try this for Chapter03, and it ran successfully. However today I am getting this error for Chapter 04. I tried it again for Chapter03 and the same error.

I am using ubuntu for this (not VM).

Please help!.

Chapter04 -Error: Could not find chaincode with name 'zerotoblock-chain'

Hello Bob,

in Chapter04, the npm install has and namespace issue, but its seems to be expected, per the readme.

When i run the /buildandDeploy.sh is receive the follow error 'Error: Could not find chaincode with name 'zerotoblock-chain'. I manually completed the scripts as you suggested in the videos. I've since copied the one from the answers folder, but that didn't help.

What did I miss? :)

Thank
tom

Update the Composer versions

The Fabric version is hlfv1 and the composer version is 0.16 while installing in Chapter 03.

Shouldn't it be updated to hlfv12 and 0.20.5 ?

Chapter 03 npm install error sh: 1: composer: not found

> ~/ZeroToBlockchain/Chapter03$ npm install
> 
> > [email protected] prepublish /home/hrishikesh/ZeroToBlockchain/Chapter03
> > mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna
> 
> sh: 1: composer: not found
> 
> npm ERR! Linux 4.15.0-43-generic
> npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
> npm ERR! node v8.10.0
> npm ERR! npm  v3.5.2
> npm ERR! file sh
> npm ERR! code ELIFECYCLE
> npm ERR! errno ENOENT
> npm ERR! syscall spawn
> npm ERR! [email protected] prepublish: `mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna`
> npm ERR! spawn ENOENT
> npm ERR! 
> npm ERR! Failed at the [email protected] prepublish script 'mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna'.
> npm ERR! Make sure you have the latest version of node.js and npm installed.
> npm ERR! If you do, this is most likely a problem with the zerotoblockchain-network package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR!     mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna
> npm ERR! You can get information on how to open an issue for this project with:
> npm ERR!     npm bugs zerotoblockchain-network
> npm ERR! Or if that isn't available, you can get their info via:
> npm ERR!     npm owner ls zerotoblockchain-network
> npm ERR! There is likely additional logging output above.
> 
> npm ERR! Please include the following file with any support request:
> npm ERR!     /home/hrishikesh/ZeroToBlockchain/Chapter03/npm-debug.log
> 

npm-debug.log file is attached
npm-debug.log

No Roles Button : Chapter 05

Hi Bob,

I am in Chapter05 did all the steps. This time I could clear the barrier of node index. However after opening my web browser, I could not see any "Roles" tab on the icon bar.
Heres the screenshot:

Screenshot from 2019-05-15 16-29-02

Please help!.

AK

Chapter06

In Chapter 6, when I execute "node index", and got this error message.

admin$ node index
module.js:540
throw err;
^

Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/Users/admin/Downloads/ZeroToBlockchain-master/Chapter06/index.js:17:15)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)

Chapter07 : Business network buildAndDeploy error

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

Zerotoblockchain-network

Dear Mr @rddill-IBM,
I get these errors when create new order at Chapter 08. Could you give me how to solve these? Could you explain when we use the secrect of Create Card and Issuse Identity.

image
image
image
image

Chap 03 - buildAndDeploy error ------installing PeerAdmin card

Hello,
In Chapter 3, when I execute "./buildAndDeploy ", and got this error message. Could you help me to fix this issue ?

userName: PeerAdmin
description:
businessNetworkName:
roles:

  • PeerAdmin
  • ChannelAdmin
    connectionProfile:
    name: hlfv1
    type: hlfv1
    channel: composerchannel
    secretSet: No secret set
    credentialsSet: Credentials set

Command succeeded

   =====================================================
   -----> start up complete
   =====================================================
   =====================================================
   -----> deploying network
   =====================================================
   =====================================================
   -----> option passed for network name is: 'zerotoblockchain-network'
   =====================================================

   network deploy script for the Zero To Blockchain Series
   This has been successfully tested on OSX Sierra and Ubuntu 16.04
   This script will create your Composer archive

Parameters:
Network Name is: zerotoblockchain-network
=====================================================
-----> deploying network
=====================================================
=====================================================
-----> installing PeerAdmin card
=====================================================
✖ Installing runtime for business network zerotoblockchain-network. This may take a minute...
Error: Error trying install composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: Endpoint read failed

Command failed

   =====================================================
   -----> starting network
   =====================================================

Starting business network from archive: zerotoblockchain-network.bna
Business network definition:
Identifier: [email protected]
Description: Zero to Blockchain tutorial network

Processing these Network Admins:
userName: admin

✖ Starting business network definition. This may take a minute...
Error: Error trying to instantiate composer runtime. Error: Error: SERVICE_UNAVAILABLE
Command failed

   =====================================================
   -----> importing networkadmin card
   =====================================================

Deleted Business Network Card: admin@zerotoblockchain-network

Command succeeded

Successfully imported business network card
Card file: networkadmin.card
Card name: admin@zerotoblockchain-network

Command succeeded

   =====================================================
   -----> pinging admin@zerotoblockchain-network card
   =====================================================

Error: Error trying login and get user Context. Error: Error trying to enroll user or load channel configuration. Error: Error: SERVICE_UNAVAILABLE
Command failed

   =====================================================
   -----> starting REST server
   =====================================================

   network archive, start and deploy script for the Zero To Blockchain Series
   This has been tested on Mac OSX thru High Sierra and Ubuntu V16 LTS
   This script will create your Composer archive

Parameters:
Network Name is: zerotoblockchain-network
=====================================================
-----> testing rest server
when this completes,
go to your favorite browser
and enter localhost:3000/explorer
=====================================================
=====================================================
-----> starting rest server v0.15 for admin@zerotoblockchain-network
=====================================================
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query business network. Error: Endpoint read failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query business network. Error: Endpoint read failed
Error: Error trying to ping. Error: Error trying to query business network. Error: Endpoint read failed
at _checkRuntimeVersions.then.catch (/root/.nvm/versions/node/v8.11.1/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:713:34)
at

pdf / ppt corruption on Ubuntu

The fonts are not showing properly on the pdf in Ubuntu. Also pptx is showing as correupt when trying to open with LibreOffice. Is there a specific font on system which is required to view the pdf and ppt documentation files.

Finance

Dear Mr @rddill-IBM,
The Buyer has approved payment, but In Finance Company User Experience function, I can not set Pay in Finance. Could you show me how to fix? Thank you so much
image

image

Chapter 3: Ubuntu tara is not supported in Linux mint

I am using Linux mint 19. When I running
setup_Ubuntu_Part_1.sh
it shows error
`No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 19 Tara
Release: 19
Codename: tara
No LSB modules are available.

   installation script for the Zero To Blockchain Series
   This is for Linux ONLY. It has been tested on Ubuntu 16 LTS and on Ubuntu 18 LTS
   Other versions of Linux are not supported via this script. 
   The following will be downloaded by this script
   dos2unix, to correct scripts from hyperledger and composer
   docker for Ubuntu
   The exec will proceed with checking to ensure you are at Node V8
   which is required for working with HyperLedger Composer
   The script will then install the nodejs SDK for hyperledger and composer
   The script will finish by requesting that you reboot your system

Parameters:
Install github? true
Install nodejs? true
Install nodejs SDK? true
Install Docker? true
=====================================================
-----> getting current directory
=====================================================
=====================================================
-----> Running 'setup_Ubuntu_Part_1.sh'
=====================================================
=====================================================
-----> found Ubuntu tara as an x86_64 system
=====================================================
Error: Ubuntu tara is not supported
`

Seller Not Able to route the order to provider

Despite following all the directions for Chapter07, I am running into the issue of the Seller Not able to update the order to be routed to a Provider.

Environment : Hyperledger Fabric : 1.1
Hyper Ledger Composer - 0.19.5

[19] at: 10:07:38.816 Url is: /composer/client/orderAction
orderAction req.body.participant is: [email protected]
Order from Supplier entered for 006 inbound id: [email protected] with order.seller as: [email protected]
006 submitTransaction to update status to Order From Supplier failed with text: Error trying invoke business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: error executing chaincode: transaction returned with failure: AccessException: Participant 'org.acme.Z2BTestNetwork.Seller#[email protected]' does not have 'CREATE' access to resource 'org.acme.Z2BTestNetwork.OrderFromSupplier#d3e970f15f51e642195ec5e42790ade26a1dcf32387c59ecb9c46519046a8d2c'

startup.sh file missing

Hi i make the install following the step-by-step video and readme file and when I run ./buildAndDeploy.sh get this message, (using Ubuntu LTS 16.04 runing on VirtuaBox)

./startup.sh: line 37: ./startFabric.sh: No such file or directory
=====================================================
-----> creating new PeerAdmin card (required with each restart)
=====================================================
./startup.sh: line 44: ./createPeerAdminCard.sh: No such file or directory

after that a lot of errors is showing in the process, like:

Installing runtime for business network zerotoblockchain-network. This may take a minute...
Error: Error trying install composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: Connect Failed

or:

Starting business network definition. This may take a minute...
Error: Error trying to instantiate composer runtime. Error: Error: SERVICE_UNAVAILABLE
Command failed

and so on, any cloud about what is going on?
thanks in advance.

Chapter 4 - how to start composer?

Bob, in chapter 4 slide 8, step 3 it says to import your model in composer.

But i can't start composer. I guess it should be running but i don't know on which port (see list of open ports at the bottom). I have tried the first few ports that have been opened on my machine. When i open http://http://localhost:7054/ in my browser i get "404 page not found".

Is there something i am missing?
The buildAndDeploy command seems to be running fine without errors. Last part of its console output says:

.......
Parameters:
       Network Name is:  zerotoblockchain-network 
       =====================================================
       -----> deploying network
       =====================================================
Deploying business network from archive: zerotoblockchain-network.bna
Business network definition:
	Identifier: [email protected]
	Description: Zero to Blockchain tutorial network

✔ Deploying business network definition. This may take a minute...

Output of open ports on my machine.

Brams-MacBook-Pro:Chapter04 [email protected]$ netstat -an |grep LIST
tcp6       0      0  ::1.7051               *.*                    LISTEN     
tcp4       0      0  *.7051                 *.*                    LISTEN     
tcp6       0      0  ::1.7053               *.*                    LISTEN     
tcp4       0      0  *.7053                 *.*                    LISTEN     
tcp6       0      0  ::1.5984               *.*                    LISTEN     
tcp4       0      0  *.5984                 *.*                    LISTEN     
tcp6       0      0  ::1.7054               *.*                    LISTEN     
tcp4       0      0  *.7054                 *.*                    LISTEN     
tcp6       0      0  ::1.7050               *.*                    LISTEN     
tcp4       0      0  *.7050                 *.*                    LISTEN     
tcp4       0      0  127.0.0.1.6234         *.*                    LISTEN     
tcp4       0      0  127.0.0.1.60808        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50008        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50006        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50005        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50004        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50009        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50001        *.*                    LISTEN     
tcp6       0      0  fe80::1%lo0.51249      *.*                    LISTEN     
tcp4       0      0  127.0.0.1.59449        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50973        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.50460        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.4243         *.*                    LISTEN     
tcp4       0      0  127.0.0.1.4380         *.*                    LISTEN     
tcp4       0      0  127.0.0.1.29754        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.1023         *.*                    LISTEN     
tcp6       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  127.0.0.1.49153        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.49152        *.*                    LISTEN 

node index error : Chapter 05

I get error when I try to run this command node index. I tried npm install before this, but no sucess. Please help!.

error cannot ffind module

Using composer-cli at v0.16.2
Error: Failed to load connector module "composer-connector-undefined" for connection type "undefined". Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'-Cannot find module 'composer-connector-undefined'
Command failed

Successfully created business network card file to
Output file: /tmp/[email protected]

Command succeeded

Error: Card already exists: PeerAdmin@hlfv1
Command failed

Chapter04 npm run test fails

Hi Team,

I have been following all the exact steps and at chapter 04 after running buildAndDeploy.sh script successfully, when i ran npm run test, it is failing, please find logs from .npm folder below.

Should i take this issue into account ? As i see this just as a test run. Can i continue with the other chapters ?

0 info it worked if it ends with ok
1 verbose cli [ '/home/ravi/.nvm/versions/node/v8.12.0/bin/node',
1 verbose cli '/home/ravi/.nvm/versions/node/v8.12.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle [email protected]pretest: [email protected]
6 verbose lifecycle [email protected]
pretest: unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]pretest: PATH: /home/ravi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ravi/Documents/IBM/ZeroToBlockchain/ZeroToBlockchain/Chapter04/node_modules/.bin:/home/ravi/.nvm/versions/node/v8.12.0/bin:/home/ravi/fabric-tools/bin:/home/ravi/fabric-tools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
8 verbose lifecycle [email protected]
pretest: CWD: /home/ravi/Documents/IBM/ZeroToBlockchain/ZeroToBlockchain/Chapter04
9 silly lifecycle [email protected]pretest: Args: [ '-c', 'npm run lint' ]
10 silly lifecycle [email protected]
pretest: Returned: code: 1 signal: null
11 info lifecycle [email protected]~pretest: Failed to exec pretest script
12 verbose stack Error: [email protected] pretest: npm run lint
12 verbose stack Exit status 1
12 verbose stack at EventEmitter. (/home/ravi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
12 verbose stack at emitTwo (events.js:126:13)
12 verbose stack at EventEmitter.emit (events.js:214:7)
12 verbose stack at ChildProcess. (/home/ravi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
12 verbose stack at emitTwo (events.js:126:13)
12 verbose stack at ChildProcess.emit (events.js:214:7)
12 verbose stack at maybeClose (internal/child_process.js:915:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose pkgid [email protected]
14 verbose cwd /home/ravi/Documents/IBM/ZeroToBlockchain/ZeroToBlockchain/Chapter04
15 verbose Linux 4.18.0-15-generic
16 verbose argv "/home/ravi/.nvm/versions/node/v8.12.0/bin/node" "/home/ravi/.nvm/versions/node/v8.12.0/bin/npm" "run" "test"
17 verbose node v8.12.0
18 verbose npm v6.9.0
19 error code ELIFECYCLE
20 error errno 1
21 error [email protected] pretest: npm run lint
21 error Exit status 1
22 error Failed at the [email protected] pretest script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]

Regards,
Ravi

Chapter03 - npm install error

I have node v10. When i do npm install within Chapter03 folder, i get following errors:

npm WARN prepublish-on-install As of npm@5, prepublish scripts are deprecated.
npm WARN prepublish-on-install Use prepare for build steps and prepublishOnly for upload-only.
npm WARN prepublish-on-install See the deprecation note in npm help scripts for more information.

[email protected] prepublish /Users/majeefah/Documents/blockchain/ZeroToBlockchain/Chapter03
mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna

[Symfony\Component\Console\Exception\RuntimeException]
The "--sourceType" option does not exist.

archive [-f|--format FORMAT] [--dir DIR] [--file FILE] [--ignore-filters] [--] [] []

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepublish: mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/majeefah/.npm/_logs/2019-03-03T00_17_20_693Z-debug.log

After that when i do ./buidAndDeploy it throws following

=====================================================
-----> creating new PeerAdmin card (required with each restart)
=====================================================
Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv12
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)

Cannot use Composer version 1.8.4 2019-02-11 10:52:10 version of composer with fabric 1.2, v0.20 or higher is required
=====================================================
-----> copying admin card to ~/.hfc-key-store
=====================================================
CA_PEM_SOURCE is: /Users/majeefah/Documents/blockchain/ZeroToBlockchain/Chapter03/controller/restapi/features/composer/creds
PEER_SOURCE is: /Users/majeefah/.composer/client-data/PeerAdmin@hlfv1/*
HFC_KEY_STORE is: /Users/majeefah/.hfc-key-store
cp: /Users/majeefah/Documents/blockchain/ZeroToBlockchain/Chapter03/controller/restapi/features/composer/creds/ca.pem: No such file or directory
cp: /Users/majeefah/.composer/client-data/PeerAdmin@hlfv1/*: No such file or directory
cp: directory /Users/majeefah/Documents/blockchain/ZeroToBlockchain/Chapter03/controller/restapi/features/composer/creds does not exist
=====================================================
-----> Listing current cards
=====================================================

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "card" is not defined.

   =====================================================
   -----> start up complete
   =====================================================
   =====================================================
   -----> deploying network
   =====================================================
   =====================================================
   -----> option passed for network name is: 'zerotoblockchain-network'
   =====================================================

   network deploy script for the Zero To Blockchain Series
   This has been successfully tested on OSX Sierra and Ubuntu 16.04
   This script will create your Composer archive

Parameters:
Network Name is: zerotoblockchain-network
=====================================================
-----> deploying network
=====================================================
=====================================================
-----> installing PeerAdmin card
=====================================================

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "runtime" is not defined.

   =====================================================
   -----> starting network
   =====================================================

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "network" is not defined.

   =====================================================
   -----> importing networkadmin card
   =====================================================

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "card" is not defined.

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "card" is not defined.

   =====================================================
   -----> pinging admin@zerotoblockchain-network card
   =====================================================

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "network" is not defined.

   =====================================================
   -----> starting REST server
   =====================================================

   network archive, start and deploy script for the Zero To Blockchain Series
   This has been tested on Mac OSX thru High Sierra and Ubuntu V16 LTS
   This script will create your Composer archive

Parameters:
Network Name is: zerotoblockchain-network
=====================================================
-----> testing rest server
when this completes,
go to your favorite browser
and enter localhost:3000/explorer
=====================================================
=====================================================
-----> starting rest server v0.16 for admin@zerotoblockchain-network
=====================================================
./start_rest_server.sh: line 86: composer-rest-server: command not found

buildAndDeploy error

Hi Bob,
In Chapter 3, on executing ./buildAndDeply i get the following error:
./deployNetwork.sh: line 80: composer: command not found

I am running MacOS. Any clue?

Chapter 04 - Composer error

Bill, when i import the network in Composer and click "Connect now" i get the following error in the browser:

An error occurred
t: Participant 'org.hyperledger.composer.system.NetworkAdmin#admin' does not have 'READ' access to resource 'org.hyperledger.composer.system.Network#[email protected]'

The permissions.acl was unchanged:

/**

  • Access control rules for mynetwork
    /
    rule Default {
    description: "Allow all participants access to all resources"
    participant: "ANY"
    operation: ALL
    resource: "org.acme.Z2BTestNetwork.
    "
    action: ALLOW

Any clue what might be causing this?

OSX Error Failed at the [email protected] prepublish script

Hi Bob,

I follow your instruction n Chapter 3 in OSX:

npm install

It show error:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepublish: mkdirp ./network/dist && composer archive create --sourceType dir --sourceName . -a ./network/dist/zerotoblockchain-network.bna
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script.

When I checked , there is no zerotoblockchain-network.bna file created in

...//network/dist/

Please advice.

Thx,

Trung

Chap 05 - node index command error

Hello,
I am learning about Hyperledger technology through the ZeroToBlockchain online course.
By following the demo video, from the Chapter05 after running "./buildAndDeploy" command which has run successfully. However I got an error message after running "node index" from the terminal to start the node.js server. Could you help me to fix this issue ?
Please find in the attached file the error message mentioned earlier.

image

Chapter 6 : Buyer Experience Issue : Export of cards

For Chapter 6, The pre-populate list works fine, except for loading the orders. I presume this has to do with exporting the cards. If anyone who encountered this issue and has a solution, please let me know.

getMyOrders req.body.userID is: [email protected]
businessNetwork connect failed { Error: Card not found: [email protected]
at store.get.then.catch /home/ramesh/software/blockchain/ZeroToBC/Chapter06/node_modules/composer-common/lib/cardstore/walletbackedcardstore.js:74:27)
at
cause:
{ Error: ENOENT: no such file or directory, stat '/home/ramesh/.composer/cards/[email protected]'
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/ramesh/.composer/cards/[email protected]' } }

npm install error

Hi Bob, any thoughts why I'm getting this error:
image

Tried to unistal npm and install again and not working

File name has wrong extension in Chapter 6 code

The chapter 6 code fails when you try to click on the "get order status" button. This line of code:

let newFile = path.join(path.dirname(require.main.filename),'startup','memberList.txt');

references a file name of memberList.txt but the actual file name is memberList.json, so that line fails. I'm not sure if the answer is to just change the extension, but that did seem to fix the failure. However On line 95:

let newFile = path.join(path.dirname(require.main.filename),'startup','itemList.txt');

there is a reference to a file called itemList.txt that is not present in the startup directory.

Also, there is a reference to memberList.txt in the autoload.js script. I changed the extension, but now I get an identity error when connecting to the business network when I click the Get Order Status button for the user [email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.