Error: chaincode not found! #fabric-chaincode #hyperledger-fabric


bcekici119@...
 

Hi all,

I have been tried to develop custom network and I faced with an issue when I instantiated the chaincode. I use the chaincode that explained in here (https://hyperledger-fabric.readthedocs.io/en/release-2.0/chaincode4ade.html)
I installed chaincode by executed the command below (I saw response:<status:200 payload:"OK> message) and check it whether it was installed

CORE_PEER_ADDRESS=peer0.be.be-network.com:7051 peer chaincode install -n sacc -p chain/mediumchaincode -v 1.0
peer chaincode list --installed


Then I tried to instantiated  it with the command below.(Actually, "a" looks like a function and the error, which "a" function not exist in SmarContract, is occured so I changed it as '{"Args":[""]}')

peer chaincode instantiate -o orderer.be-network.com:7050 -C channeldemo -n sacc -v 1.0 -l golang -c '{"Args":["a", "100"]}' -P "OR('BurakcanEkiciMSP.peer', 'BeyondMSP.peer')" --tls true --cafile $ORDERER_CA

After this, it seems eveything was ok and no error was occured. But I couldn't see it when I executed the command below

peer chaincode -C channeldemo list --instantiated

 
That's why, when I queried like below, I faced the response that was - Error: endorsement failure during query. response: status 500 message:" make sure the chaincode sacc has been successfully defined on channel channeldemo and try again: chaincode sacc not found" -  

peer chaincode query -C channeldemo -n sacc -c '{"Args":["get","a"]}'

Have a nice day.


Kamlesh Nagware
 

Hi ,
It seems you using old chaincode lifecycle in 2.0 release.Can you please try new chaincode lifecycle and see if it works.If it works then you have to look lifecycle endorsement policy configuration in configtx file, this policy settings determined how many peer should approve the chaincode before it being used by any peer in channel.

Thanks
Kamlesh


Nidhi Singh
 

Hello,

Even with v2.0 it is possible to use the prior chaincode lifecycle process.
You would need to make changes in configtx.yaml file for capabilities to be of the previous version instead of v2.0.

Please try with these settings.

Thanks,
Nidhi


On Thu, Apr 23, 2020, 8:59 AM Kamlesh Nagware <kamlesh.nagware@...> wrote:
Hi ,
It seems you using old chaincode lifecycle in 2.0 release.Can you please try new chaincode lifecycle and see if it works.If it works then you have to look lifecycle endorsement policy configuration in configtx file, this policy settings determined how many peer should approve the chaincode before it being used by any peer in channel.

Thanks
Kamlesh


bcekici119@...
 

Hi Kamlesh

I have done what you said and this moment I faced"Error:timed out waiting for txid on all peers" error when I executed "peer lifecycle chaincode approveformyorg" command.
Do you know how to fix it?
Thanks