区块链REST端点无法访问

时间:2017-08-15 13:22:06

标签: docker docker-compose hyperledger-fabric

我有一个docker-compose文件为here。我可以连接到7051并注册我的链代码客户端,但是当我尝试连接到localhost:7050时,我收到一个错误,当使用curl测试时如下:

curl -v localhost:7050
* STATE: INIT => CONNECT handle 0x80059aa8; line 1410 (connection #-5000)
* Rebuilt URL to: localhost:7050/
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x80059aa8; line 1446 (connection #0)
*   Trying 127.0.0.1...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x80059aa8; line 1527 (connection #0)
* Connected to localhost (127.0.0.1) port 7050 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x80059aa8; line 1579 (connection #0)

* Marked for [keep alive]: HTTP default
* STATE: SENDPROTOCONNECT => DO handle 0x80059aa8; line 1597 (connection #0)
> GET / HTTP/1.1
> Host: localhost:7050
> User-Agent: curl/7.54.1
> Accept: */*
>
* STATE: DO => DO_DONE handle 0x80059aa8; line 1676 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x80059aa8; line 1801 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x80059aa8; line 1811 (connection #0)
* Recv failure: Software caused connection abort
* Marked for [closure]: Transfer returned error
* multi_done
* stopped the pause stream!
* Closing connection 0
* The cache now contains 0 members
* Expire cleared
curl: (56) Recv failure: Software caused connection abort

我为docker compose文件中的所有端口启用了docker toolbox vm的端口转发:7050,7051,7053。

我使用docker工具箱从windows运行docker。

我的码头设置如下:

  • Docker版本1.12.2,构建bb80604
  • docker-compose版本1.8.1, 建立004ddae

有人可以帮我解决我的超额担保REST API问题吗?

TIA

1 个答案:

答案 0 :(得分:1)

Hypeledger Fabric 1.0.0版本没有REST API,通过gRPC进行通信。要与Hyperledger Fabric交互,您需要利用目前提供的SDK之一:

  1. Java SDK
  2. Node SDK
  3. Go SDK
  4. Python SDK
  5. 要测试基本功能,您还可以考虑使用peer cli工具,该工具为您提供了支持对等方创建新通道,加入对等通道,安装/实例化链代码以及调用和查询链码。您可以在documentation中找到更多信息。