I am trying to run fabric chaincode after network.ch up but the below error is coming, trying hard to find a solution, appreciate much for your help
$ ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
/c/Users/user/fab/fabric-samples/test-network/configtx/configtx.yaml
./network.sh: line 28: pushd: too many arguments
Using docker and docker-compose
deploying chaincode on channel 'mychannel'
executing with the following
- CHANNEL_NAME: mychannel
- CC_NAME: basic
- CC_SRC_PATH: ../asset-transfer-basic/chaincode-javascript
- CC_SRC_LANGUAGE: javascript
- CC_VERSION: 1.0
- CC_SEQUENCE: 1
- CC_END_POLICY: NA
- CC_COLL_CONFIG: NA
- CC_INIT_FCN: NA
- DELAY: 3
- MAX_RETRY: 5
- VERBOSE: false
peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-javascript --lang node --label basic_1.0
res=0
peer lifecycle chaincode calculatepackageid basic.tar.gz
PACKAGE_ID=basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed
Chaincode is packaged
Installing chaincode on peer0.org1...
Using organization 1
peer lifecycle chaincode queryinstalled --output json
jq 'try (.installed_chaincodes[].package_id)'
scripts/ccutils.sh: line 9: jq: command not found
grep '^basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed$'
test 1 -ne 0
peer lifecycle chaincode install basic.tar.gz
res=0
2022-09-18 10:49:02.425 IST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nJbasic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed\022\tbasic_1.0" >
2022-09-18 10:49:02.426 IST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed
Chaincode is installed on peer0.org1
Install chaincode on peer0.org2...
Using organization 2
peer lifecycle chaincode queryinstalled --output json
jq 'try (.installed_chaincodes[].package_id)'
scripts/ccutils.sh: line 9: jq: command not found
grep '^basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed$'
test 1 -ne 0
peer lifecycle chaincode install basic.tar.gz
res=0
2022-09-18 10:49:31.056 IST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nJbasic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed\022\tbasic_1.0" >
2022-09-18 10:49:31.057 IST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed
Chaincode is installed on peer0.org2
Using organization 1
peer lifecycle chaincode queryinstalled --output json
jq -r 'try (.installed_chaincodes[].package_id)'
scripts/ccutils.sh: line 25: jq: command not found
grep '^basic_1.0:e4b11f4369fabe9b787459fc5acdefbb6c48f77637b2614b13e103b4528d88ed$'
res=1
Query installed on peer0.org1 has failed
Deploying chaincode failed
scripts/utils.sh: line 1: popd: directory stack empty
CodePudding user response:
Try the command apt-get install -y jq to clear out the jq: command not found. worked for me. Unsure of any other issues, but this will resolve that.
CodePudding user response:
@Nathan Field yes, proper jq installation solved this issue. In windows after placing jq.exe file in ProgramFiles/Git/User/bin/ solved issue
But now I am facing an issue with enrollAdmin
Wallet path: C:\Users\Kumar Swamy\fab\fabric-samples\fabcar\javascript\wallet 2022-09-19T13:45:50.002Z - error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Calling enroll endpoint failed with error [Error: connect ECONNREFUSE D 127.0.0.1:7054], stack=Error: Calling enroll endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054] at ClientRequest. (C:\Users\Kumar Swamy\fab\fabric-samples\fabcar\javascript\node_modules\fabric-ca-client\lib\FabricCAClient.js:327:19) at ClientRequest.emit (node:events:527:28) at TLSSocket.socketErrorListener (node:_http_client:454:9) at TLSSocket.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21), errno=-4078, code=ECONNREFUSED, syscall=connect, address=127.0.0.1, port=7054 Failed to enroll admin user "admin": Error: Calling enroll endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054]