我使用 Node.js API 编写了我的链代码,现在我正在尝试实例化。
图片:超级账本/fabric-peer:1.4.5
我的 package.json 有以下来源:
{
"name": "democontract",
"version": "1.0.0",
"description": "Document Contract",
"main": "index.js",
"engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
},
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"start": "fabric-chaincode-node start",
"mocha": "mocha test --recursive"
},
"engine-strict": true,
"license": "Apache-2.0",
"private": true,
"dependencies": {
"mkdirp": ">=0.5.5",
"openpgp": "^4.10.0",
"fabric-chaincode-api": "^1.4.0",
"fabric-shim": "^1.4.0"
},
"devDependencies": {
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"eslint": "^4.19.1",
"mocha": "^5.2.0",
"nyc": "^12.0.2",
"sinon": "^6.0.0",
"sinon-chai": "^3.2.0"
}
}
但是当我调用 CLI 容器来实例化链码(演示合同)时:
peer chaincode instantiate -C $CHANNELNAME -n $CHCODENAME -v $CHCODEVERSION -o $ORDERERNAME \
-c '{"Args":["ContractDocument:instantiate"]}' \
-P "OR('OrdererMSP.admin','Org1MSP.admin','Org1MSP.peer','Org1MSP.member')" \
--tls --cafile $ORDERER_TLSCACERT --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE
我在 PEER 容器中收到后续错误,并且链代码无法实例化。
我不知道如何摆脱这种错误状况。拜托,你能帮帮我吗?
[endorser] SimulateProposal -> ERRO 050 [devchannel][bef25398] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build:
Error returned from build: 1 "npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported.
Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! code E404
**npm ERR! 404 Not Found - GET https://registry.npmjs.org/fabric-chaincode-api - Not found**
npm ERR! 404
npm ERR! 404 'fabric-chaincode-api@^1.4.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'output'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-18T19_31_20_461Z-debug.log
"
error starting container
error starting container
问候, Magno A. Cavalcante