Reputation: 181
I got problems during my invoke.
1.) I rund following command:
peer lifecycle chaincode querycommitted \
--channelID mychannel \
--name basic \
--cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
--> till here everything worked well.
Than I wanted to invoke the chaincode:
peer chaincode invoke \
-o localhost:7050 \
--ordererTLSHostnameOverride orderer.example.com \
--tls \
--cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem \
-C mychannel \
-n basic \
--peerAddresses localhost:7051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt \
--peerAddresses localhost:9051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt \
-c '{"function":"InitLedger","Args":[]}'
Afterwards I got the Error:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 93.....: could not launch chaincode basic_1.0:465......: chaincode registration failed: container exited with 1"
I tried the whole process serveral times, to make sure, that I do not have any mistakes before.
I also checked the dockers by docker ps
, all are normal.
So I have no glue, what the source for the error could be.I will be happy about every help! Thank you!!!
Upvotes: 2
Views: 1187
Reputation: 2576
Initially after committing the chaincode, init must be performed first. To execute init, you just need to specify --isInit
in the invoke parameter option. See the documentation below.
fabric/peer/chaincode
peer chaincode invoke \
-o localhost:7050 \
--ordererTLSHostnameOverride orderer.example.com \
--tls \
--cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem \
-C mychannel \
-n basic \
--isInit \
--peerAddresses localhost:7051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt \
--peerAddresses localhost:9051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt \
-c '{"function":"InitLedger","Args":[]}'
Upvotes: 2