Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Hyperledger结构1.2功能错误_Node.js_Hyperledger Fabric_Hyperledger_Blockchain - Fatal编程技术网

Node.js Hyperledger结构1.2功能错误

Node.js Hyperledger结构1.2功能错误,node.js,hyperledger-fabric,hyperledger,blockchain,Node.js,Hyperledger Fabric,Hyperledger,Blockchain,我正在尝试使用hyperledger结构示例网络和我自己的链码。 我正在使用,但我的链码需要集合配置文件,因为它使用的是私有数据。我添加了SendInstanceProposal请求,但在实例化链码时,我不断收到错误 {"success":false,"message":"Failed to instantiate the chaincode. cause:instantiate proposal resulted in an error :: Error: as V1_2 or later c

我正在尝试使用hyperledger结构示例网络和我自己的链码。 我正在使用,但我的链码需要集合配置文件,因为它使用的是私有数据。我添加了SendInstanceProposal请求,但在实例化链码时,我不断收到错误

{"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文件中添加了capabilities部分,但错误仍在继续。您可以从中查看该文件


那么,如何解决此错误并使此网络与专用通道一起工作?

当应用程序和通道未启用V1.2或更高版本的功能时,会发生此错误

解决方案:

在configtx.yaml文件中添加功能

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
然后在配置文件部分应用它们

ThreeOrgsOrdererGenesis:
        <<: *ChannelDefaults
        Capabilities:
            <<: *ChannelCapabilities
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                    - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *Org1
                    - *Org2
                    - *Org3

    ThreeOrgsChannel:
        Consortium: SampleConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org2
                - *Org3
            Capabilities:
                <<: *ApplicationCapabilities
ThreeOrgansorderergenesis:

可能您正在运行较旧版本的hyperledger fabric。我认为版本是正确的,因为我通过编辑runApp.sh设置了版本,并添加了
export IMAGE\u TAG=“1.2”