无法导入商务网卡

时间:2018-05-21 15:07:00

标签: hyperledger-fabric hyperledger-composer

当我尝试使用“composer card import -f PeerAdmin@byfn-network-org1-only.card”命令导入商业网卡时,它显示以下错误消息。

无法导入商务网卡 关键字:必填 数据路径:
schemaPath:#/ required PARAMS:   missingProperty:x-type 消息:应该有必需的属性'x-type' 关键字:必填 数据路径:
schemaPath:#/ required PARAMS:   missingProperty:客户端 消息:应该有必要的属性'客户' 关键字:必填 数据路径:
schemaPath:#/ required PARAMS:   missingProperty:certificateAuthorities 消息:应该有必需的属性'certificateAuthorities' 关键字:必填 数据路径:
schemaPath:#/ required PARAMS:   missingProperty:频道 消息:应该有必要的属性'渠道' 关键字:类型 dataPath:.orderers schemaPath:#/ type PARAMS:   类型:对象 消息:应该是对象 关键字:类型 dataPath:.peers schemaPath:#/ type PARAMS:   类型:对象 消息:应该是对象 错误:卡中的连接配置文件中发现错误 命令失败

我的FABRIC_VERSION设置如下 FABRIC_VERSION = hlfv11

作曲家版本是v0.19.5

connection.json的内容如下所示。

{
"name": "byfn-network-org1-only",
"type": "hlfv11",
"mspID": "Org1MSP",
"peers": [
    {
        "requestURL": "grpcs://localhost:7051",
        "eventURL": "grpcs://localhost:7053",
        "cert": "/home/koosh/fabric-tools/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt",
        "hostnameOverride": "peer0.org1.example.com"
    },
    {
        "requestURL": "grpcs://localhost:8051",
        "eventURL": "grpcs://localhost:8053",
        "cert": "/home/koosh/fabric-tools/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt",
        "hostnameOverride": "peer1.org1.example.com"
    }
],
"ca": {
    "url": "https://localhost:7054",
    "name": "ca-org1",
    "cert": "/home/koosh/fabric-tools/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt",
    "hostnameOverride": "ca.org1.example.com"
},
"orderers": [
    {
        "url" : "grpcs://localhost:7050",
        "cert": "/home/koosh/fabric-tools/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt",
        "hostnameOverride": "orderer.example.com"
    }
],
"channel": "mychannel",
"timeout": 300

}

这里有什么问题?
根据此连接文件格式,我应该更改哪些支持卡?如果我将连接格式更改为旧版本,它将起作用。但是我如何使用相同的格式?

2 个答案:

答案 0 :(得分:1)

您必须写"x-type": "hlfv11"而不是"type": "hlfv11"

答案 1 :(得分:0)

此处显示的连接配置文件的格式为Composer 0.16.x格式(由于没有hlfv11支持的类型,因此也略有不正确。

在尝试使用较新版本的Composer时,您需要以新格式定义连接配置文件。可以在此处找到对该格式的引用

https://hyperledger.github.io/composer/latest/reference/connectionprofile

Composer教程还提供了有关连接配置文件的更多信息

https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-single-org https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-multi-org

相关问题