Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit test hyperledger fabric chaincode

I am new to hyper-ledger fabric, after writing chaincode I don’t like to deploy and test every time. Is there any way to test the chaincode logic without deploying..

like image 211
Max_dev Avatar asked Feb 17 '26 15:02

Max_dev


1 Answers

To test the chaincode, in the directory containing the chaincode simply do

go test

See chaincode_example02_test.go for an example of how to write tests for chaincode.

like image 67
Clyde D'Cruz Avatar answered Feb 20 '26 23:02

Clyde D'Cruz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!