【问题标题】:Error starting Business network application in Hyperledger fabric composer-- Multi host peer environment在 Hyperledger Fabric Composer 中启动业务网络应用程序时出错 - 多主机对等环境
【发布时间】:2018-08-13 19:33:57
【问题描述】:

我正在创建一个包含 5 个对等方的结构网络。

在机器 1 上运行的 2 个对等节点、CA 和排序节点, 机器 2 上的 1 个对等点和沙发实例, 机器 3 上的 1 个对等点和沙发实例, 机器 4 上的 1 个对等点和沙发实例。

他们都在同一个频道上。我能够将 .bna 安装到网络中。但是当我尝试使用 composer 工具启动应用程序时,使用以下命令

"composer network start -c PeerAdmin@hlfv1 -n blockv6 -V 0.0.1 -A admin -S adminpw"

我没有收到有效的响应错误

✖ 开始业务网络定义。这可能需要一分钟... 错误:尝试启动业务网络时出错。错误:没有来自任何对等方的有效响应。 来自尝试的对等通信的响应是一个错误:错误:2 UNKNOWN:链码错误(状态:500,消息:不是有效的背书系统链码) 来自尝试的对等通信的响应是一个错误:错误:2 UNKNOWN:链代码错误(状态:500,消息:未知链代码类型:节点) 来自尝试的对等通信的响应是一个错误:错误:2 UNKNOWN:链代码错误(状态:500,消息:未知链代码类型:节点) 命令失败

下面是我的 createPeerAdmin 脚本的连接配置文件

       {

            "name": "hlfv1",
            "x-type": "hlfv1",
            "x-commitTimeout": 300,
           "version": "1.0.0",
         "client": {
    "organization": "Org1",
    "connection": {
        "timeout": {
            "peer": {
                "endorser": "300",
                "eventHub": "300",
                "eventReg": "300"
            },
            "orderer": "300"
        }
    }
},
"channels": {
    "composerchannel": {
        "orderers": [
            "orderer.example.com"
        ],
        "peers": {
            "peer0.org1.example.com": {},
             "peer1.org1.example.com": {},
              "peer2.org1.example.com": {},
              "peer3.org1.example.com": {},
              "peer4.org1.example.com": {}
        }
    }
},
"organizations": {
    "Org1": {
        "mspid": "Org1MSP",
        "peers": [
            "peer0.org1.example.com",
            "peer1.org1.example.com",
            "peer2.org1.example.com",
            "peer3.org1.example.com",
            "peer4.org1.example.com"

        ],
        "certificateAuthorities": [
            "ca.org1.example.com"
        ]
    }
},
"orderers": {
    "orderer.example.com": {
        "url": "grpc://${HOST}:7050"
    }
},
"peers": {
    "peer0.org1.example.com": {
        "url": "grpc://${HOST}:7051",
        "eventUrl": "grpc://${HOST}:7053"
    },
     "peer1.org1.example.com": {
        "url": "grpc://${HOST}:8051",
        "eventUrl": "grpc://${HOST}:8053"
    },
     "peer2.org1.example.com": {
        "url": "grpc://<machineIP>:9051"
    },
     "peer3.org1.example.com": {
        "url": "grpc://<machineIP>:9051"
    },
     "peer4.org1.example.com": {
        "url": "grpc://<machineIP>:9051"
    }
},
"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "http://${HOST}:7054",
        "caName": "ca.org1.example.com"
    }
}

}

【问题讨论】:

    标签: hyperledger-fabric hyperledger hyperledger-composer


    【解决方案1】:

    您的回复显示已联系了 3 个对等方,他们每个人都在实例化链码时遇到了问题。看起来你正在使用 composer 0.20 所以分解错误如下

    • 错误:2 UNKNOWN:链码错误(状态:500,消息:不是有效的背书系统链码)

    如果您使用带有 composer 0.20 的 Fabric 1.1 对等体,则会收到上述错误,因为 Composer 0.20 与 Fabric 1.1 对等体不兼容。

    • 错误:2 UNKNOWN:链码错误(状态:500,消息:未知链码类型:节点)

    如果您使用的是 fabric 1.0 对等体,则会收到上述错误。 Fabric 1.1 中引入了 NODE 的 Chaincode 类型

    所以我不知道您是如何设法在您的网络中拥有如此混合的结构对等级别的,但我建议您检查您正在运行的对等节点的版本,并确保它们都为 1.2,如果您计划使用作曲家 0.20。如果你想使用fabric 1.1,请确保你使用composer 0.19.x

    我看到的最后一点是,您的连接配置文件中有一些 ${HOST} 定义,您已将其他定义替换为 &lt;machineIP&gt;,所以我假设这些 ${HOST} 条目在示例中没有被替换您发布而不是在您的真实连接配置文件中。

    【讨论】:

      【解决方案2】:

      更改 composer 的版本有助于解决这个问题。

      npm install -g composer-cli@0.19
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多