hyperledger-labs / fablo

Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.
Apache License 2.0
194 stars 72 forks source link

Allow to run chaincodes in dev mode for rapid chaincode development #126

Open dzikowski opened 3 years ago

dzikowski commented 3 years ago

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

lcvalves commented 2 years ago

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.

dzikowski commented 2 years ago

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.

lcvalves commented 2 years ago

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.