Re: Chaincode commit not going through 2.0.0
Brett T Logan <brett.t.logan@...>
As Dave noted in the post you linked, your majority requirement means the 'commit' must be performed by both orgs, you are only sending the commit transactions to a single orgtoggle quoted messageShow quoted text
Nicholas Leonardi via lists.hyperledger.org --- [EXTERNAL] Re: [Hyperledger Fabric] Chaincode commit not going through 2.0.0 ---
Hey Chris, thanks for the insight.
I understood and followed the process you told me but here's what's happening.
1. I have org1 deployed running on machine 1 with chaincode installed version 1.0 and sequence 1.
Chaincode invoke and query are working perfectly.
2. I deploy org2 and add orderer and peer to the channel (successfully).
3. I package the chaincode on org1 and send it to org2
peer lifecycle chaincode package chaincode.tar.gz --path /etc/hyperledger/chaincode --lang node --label ccv1
4. I installed the newly packaged chaincode on both peers (org1.peer and org2.peer) there's only 1 peer per org
Successfully installs and shows up when I queryinstalled
5. I approved on both organizations with version 1.0(didn't change) but changed the sequence to 2
--name chaincode --version 1.0 --sequence 2
6. I checked the commit readiness
peer lifecycle chaincode checkcommitreadiness --channelID channel --name chaincode --version 1.0 --sequence 2
Version: 1.0, Sequence: 2, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
7. When I tried to commit sequence 2, I get the endorsement policy failure
peer lifecycle chaincode commit -o orderer1.org1.org:7050 --channelID channel --name chaincode --version 1.0 --sequence 2
I looked over the documentation but couldn't find anything wrong.
I also tried approving org2 with version 1.0 and sequence 1. It approves but when I try to commit it gives the error that it needs to be sequence 2.
I double checked the block config and all seems well.
The peer spits out this error:
1 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied
The endorsement subpolicy is set to MAJORITY Admins and both admins do approve.
I have attached the block config json.
I don't know what to do anymore
Any futher help would be greatly appreciated.
You appeared to have committed prior to approving for both orgs. I have made this same mistake.
Do in this order (also documented in the tutorial):
1) Package chaincode
2) Install chaincode on all peers
3) Query installed to get packageID
4) Approve for org1
5) Approve for org2
6) Check commit readiness
7) Commit chaincode (You can commmit chaincode for both orgs at the same time if commit readiness check show true for both org1 and org2 by using the —peerAddresses flag)
Hope this helps,
On Sep 6, 2020, at 8:59 AM, Nicholas Leonardi via lists.hyperledger.org <nlzanutim=yahoo.com@...> wrote: