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

Installing the same chaincode on two channels #346

Open
rrozek opened this issue Aug 16, 2022 · 3 comments
Open

Installing the same chaincode on two channels #346

rrozek opened this issue Aug 16, 2022 · 3 comments
Labels

Comments

@rrozek
Copy link

rrozek commented Aug 16, 2022

Hi, tremendous progress in fablo 1.1.0!
However i noticed, that I cannot install the same chaincode on two separate channels.
My config is for 2 orgs, 2 peer per org, 1 channel per org and i want to install the same chaincode on both channels. It fails on:

Generating network config
    FABLO_VERSION:      1.1.0
    FABLO_CONFIG:       custom-config-2org-2peer-1channel-per-org.json
    FABLO_NETWORK_ROOT: /home/jrojek/dvnt/repo/open-pay-api/configs/fablo/fablo-target
Validation errors count: 1
Validation warnings count: 0
===========================================================
=================== Validation summary ====================
Errors found:
  Chaincode:
   - Chaincode name 'chaincode-test' is not unique.
===========================================================

config i tried:

{
  "$schema": "https://github.com/hyperledger-labs/fablo/releases/download/1.1.0/schema.json",
  "global": {
    "fabricVersion": "2.4.3",
    "tls": true
  },
  "orgs": [
    {
      "organization": {
        "name": "Orderer",
        "mspName": "OrdererMSP",
        "domain": "root.com"
      },
      "ca":  {
        "prefix": "ca"
      },
      "orderers": [
        {
          "groupName": "group1",
          "type": "raft",
          "instances": 3
        }
      ],
    },
    {
      "organization": {
        "name": "Org1",
        "mspName": "Org1MSP",
        "domain": "org1.com"
      },
      "ca":  {
        "prefix": "ca"
      },
      "peer": {
        "instances": 2,
        "anchorPeerInstances": 2,
        "db": "CouchDb"
      },
      "tools": {
        "fabloRest": true
      }
    },
    {
      "organization": {
        "name": "Org2",
        "mspName": "Org2MSP",
        "domain": "org2.com"
      },
      "ca":  {
        "prefix": "ca"
      },
      "peer": {
        "instances": 2,
        "anchorPeerInstances": 2,
        "db": "CouchDb"
      },
      "tools": {
        "fabloRest": true
      }
    }
  ],
  "channels": [
    {
      "name": "channel1-org1",
      "orgs": [
        {
          "name": "Org1",
          "peers": [
            "peer0",
            "peer1"
          ]
        }
      ]
    },
    {
      "name": "channel1-org2",
      "orgs": [
        {
          "name": "Org2",
          "peers": [
            "peer0",
            "peer1"
          ]
        }
      ]
    }
  ],
  "chaincodes": [
    {
      "name": "chaincode-test",
      "version": "1.0.0",
      "lang": "node",
      "channel": "channel1-org1",
      "directory": "./chaincodes/chaincode-test"
    },
    {
      "name": "chaincode-test",
      "version": "1.0.0",
      "lang": "node",
      "channel": "channel1-org2",
      "directory": "./chaincodes/chaincode-test"
    }
  ]
}

i can workaround it by setting different name but the same source directory, however it would be convinient if it could go under the same name.

  "chaincodes": [
    {
      "name": "chaincode-test-channel1-org1",
      "version": "1.0.0",
      "lang": "node",
      "channel": "channel1-org1",
      "directory": "./chaincodes/chaincode-test"
    },
    {
      "name": "chaincode-test-channel1-org2",
      "version": "1.0.0",
      "lang": "node",
      "channel": "channel1-org2",
      "directory": "./chaincodes/chaincode-test"
    }
  ]
@Hejwo
Copy link
Contributor

Hejwo commented Aug 17, 2022

Hey @rrozek thanks for kind words :)
About the issue - yes, it's a known problem reported here.
We'll try to fix it soon, so I'm leaving the issue opened and will let you know when it happens :)

@rrozek
Copy link
Author

rrozek commented Aug 17, 2022

huh. was looking in open issues and didn't find it -_-' sorry for duplicate!

@dzikowski
Copy link
Contributor

probably a solution for this issue is to use in Fablo docker mounts for directories like channel-name/chaincode-name instead of just chaincode-name. It will allow to avoid duplicate mounts error

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