【问题标题】:Generating a REST API in Hyperledger Composer error在 Hyperledger Composer 中生成 REST API 错误
【发布时间】:2017-05-09 09:39:23
【问题描述】:

我正在按照教程生成带有 Digital Land Title Network 示例的 REST API。但我收到以下错误:

To restart the REST server using the same options, issue the following command:
   composer-rest-server -p defaultProfile -n digitalproperty-network -i WebAppAdmin -s DJY27pEnl16d -N always

Discovering types from business network definition ...
Connection fails: Error: {"created":"@1494321356.313456565","description":"Failed parsing HTTP/2","file":"../src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":2022,"grpc_status":14,"referenced_errors":[{"created":"@1494321356.313436962","description":"Expected SETTINGS frame as the first frame, got frame type 80","file":"../src/core/ext/transport/chttp2/transport/parsing.c","file_line":479}{"created":"@1494321356.313450563","description":"Trying to connect an http1.x server","file":"../src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":1995,"http_status":400}]}
It will be retried for the next request.
{ Error: {"created":"@1494321356.313456565","description":"Failed parsing HTTP/2","file":"../src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":2022,"grpc_status":14,"referenced_errors":[{"created":"@1494321356.313436962","description":"Expected SETTINGS frame as the first frame, got frame type 80","file":"../src/core/ext/transport/chttp2/transport/parsing.c","file_line":479}{"created":"@1494321356.313450563","description":"Trying to connect an http1.x server","file":"../src/core/ext/transport/chttp2/transport/chttp2_transport.c","file_line":1995,"http_status":400}]}
    at /usr/lib/node_modules/composer-rest-server/node_modules/grpc/src/node/src/client.js:417:17 code: 14, metadata: Metadata { _internal_repr: {} } }

在部署新的网络定义时也会发生这种情况……似乎无法与 Hyperledger Fabric 通信。但是 Fabric 正在运行

calmadmin@localhost:~/composer-sample-applications-hlfv1/packages/getting-started$ docker ps
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS              PORTS                                            NAMES
04d28aa6dcbc        dev-peer1-digitalproperty-network-0.7.0         "chaincode -peer.addr"   About an hour ago   Up About an hour                                                     dev-peer1-digitalproperty-network-0.7.0
ebdaa8cb6e17        dev-peer0-digitalproperty-network-0.7.0         "chaincode -peer.addr"   About an hour ago   Up About an hour                                                     dev-peer0-digitalproperty-network-0.7.0
71d6fe2731a5        hyperledger/fabric-peer:x86_64-1.0.0-alpha      "peer node start --pe"   About an hour ago   Up About an hour    0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp   peer1
24302fa77160        hyperledger/fabric-peer:x86_64-1.0.0-alpha      "peer node start --pe"   About an hour ago   Up About an hour    0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   peer0
fc0cb6a66977        hyperledger/fabric-ca:x86_64-1.0.0-alpha        "sh -c 'fabric-ca-ser"   About an hour ago   Up About an hour    0.0.0.0:7054->7054/tcp                           ca_peerOrg1
0750ca58d06f        hyperledger/fabric-orderer:x86_64-1.0.0-alpha   "orderer"                About an hour ago   Up About an hour    0.0.0.0:7050->7050/tcp                           orderer0

谢谢!

【问题讨论】:

    标签: blockchain hyperledger hyperledger-fabric hyperledger-composer


    【解决方案1】:

    您正在运行 HLF 1.0.0-alpha 结构,但是当您启动其余服务器时,您指定了 defaultProfile,它是 hlf v0.6 的配置文件。当您部署 digitalproperty-network 时,您指定了一个配置文件 hlfv1(当您遵循快速入门指南时为您创建),这是您在启动其余服务器时需要使用的配置文件。

    【讨论】:

    • 是的!谢谢!我已经更改了配置文件,但现在我收到此错误:calmadmin@localhost:~/composer-sample-applications-hlfv1/packages/getting-started$ composer-rest-server -p hlfv1 -n digitalproper ty-network -i admin -s DJY27pEnl16d -N always Discovering types from business network definition ... events.js:160 throw er; // Unhandled 'error' event ^ Error: Connect Failed at ClientDuplexStream._emitStatusIfDone (/usr/lib/node_modules/composer-rest-server/node_modules/fabric-client/node_modules/gr pc/src/node/src/client.js:201:19) at Cli
    • enrollmentId 和 secret 对于 hlfv1.0.0-alpha 也不同,它们目前分别是 admin 和 adminpw,但是您那里的错误看起来与您的结构通信有问题,所以需要检查一下仍在运行。
    • 非常感谢。我如何知道 adminpw 的秘密值?
    • 注册ID“admin”和它的注册密码“adminpw”是用于启动所有fabric v1容器的docker-compose文件定义的默认值。命令: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/peerOrg1-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server -config/d8a5b3cac1b821f6e4b487ceaf1fd239cdcfc310894150908b90f05e9179556a_sk -b admin:adminpw' -d
    猜你喜欢
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多