hyperledger / fabric-samples

Samples for Hyperledger Fabric
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
2.78k stars 3.38k forks source link

chaincode-docker-devmode is missing when I pull at my local machine #695

Open mshafiqtahir opened 2 years ago

mshafiqtahir commented 2 years ago

I'm unable to test my chaincode at devmode network because "chaincode-docker-devmode" directory is missing at our end and we have tested into different machines. Kindly explain the reasons.

mbwhite commented 2 years ago

Hello @mshafiqtahir The Fabric v1.4 devmode wasn't available in at Fabric v2.0; honestly I'm not sure exactly why it wasn't there, but related to the new lifecycle I think.

It was re-introduced in 2.4, I think and is there if you wish to use it - an example is https://hyperledgendary.github.io/docs/tutorials/hyperfast_contract_development.html

What we could currently suggest is that the 'chaincode-as-a-service' (CCAAS) is the alternative, and going forward I would expect to be our preferred solution. With this approach the chaincode can be launched either via your IDE or separately and then attached to via a debugger. Or just started and stopped, rebuilt and restarted as you wish.

The advantage of this approach is that CCAAS doesn't require the peer to be in a different mode, you can potentially debug whilst the chaincode is running in a docker image - or anywhere you can connect to it via a network connection.

DevMode also restricts some of the features eg TLS, whereas CCAAS doesn't.

We do recognise that CCAAS has it's own challenges to start, and we're working to simplify this. There's more information at https://github.com/hyperledger/fabric-samples/blob/main/test-network/CHAINCODE_AS_A_SERVICE_TUTORIAL.md

And also a work-in-progress at https://github.com/hyperledgendary/fabric-contract-debug-scenario

Hope this helps!