Hyperledger Fabric 无法实例化链代码不受支持的协议方案 "tcp"

Hyperledger Fabric Failed to Instantiate chaincode unsupported protocol scheme "tcp"

我正在尝试启动一个 hyperledger fabric 1.2.0 网络,该网络分布在 2 个 ubuntu 虚拟机(一个订购者和对等方)和我自己的计算机上以调用 cli 命令。到目前为止,我已经启动了 orderer 和 peer 机器,为 peer 机器更新了 anchor peer,并安装了链代码。

但是,在使用 chaincode isntantiate 命令实例化链代码时,我收到一条错误消息 unsupported protocol scheme "tcp"

我使用以下命令成功安装了链码:

 peer chaincode install -n mycc -v 1.0 -p chaincode_example02/

我用来实例化链码的命令是:

peer chaincode instantiate -o 192.168.0.150:7050 --tls $CORE_PEER_TLS_ENABLED --cafile ./crypto-config/ordererOrganizations/0.150/orderers/192.168.0.150/msp/tlscacerts/tlsca.0.150-cert.pem -C myownnetworkchannel -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "AND ('Org1MSP.peer')"

我在客户端 cli 上得到的错误消息是:

Error: could not assemble transaction, err Proposal response was not 
successful, error code 500, msg failed to execute transaction 
4b31df457c0c5642f98689e6887db4fefa79a8547b182ee481f7ff03320c02f9: error 
starting container: error starting container: Post 
tcp:///var/run/docker.sock/containers/create?name=dev-peer0.0.155-mycc- 
1.0: unsupported protocol scheme "tcp"

其他对等日志

2018-09-18 22:38:15.448 EDT [chaincode] Launch -> ERRO bf0b start failed: Post tcp:///var/run/docker.sock/containers/create?name=dev-peer0.0.155-mycc-1.0: unsupported 
protocol scheme "tcp"
error starting container
error starting container
2018-09-18 22:38:15.448 EDT [endorser] callChaincode -> DEBU bf0c [myownnetworkchannel][3ed01a8ccc3fff617c04d7307811c4f777f6b81588b21d7c549e4bcd300949f6] Exit
2018-09-18 22:38:15.449 EDT [endorser] SimulateProposal -> ERRO bf0d [myownnetworkchannel][3ed01a8c] failed to invoke chaincode name:"lscc" , error: Post tcp:///var/ru
n/docker.sock/containers/create?name=dev-peer0.0.155-mycc-1.0: unsupported protocol scheme "tcp"
error starting container
error starting container

我的问题是,问题是由我的对等机器的 core.yaml 配置引起的还是由我在计算机中使用的核心配置文件引起的?我已经尝试更改计算机中的 vm endpoint(指向 docker.sock 文件)和 addressAutoDetect 配置,但无济于事。

事实证明,我在对等机器的 core.yaml 配置中遗漏了一些东西。

core.yaml

...
###############################################################################
#
#    VM section
#
###############################################################################
vm:

# Endpoint of the vm management system.  For docker can be one of the following in general
# unix:///var/run/docker.sock
# http://localhost:2375
# https://localhost:2376
endpoint: /var/run/docker.sock #incorrect config causing the tcp issue
endpoint: unix:///var/run/docker.sock #correct config

在四处寻找解决方案后,我遇到了这个 docker.sock stack overflow question,它解释了 docker 容器是如何通过 'UNIX' 套接字而不是 tcp 公开的。