HyperledgerHandsOn / trade-contracts

Hyperledger Hands-On second edition - Smart Contracts of the Trade Network
Apache License 2.0
7 stars 36 forks source link

Deploying a contract in the testing environment - functions not showing up and unable to continue #6

Open AndreiRinea opened 3 years ago

AndreiRinea commented 3 years ago

Hi, I am a buyer of the book (2nd edition) and I'm doing the tutorial in the book. I am at "Deploying a contract in the testing environment" and I'm stuck at point 5.

Here's my environment:

OS: Ubuntu 20.04.2 LTS ("focal") - running in VirtualBox on a Mac OS X Big Sur VS Code: 1.58.2 Node: 10.19.0 NPM: 6.14.4 TypeScript: 4.3.5 IBP Extension: 2.0.4 (also tried 2.0.2, 2.0.0 and 1.0.40)

Here's my steps before I get stuck:

a. I cloned this repository and I open in VS Code the v1/trade folder. The book does not specify v1 but after packaging the contract screenshots and text specify "trade@1.0.0" while the v2/trade folder would generate a "trade@2.0.0". b. I "disable the access control mechanism" by commenting out the contents of the beforeTransaction function in trade-contract.ts as shown in the book. c. Next I connect to "1 Org Local Fabric" environment which I created from a template early in the book. d. Although not in the book I do an "npm install" in a terminal window in the v1/trade directory - else the next step fails - this might need to be added in the book e. In IBP extension, in the Smart Contracts section/"window" I "choose" command Package Open Project. This succeeds. After some log entries I get a "trade@1.0.0" item in this "window". f. Now I reach section "Deploying a contract in a testing environment". I select "Deploy smart contract" in Fabric Environments under "mychannel". A wizard appears and I'm on step 1. g. From the "Choose a smart contract to deploy" I select "trade@1.0.0" and click next just as the book says. h. In the second step I have Definition name prefilled to "trade" and Definition version prefilled to "1.0.0" and I leave "Endorsement policy" as the book says. I click next. i. In step 3 I only review previous steps' values and click deploy. I get a lot of log output (you can inspect at https://blog.andrei.rinea.ro/hlf01.txt). The screen looks like this:

image

j. In "Fabric Gateways" I click on "Org1 Gateway" as the book implies. k. Although the book specifies that I should be asked for an identity, the VS Code IBP extension assumes "Org1 Admin" and populates the tree this way:

image

I expand "mychannel":

image

Finally I expand "trade@1.0.0" node, or so I thought, but nothing appears underneath it:

image

Here's the log generated precisely when I tried to expand the "trade@1.0.0" node: https://blog.andrei.rinea.ro/hlf02.txt

At this point I'm stuck and cannot continue as I don't get to the functions to be able to invoke them. I retried this using several versions of the IBP extension (2.0.4, 2.0.2, 2.0.0 and 1.0.40) with the same results. I even tried the v2/trade folder with the same results. What can be done?

Thanks, Andrei Rinea.

AndreiRinea commented 3 years ago

Anyone else encountered this?

florencioq commented 1 year ago

Same problem here.