How to enable private data in fabric v1.3.0

Viewed 642

I am using fabric 1.3.0 in docker environment. I am getting error while trying to instantiate the chaincode with --collections-config. The setup is working fine if I remove the --collections-config

While executing :

peer chaincode instantiate -C org12 -n tranargy -v 1.0 -c '{"Args":[]}' -P "OR('Org1MSP.member','Org2MSP.member')" --collections-config /opt/gopath/src/tranargy/collections/collections_config.json

Getting following error :

Error: could not assemble transaction, err Proposal response was not
successful, error code 500, msg as V1_2 or later capability is not
enabled, private channel collections and data are not available

Can any one help in how to enable private data in fabric v1.3.0.

2 Answers

You must enable the V1_3 capability when creating the channel configuration transaction. See the required configuration in the sample. This is required so that all peers on a channel behave consistently, even if a rolling upgrade is in progress for the peers in the channel.

Problem is you are not using fabric 1.3.0 docker image Even though it is present in your local, when you do compose up at that time it will download a new image of different version

Make sure

hyperledger/fabric-peer        1.2.0               82c262e65984        3 months ago        159MB

compose file service image: hyperledger/fabric-ca-peer:1.2.0

Both versions are same here i used 1.2.0 In your case 1.3.0

Make Sure:
Application: &ApplicationCapabilities
V1_3: true

See configtx.yaml

Related