我想在没有任何互联网连接的环境中实例化链代码。由于链码容器将发出npm install
实例化后,我添加了一个名为的新容器npmregistry
in the docker-composer.yml
因此它与 Fabric 容器的其余部分一起配置,并且属于同一个 docker 网络 (composer_default)。请注意我正在使用fabric-tools
下载自https://hyperledger.github.io/composer/latest/installing/development-tools.html https://hyperledger.github.io/composer/latest/installing/development-tools.html)
npmregistry:
container_name: npmregistry
image: verdaccio/verdaccio
volumes:
- /home/user/repo/:/verdaccio/storage/
ports:
- 4873:4873
在 npmConfig 配置中,我输入:registry=http://npmregistry:4873/ http://npmregistry:4873/我发出了部署 BNA 的命令
composer network install --card PeerAdmin@hlfv1 --archiveFile ~/Downloads/vehicle-manufacture-network.bna -o npmrcFile=/home/user/npmConfig
composer network start -n vehicle-manufacture-network -V 0.2.4-deploy.0 -c PeerAdmin@hlfv1 -A admin -S adminpw -f networkadmin.card
However, the chaincode container does not see, to resolve the verdaccio (npmregistry) container
我确保 verdaccio 容器与其他容器位于同一网络中并发出wget http://npmregistry:4873/
从对等容器成功。因此我“作弊”了一点,尝试将 docker 网络网关 IP 地址硬编码到 npm Config 中
registry=http://172.18.0.1:4873/
我重新开始部署,现在可以了。看到下面的 verdaccio 日志,由于没有互联网访问,它回退到本地存储库(文件夹中已提供包)
但在部署过程中,我收到以下错误:
Response from attempted peer comms was an error: Error: 8 RESOURCE_EXHAUSTED: received trailing metadata size exceeds limit
查看对等日志,我发现以下内容:
2018-04-18 00:47:41.913 UTC [util] DockerBuild -> DEBU 4b7 Attempting build with image hyperledger/fabric-ccenv:x86_64-1.1.0
2018-04-18 00:48:26.098 UTC [chaincode-platform] func1 -> ERRO 4b8 Failed to generate platform-specific docker build: Error returned from build: 1 "npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: This project is unmaintained
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: Use uuid module instead
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: This project is unmaintained
npm WARN deprecated [email protected] /cdn-cgi/l/email-protection: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
> [email protected] /cdn-cgi/l/email-protection install /chaincode/output/node_modules/x509
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: getaddrinfo EAI_AGAIN nodejs.org:443
gyp ERR! stack at Object._errnoException (util.js:1022:11)
gyp ERR! stack at errnoException (dns.js:55:15)
gyp ERR! stack at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
gyp ERR! System Linux 4.13.0-38-generic
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
任何帮助表示赞赏。我的环境:
- 作曲家0.19.0
- 乌班图16.04
- Hyperledger Fabric v1.1.0