提供.npmrc文件后,Composer网络启动[ssl证书错误]

时间:2018-07-22 03:09:55

标签: node.js npm hyperledger-fabric hyperledger-composer

我正在尝试从公司代理后面部署示例业务网络。我正在遵循提供的开发人员教程。运行命令

composer网络启动--networkName教程-网络--networkVersion  0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card  PeerAdmin @ hlfv1-文件networkadmin.card -o  npmrcFile = / Users / user / .npmrc

我收到以下错误

错误:尝试启动业务网络时出错。错误:任何对等方均未提供有效响应。 来自尝试的对等通讯的响应是错误:错误:REQUEST_TIMEOUT 命令失败

Docker日志显示了一个新容器尝试使用npm命令安装某些东西的错误

*2018-07-22T03:00:58.228907438Z npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.6.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
2018-07-22T03:01:06.734626419Z 
> x509@0.3.3 install /chaincode/output/node_modules/x509
> node-gyp rebuild
2018-07-22T03:01:06.734705076Z 
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
gyp ERR! stack     at emitNone (events.js:106:13)
gyp ERR! stack     at TLSSocket.emit (events.js:208:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:637:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
gyp ERR! System Linux 4.9.87-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /chaincode/output/node_modules/x509
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN tutorial-network@0.0.1 No repository field.
npm WARN The package composer-common is included as both a dev and production dependency.
2018-07-22T03:01:07.835711840Z 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! x509@0.3.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the x509@0.3.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.*

来自对等容器的日志

2018-07-22 03:00:34.761 UTC [container] lockContainer -> DEBU 64a got container (dev-peer0.org1.example.com-tutorial-network-0.0.1) lock
2018-07-22 03:00:34.762 UTC [dockercontroller] Start -> DEBU 64b Cleanup container dev-peer0.org1.example.com-tutorial-network-0.0.1
2018-07-22 03:00:34.762 UTC [dockercontroller] stopInternal -> DEBU 64c Stop container dev-peer0.org1.example.com-tutorial-network-0.0.1(No such container: dev-peer0.org1.example.com-tutorial-network-0.0.1)
2018-07-22 03:00:34.763 UTC [dockercontroller] stopInternal -> DEBU 64d Kill container dev-peer0.org1.example.com-tutorial-network-0.0.1 (No such container: dev-peer0.org1.example.com-tutorial-network-0.0.1)
2018-07-22 03:00:34.763 UTC [dockercontroller] stopInternal -> DEBU 64e Remove container dev-peer0.org1.example.com-tutorial-network-0.0.1 (No such container: dev-peer0.org1.example.com-tutorial-network-0.0.1)
2018-07-22 03:00:34.763 UTC [dockercontroller] Start -> DEBU 64f Start container dev-peer0.org1.example.com-tutorial-network-0.0.1
2018-07-22 03:00:34.763 UTC [dockercontroller] createContainer -> DEBU 650 Create container: dev-peer0.org1.example.com-tutorial-network-0.0.1
2018-07-22 03:00:34.765 UTC [dockercontroller] Start -> DEBU 651 start-could not find image <dev-peer0.org1.example.com-tutorial-network-0.0.1-6695b9314667cc296171c0da511644e9011aa9a3ba0f6e759aca9e32e458803c> (container id <dev-peer0.org1.example.com-tutorial-network-0.0.1>), because of <no such image>...attempt to recreate image
2018-07-22 03:00:34.765 UTC [chaincode-platform] generateDockerfile -> DEBU 652 
FROM hyperledger/fabric-baseimage:x86_64-0.4.6
ADD binpackage.tar /usr/local/src
LABEL org.hyperledger.fabric.chaincode.id.name="tutorial-network" \
      org.hyperledger.fabric.chaincode.id.version="0.0.1" \
      org.hyperledger.fabric.chaincode.type="NODE" \
      org.hyperledger.fabric.version="1.1.0" \
      org.hyperledger.fabric.base.version="0.4.6"
ENV CORE_CHAINCODE_BUILDLEVEL=1.1.0
2018-07-22 03:00:34.766 UTC [util] DockerBuild -> DEBU 653 Attempting build with image hyperledger/fabric-ccenv:x86_64-1.1.0

.npmrc配置

registry=http://registry.npmjs.org/
strict-ssl=false
unsafe-perm=true
ca=
rejectUnauthorized=false
proxy=my proxy
https-proxy=myproxy

我的配置

Mac OSX High Sierra
composer-cli 0.19
Hyperledger fabric version 1.1
Using a corporate firewall

尽管有很多类似问题的帖子。他们都无法解决我的问题。任何帮助,指导将不胜感激

2 个答案:

答案 0 :(得分:0)

设置以下environment variableNODE_TLS_REJECT_UNAUTHORIZED=0(或export NODE_TLS_REJECT_UNAUTHORIZED=0)。

答案 1 :(得分:0)

您正在尝试将npmrc文件作为启动命令的一部分提供,该文件不起作用。它应该作为安装命令的一部分传递

composer network install -a mybn.bna -c myadmin@fabric-network -o npmrcFile=/Users/user/.npmrc