IBM Blockchain Platform - Unable to invoke transactions

622 views Asked by At

I am working through the IBM tutorials to better understand blockchain technically. I got stuck on Step A4.6: Click 'myAssetExists' to open the Transaction View. For some reason when I connected to the Fabric Gateway in VS Code it did not bring in the drop down menu for '[email protected]' under the Fabric Gateway section.

Here is what it looks like in my VS Code. IBM tutorials show that it should say MyAssetExists, CreateMyAsset, etc.

Then I am receiving an error that says it could not get the metadata for smart contract demo contract... the warning/error looks like this:

[5/3/2021 2:29:19 PM] [WARNING] Could not get metadata for smart contract demo-contract. The smart contract may not have been developed with the programming model delivered in Hyperledger Fabric v1.4+ for Java, JavaScript and TypeScript. Error: Transaction function "org.hyperledger.fabric:GetMetadata" returned an error: Query failed. Errors: ["Peer org1peer-api.127-0-0-1.nip.io:8080: error in simulation: failed to execute transaction c387520943329acbfcb67d1639b63467791006d9e6464deaa491426b3d940337: could not launch chaincode demo-contract_0.0.1:6da187e384f13aa34360d36f2c645a793b7d811c32d4ae7b483d8519f312fa87: chaincode registration failed: failed to wait on container exit: builder 'node' run failed: exit status 1"]

I'm still a beginner in VS code and coding in general. So I'm not sure exactly what the error message means.

2

There are 2 answers

2
Gabriel BPS-CR On

I had the same error, after many hours trying different things I realize that in the OUTPUT window, after deploying the smart contract a message like "smart contract PARTIALLY deployed - not commit" was displayed. So I decided to change the value in Step A2.5 (Tutorial A2) that indicates "Click 'TypeScript'", I selected 'JavaScript' then I got the following OUTPUT messages:

[5/5/2021 22:52:32] [SUCCESS] Successfully approved smart contract definition [5/5/2021 22:52:32] [INFO] commitSmartContract [5/5/2021 22:52:34] [SUCCESS] Successfully committed smart contract definition [5/5/2021 22:52:34] [SUCCESS] Successfully deployed smart contract

Now the transactions appear in the tree.

1
Bhagwat Kshirsagar On

I tried with javascript and it worked, then I found another solution for typescript :

npm install -g typescript 

Now, transactions are shown with smart contract using typescript option.