Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With multiple organization queryAllCars works fine with org1 but not with org2 #5036

Open
ketulpatel1411 opened this issue Oct 18, 2024 · 1 comment
Labels

Comments

@ketulpatel1411
Copy link

Description

I have two organization (Org1 and Org2 ) each Org has two peers(peer0 and peer1) , I have installed two chaincodes on it. one of them is fabcar which is in fabric sample. I am using fabric-gateway-java of version 2.1.1 with mvn dependency . if i am registering with org1 then createCar and queryAllCars is working fine. but when i am registering different user with org2 then createCar is working find but queryAllCars is giving following error in my spring boot application
org.hyperledger.fabric.gateway.ContractException: make sure the chaincode fabcar has been successfully defined on channel mychannel and try again: chaincode definition for 'fabcar' exists, but chaincode is not installed

i have check installed chaincode using peer commad.
my configtx.yaml file's organization section is

  • &Org1

    DefaultOrg defines the organization which is used in the sampleconfig

    of the fabric.git development environment

    Name: Org1MSP

    ID to load the MSP definition as

    ID: Org1MSP

    MSPDir: ../../../crypto-config/peerOrganizations/org1.example.com/msp

    Policies defines the set of policies at this level of the config tree

    For organization policies, their canonical path is usually

    /Channel/<Application|Orderer>//

    Policies:
    Readers:
    Type: Signature
    Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
    Writers:
    Type: Signature
    Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
    Admins:
    Type: Signature
    Rule: "OR('Org1MSP.admin')"
    Endorsement:
    Type: Signature
    Rule: "OR('Org1MSP.peer')"

    leave this flag set to true.

    AnchorPeers:

    AnchorPeers defines the location of peers which can be used

    for cross org gossip communication. Note, this value is only

    encoded in the genesis block in the Application section context

    • Host: peer0.org1.example.com
      Port: 7051
  • &Org2

    DefaultOrg defines the organization which is used in the sampleconfig

    of the fabric.git development environment

    Name: Org2MSP

    ID to load the MSP definition as

    ID: Org2MSP

    MSPDir: ../../../crypto-config/peerOrganizations/org2.example.com/msp

    Policies defines the set of policies at this level of the config tree

    For organization policies, their canonical path is usually

    /Channel/<Application|Orderer>//

    Policies:
    Readers:
    Type: Signature
    Rule: "OR('Org2MSP.admin', 'Org2MSP.peer', 'Org2MSP.client')"
    Writers:
    Type: Signature
    Rule: "OR('Org2MSP.admin', 'Org2MSP.client')"
    Admins:
    Type: Signature
    Rule: "OR('Org2MSP.admin')"
    Endorsement:
    Type: Signature
    Rule: "OR('Org2MSP.peer')"

what is problem i am not getting .
can any one help me to get out of this? it would be grate help for me . thanks in advance

Steps to reproduce

No response

@satoshimum
Copy link

check if anchoring peers are working correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants