Reputation: 2963
I am developing a chaincode (for Hyperledger Febric version 1.0) and testing it using the dev mode: http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html#testing-using-dev-mode
Currently, every time I make a change I bring down the network and start over. Is there a faster way of testing chaincode during development?
Upvotes: 0
Views: 142
Reputation: 4037
While you'd eventually need to do garbage collection (e.g. tear down the network and start from scratch), you could simply give the chaincode a different name between iterations of your chaincode development.
e.g. for each iteration of your chaincode, change the CORE_CHAINCODE_ID_NAME
and reference that name with the -n
argument to the install
, instantiate
, invoke
or query
commands.
CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc:0 ./sacc
becomes
CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc2:0 ./sacc
then
CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc3:0 ./sacc
and then be sure to use the corresponding name (mycc, mycc2 and mycc3) in the install, instantiate and invoke, etc commands. The peer will treat each as a new chaincode.
Upvotes: 2