I wrote my chaincode using Node.js API, and now I'm trying to instantiate.
image: hyperledger/fabric-peer:1.4.5
My package.json has the follow source:
{
"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"
}
}
But when I call in CLI container to instantiate the chaincode (democontract):
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
I'm receing the follow ERROR at PEER container, and chaincode failed to instantiate.
I don't know how to get out of this error condition. Please, may you help me?
[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 [email protected]: 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 [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: 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
Regards, Magno A. Cavalcante
You might be using incompatible version of node js. Please check the supported versions of node js with hyperledger fabric versions.