在Hyperledger Composer中生成REST API错误

时间:2017-05-09 09:39:23

标签: blockchain hyperledger hyperledger-fabric hyperledger-composer

我按照教程生成REST API,并附带Digital Land Title Network示例。但是我收到以下错误:

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

谢谢!

1 个答案:

答案 0 :(得分:1)

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