hyperledger / fabric-samples

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

peer chaincode list not showing the installed chaincode #538

Closed suibinz closed 2 years ago

suibinz commented 2 years ago

using: 1) ./network.sh up 2) ./network.sh createChannel 3) ./network.sh deployCC ....

Chaincode is working properly by invoking functions ( addasset, query, etc.). But chaincode list return empty peer chaincode list --instantiated -C mychannel Get instantiated chaincodes on channel mychannel:

suibinz commented 2 years ago

Maybe I am not fully understand "Peer chaincode"(this returns null) vs. "peer lifecycle chaincode"(this can find the chaincode)

timo-kang commented 2 years ago

listing chaincode is not related with peer lifecycle command.

here is an example for listing chaincodes. before executing peer command, check again your environment variables. https://hyperledger-fabric.readthedocs.io/en/latest/commands/peerchaincode.html#peer-chaincode-list-example

suibinz commented 2 years ago

If I interpret the command reference doc correctly, "peer chaincode" is for ver 1.x, while "peer lifecycle chaincode" is for v 2.x. Since I am running v2.3, I assume that is why I should use "peer lifecycle chaincode" - which works as expected.

timo-kang commented 2 years ago

you can test easily if you use a cli container.