-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to see the functions of a smart contract after deploying (on VS code) #21
Comments
Hi @sravanmutya . Apologies for the delay in getting back to you. I've been busy and I had to reset my env for the book. When you say: Also, one way to ensure that your smart contract is deployed with all the required dependency is to pre-package it using:
If all goes well, the build will succeed and you'll have a If it fails, the error message should point to the missing dependencies. Your VSCode Gateway panel should then be able to see the function. |
Hello Luc, thanks for your reply. Yes I meant "npm install -g typescript". I have run it and have tsc Version 4.8.2 installed on my machine right now. I have tried running 'make all' in the 'trade/' directory and I got the following error: echo ">> Packaging chaincode"
Is it because the peer binary from 'fabric-samples' directory is unable to be located? If so, I have the binaries on my machine and also added to the PATH in my .bashrc file. |
@sravanmutya Instructions to build the |
@VRamakrishna Yes, I have followed the instructions successfully, and when I run the 'peer', I get following output as well. But 'make all' is producing the following error: PS: Could be due to the OS, since I'm running Ubuntu on WSL2. It will take a while for me to figure that out, if that's the case. :D |
@sravanmutya Is this problem resolved? (Sorry, I have been very busy this past month.) My impression was that the |
Hello @VRamakrishna no the problem hasn't been resolved. (It's okay, I understand) Yes, the peer executable was on my system path, in the PATH environment variable in Ubuntu, but it didn't solve the issue. I had been busy with other things as well, hence, I could not follow up on this one. So, from my side, it's okay, if you prefer to close the issue. |
OK, quick suggestions to check/rectify:
|
Hi, after following the suggestions in the below manner:
I see the following error - |
I think this is an issue specific to your environment. If you have |
Hello @VRamakrishna , sorry for the late reply. After running the command with sudo permissions, and then running make all, generates the following output. |
It looks like you are missing a dot at the end of the command. See https://github.com/HyperledgerHandsOn/trade-contracts/blob/master/v1/trade/Makefile#L26. Did you make any changes to the |
After fixing the dot, I get the following error while packaging chaincode. Yes, in the Make file I have added the full path to the peer binary as you mentioned in your previous suggestion here - |
You are missing the FABRIC_CFG_PATH environment variable. The instructions are covered as part of the installation of the CLI. I have mine pointing to |
Could I ask you to post the logs from your microfab container? I suspect that the smart contract is failing to start with an error code 243. If you see that in the log, I think the solution would be to downgrade your Node version from 16.17 to 16.14. |
Hello Luc, sorry for the late reply, here are my microfab container logs - [ microfabd] 2022/09/02 13:50:35 Starting Microfab ... |
@sravanmutya did you downgrade your node version to v16.14? In the logs you posted, I saw this error:
Running with v16.14. I am able to deploy the trade smart contract and I can see all functions. |
Hello I am currently in the section 'Deploying a contract in the testing environment' of Chapter 5. I was successful from steps 1-5, in step 6 to 'Submit Transaction' on the 'init' function, I am unable to see the function listed under the smart contract in VS code. I have attached the image for reference.
EDIT-1 : I have attached the [WARNING] I have received in the output in VS code.
EDIT-2 : The warning in output terminal is -
Could not get metadata for smart contract trade. 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 fc8980f9c74acc6ec164d0c51ba5e8cfed70812b22f50fe27a8d91495f6c269c: could not launch chaincode trade_1.0.0:1dfbb3c99cdc2da327a7faeff4758801b42bb46b9525201d52a1609b4b28faca: chaincode registration failed: container exited with 0"]
System configurations:
Ubuntu 20.04 on WSL 2, Windows 11 OS
Docker version: 20.10.17
Docker compose version: 2.6.1
Node version: 16.17.0
npm version: 8.15.0
Visual Studio Code version: 1.70.2
The text was updated successfully, but these errors were encountered: