fablo icon indicating copy to clipboard operation
fablo copied to clipboard

Allow to run chaincodes in dev mode for rapid chaincode development

Open dzikowski opened this issue 4 years ago • 3 comments

see https://hyperledger-fabric.readthedocs.io/en/release-1.4/peer-chaincode-devmode.html

dzikowski avatar Jan 24 '21 09:01 dzikowski

Running Fablo 1.1.0 here, are there any steps to to Run chaincode in dev mode with Go chaincodes? The current README only lists the steps to run it with a Node chaincode.

lcvalves avatar Sep 12 '22 04:09 lcvalves

From the Fablo perspective, it should work the same way, you just need to provide proper chaincode language in Fablo config file. Then, you need to build and run chaincode with proper env vars - probably the command is similar to this (taken from https://hyperledger-fabric.readthedocs.io/en/latest/peer-chaincode-devmode.html#start-the-chaincode):

go build -o simpleChaincode ./integration/chaincode/simple/cmd

CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_TLS_ENABLED=false CORE_CHAINCODE_ID_NAME=mycc:1.0 ./simpleChaincode -peer.address 127.0.0.1:7052

We didn't test it for Go chaincodes, so please let us know how it works.

dzikowski avatar Sep 13 '22 08:09 dzikowski

Just ran the following commands with peerDevMode=true on fablo-config.json for my use case chaincode:

go build -o stvgd-chaincode .

export CORE_CHAINCODE_LOGLEVEL=debug
export CORE_PEER_TLS_ENABLED=false
export CORE_CHAINCODE_ID_NAME=stvgd-chaincode:12

./stvgd-chaincode -peer.address 127.0.0.1:7041 # peers with the default fablo-config are running on ports 7041 (peer0) and 7042 (peer1)

Got the output log below:

panic: Failed to start chaincode. receive failed: rpc error: code = Unimplemented desc = unknown service protos.ChaincodeSupport

My guess is that this has something to do with the internal Fabric Go packages.

lcvalves avatar Sep 14 '22 22:09 lcvalves