我正在尝试将超级账本结构样本网络与我自己的链码一起使用。 我正在使用balance-transfer,但是我的链码需要collections配置文件,因为它正在使用私有数据。我已添加到sendInstantiateProposal请求,但在实例化链码时一直收到错误;
{"success":false,"message":"Failed to instantiate the chaincode. cause:instantiate proposal resulted in an error :: Error: as V1_2 or later capability is not enabled, private channel collections and data are not available"}
我在artifacts / channel / configtx.yaml文件中添加了功能部分,但错误仍然继续。您可以从this link.
看到该文件那么,我该如何解决该错误并使该网络与专用渠道一起使用?
答案 0 :(得分:0)
如果未使用V1.2或更高版本的功能启用应用程序和通道,则会发生此错误。
解决方案:
在configtx.yaml文件中添加功能
rebase
然后将其应用到“个人资料”部分
Capabilities:
# Channel capabilities apply to both the orderers and the peers and must be
# supported by both.
# Set the value of the capability to true to require it.
Channel: &ChannelCapabilities
# V1.3 for Channel is a catchall flag for behavior which has been
# determined to be desired for all orderers and peers running at the v1.3.x
# level, but which would be incompatible with orderers and peers from
# prior releases.
# Prior to enabling V1.3 channel capabilities, ensure that all
# orderers and peers on a channel are at v1.3.0 or later.
V1_3: true
# Orderer capabilities apply only to the orderers, and may be safely
# used with prior release peers.
# Set the value of the capability to true to require it.
Orderer: &OrdererCapabilities
# V1.1 for Orderer is a catchall flag for behavior which has been
# determined to be desired for all orderers running at the v1.1.x
# level, but which would be incompatible with orderers from prior releases.
# Prior to enabling V1.1 orderer capabilities, ensure that all
# orderers on a channel are at v1.1.0 or later.
V1_1: true
# Application capabilities apply only to the peer network, and may be safely
# used with prior release orderers.
# Set the value of the capability to true to require it.
Application: &ApplicationCapabilities
# V1.3 for Application enables the new non-backwards compatible
# features and fixes of fabric v1.3.
V1_3: true
V1_2: false
V1_1: false
请参阅fabric-samples/first-network configtx.yaml文件以获取更多详细信息。