Re: Chaincode commit not going through 2.0.0


Nicholas Leonardi
 

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. 


Hi Nick,
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,
Chris 



On Sep 6, 2020, at 8:59 AM, Nicholas Leonardi via lists.hyperledger.org <nlzanutim=yahoo.com@...> wrote:


Hey guys,

I have two organizations on two different machines, each org has 1 peer. I'm able to add both peers to the channel, bring in a fourth orderer for org 2. Everything works except when I try to commit the chaincode for the org2. I generate the package from org 1 (chaincode installed and committed) and send it to org2. I can install it on peer2 and approve for org with a new sequence. I also approve for org1 with the new sequence but when I try to commit, I get an endorsement failure policy.

Version 2.0.0 

I found this but to no avail the chaincode gets committed by either orgs. 

The commit readiness is true for both when I check that.

Anyone have any other ideas besides from that topic?

Thanks in advance.
Nick


Join fabric@lists.hyperledger.org to automatically receive all group messages.