microfab
microfab copied to clipboard
As a developer, I want to debug my chaincode
Hello,
I was trying to debug my chaincode but I'm no able to do it with the default VSCode configuration and latest plugin extension (2.0.0):
"version": "0.2.0", "configurations": [ { "type": "fabric:node", "request": "launch", "name": "Debug Smart Contract", "preLaunchTask": "tsc: build - tsconfig.json", "outFiles": [ "${workspaceFolder}/dist/**/*.js" ] } ] }
peer complains with following message:
[ org1peer] 2021-01-25 08:02:05.741 UTC [chaincode] notifyRegistry -> ERRO 17d failed to start bkchain-contract:0.0.4 -- peer will not accept external chaincode connection bkchain-contract:0.0.4 (except in dev mode)
How do I configure the blockchain in dev mode?
Thanks
Probably would have been better to raise the issue here https://github.com/IBM-Blockchain/blockchain-vscode-extension, but the problem is partly a fabric one. fabric 2.2 doesn't support dev mode (which it did in V1) and that is how vscode would set up a debug environment. So currently it's not possible to debug.
I don't understand why you've said that fabric does not support dev mode. In this link someone is doing it https://www.programmersought.com/article/57265367123/ and I've changed by myself microfab to allow dev-mode and it works ...
Could you explain why Fabric 2.2 does not support dev mode @davidkel?
Thanks
Debug mode is one of the biggest problems of Microfab and IBM blockchain VSC plugins. But why they are not solving this is interesting.
I have been waiting for this functionality in the VS Code extension for more than a year and there is no news. It seems that the IBM team has no interest in supporting debugging. Don't expect this feature to come here or in the extension, unfortunately.