From 6c074d036158bf16e6c4431fe24c29efd727e1ac Mon Sep 17 00:00:00 2001 From: Ferry Ariawan Date: Mon, 10 Jun 2024 20:07:49 +0700 Subject: [PATCH] Change Endorsement Policy in configtx.yaml to use NoutOf rule, so any 2 of the organizations can approve chaincode lifecycle --- varion/configtx/configtx.yaml | 14 ++++++++++---- varion/scripts/deployCC.sh | 19 +++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/varion/configtx/configtx.yaml b/varion/configtx/configtx.yaml index 208ea96a..484c9f2e 100644 --- a/varion/configtx/configtx.yaml +++ b/varion/configtx/configtx.yaml @@ -207,11 +207,17 @@ Application: &ApplicationDefaults Type: ImplicitMeta Rule: "MAJORITY Admins" LifecycleEndorsement: - Type: ImplicitMeta - Rule: "MAJORITY Endorsement" +# Type: ImplicitMeta +# Rule: "MAJORITY Endorsement" + Type: Signature + Rule: "OutOf(2, 'FarmerMSP.peer', 'PulperMSP.peer', 'HullerMSP.peer', 'ExportMSP.peer')" +# Rule: "OR('FarmerMSP.peer', 'PulperMSP.peer', 'HullerMSP.peer', 'ExportMSP.peer')" Endorsement: - Type: ImplicitMeta - Rule: "MAJORITY Endorsement" +# Type: ImplicitMeta +# Rule: "MAJORITY Endorsement" + Type: Signature + Rule: "OutOf(2, 'FarmerMSP.peer', 'PulperMSP.peer', 'HullerMSP.peer', 'ExportMSP.peer')" +# Rule: "OR('FarmerMSP.peer', 'PulperMSP.peer', 'HullerMSP.peer', 'ExportMSP.peer')" Capabilities: <<: *ApplicationCapabilities ################################################################################ diff --git a/varion/scripts/deployCC.sh b/varion/scripts/deployCC.sh index 52d977c8..64dc6dd7 100755 --- a/varion/scripts/deployCC.sh +++ b/varion/scripts/deployCC.sh @@ -78,10 +78,10 @@ infoln "Install chaincode on peer0.farmer..." installChaincode farmer infoln "Install chaincode on peer0.pulper..." installChaincode pulper -infoln "Install chaincode on peer0.huller..." -installChaincode huller -infoln "Install chaincode on peer0.export..." -installChaincode export +#infoln "Install chaincode on peer0.huller..." +#installChaincode huller +#infoln "Install chaincode on peer0.export..." +#installChaincode export resolveSequence @@ -104,22 +104,21 @@ approveForMyOrg pulper checkCommitReadiness farmer "\"FarmerMSP\": true" "\"PulperMSP\": true" checkCommitReadiness pulper "\"FarmerMSP\": true" "\"PulperMSP\": true" -approveForMyOrg huller -approveForMyOrg export - +#approveForMyOrg huller +#approveForMyOrg export ## now that we know for sure both orgs have approved, commit the definition -commitChaincodeDefinition farmer pulper huller export +commitChaincodeDefinition farmer pulper #huller #export ## query on both orgs to see that the definition committed successfully -queryCommitted farmer pulper huller export +queryCommitted farmer pulper #huller #export ## Invoke the chaincode - this does require that the chaincode have the 'initLedger' ## method defined if [ "$CC_INIT_FCN" = "NA" ]; then infoln "Chaincode initialization is not required" else - chaincodeInvokeInit farmer pulper huller export + chaincodeInvokeInit farmer pulper #huller #export fi exit 0