Closed joaoluis-pdm closed 1 year ago
Seems that in the middle of the ./startInit.sh there is this error:
...
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 '^anchor_1.0:4cfdf12d102be30842199d3ea0329525726d69e6ecd100b0c75b3095fdbc7dce$'
+ res=1
Query installed on peer0.org1 has failed
Deploying chaincode-as-a-service failed
...
jq ???
Seems that someone added "jq" as a command line dependency to https://github.com/hyperledger/fabric-samples/ on https://github.com/hyperledger/fabric-samples/commit/4eff55b75b613a4a2b00ebea3893e5015225ca06 ( https://github.com/hyperledger/fabric-samples/pull/827 )
Lets install jq to see if it helps...
./startInit.sh will check for jq
root@fgt-dev-pl:~# apt install jq
Does not work. Fails executing
peer chaincode query -C anchoring -n anchor -c '{"Args":["check"]}'
with error
Error: endorsement failure during query. response: status:500 message:"error in simulation: failed to execute transaction 280e018e0b25111673a4782934139f93ad80286d5bd33c1c2965738f0f56976e: error sending: timeout expired while executing transaction"
ccaas logs:
pharmaledger@fgt-dev-pl:~/blockchain-hf-workspace$ docker logs peer0org2_anchor_ccaas
Using env CHAINCODE_ID : anchor_1.0:46935ce9cd40d04d4429f61b84fa93dd05509faafb043b5bf331e69f2fbae911 string
Using env CHAINCODE_SERVER_ADDRESS : 0.0.0.0:9999 string
2022-09-19T16:08:48.504Z info [c-api:lib/handler.js] Successfully registered with peer node. State transferred to "established"
2022-09-19T16:08:48.504Z info [c-api:lib/handler.js] Successfully established communication with peer node. State transferred to "ready"
pharmaledger@fgt-dev-pl:~/blockchain-hf-workspace$ docker logs peer0org1_anchor_ccaas
Using env CHAINCODE_ID : anchor_1.0:46935ce9cd40d04d4429f61b84fa93dd05509faafb043b5bf331e69f2fbae911 string
Using env CHAINCODE_SERVER_ADDRESS : 0.0.0.0:9999 string
2022-09-19T16:08:48.509Z info [c-api:lib/handler.js] Successfully registered with peer node. State transferred to "established"
2022-09-19T16:08:48.510Z info [c-api:lib/handler.js] Successfully established communication with peer node. State transferred to "ready"
Transaction ID: 280e018e0b25111673a4782934139f93ad80286d5bd33c1c2965738f0f56976e
Args: ["check"]
Calling function: check
Calling parameters:
2022-09-19T16:08:48.715Z error [c-api:_] Unhandled Rejection reason SyntaxError: Unexpected token '?' promise Promise {
<rejected> /cc-home/privatesky/psknode/bundles/openDSU.js:24915
this.requestTimeout = requestTimeout ?? DEFAULT_TIMEOUT;
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at AnchorChaincode.Invoke (/cc-home/cc-anchor/lib/controller/AnchorChaincode.js:23:9)
at handleMessage (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:602:47)
at ChaincodeMessageHandler.handleTransaction (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:390:9)
}
Transaction ID: 1a817ff228ceb991375dd639ce4da3373005b36def64e709fc34d980a2447b5b
Args: ["check"]
Calling function: check
Calling parameters:
2022-09-19T16:14:24.212Z error [c-api:_] Unhandled Rejection reason SyntaxError: Unexpected token '?' promise Promise {
<rejected> /cc-home/privatesky/psknode/bundles/openDSU.js:24915
this.requestTimeout = requestTimeout ?? DEFAULT_TIMEOUT;
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at AnchorChaincode.Invoke (/cc-home/cc-anchor/lib/controller/AnchorChaincode.js:23:9)
at handleMessage (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:602:47)
at ChaincodeMessageHandler.handleTransaction (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:390:9)
}
Transaction ID: 1888ec030ff7d38236d2320b3db3ad0d064dd5ab7b903b19de988c0a930355cc
Args: ["org.hyperledger.fabric:GetMetadata"]
Calling function: org.hyperledger.fabric:GetMetadata
Calling parameters:
2022-09-19T16:42:39.513Z error [c-api:_] Unhandled Rejection reason SyntaxError: Unexpected token '?' promise Promise {
<rejected> /cc-home/privatesky/psknode/bundles/openDSU.js:24915
this.requestTimeout = requestTimeout ?? DEFAULT_TIMEOUT;
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at AnchorChaincode.Invoke (/cc-home/cc-anchor/lib/controller/AnchorChaincode.js:23:9)
at handleMessage (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:602:47)
at ChaincodeMessageHandler.handleTransaction (/cc-home/cc-anchor/node_modules/fabric-shim/lib/handler.js:390:9)
}
Asking OpenDSU support on slack (channel anchoring-implementation) to: upgrade the https://github.com/PharmaLedger-IMI/hf-adapter/blob/master/cc-anchor/Dockerfile#L1 from node:12 to node:14 (at least), and if possible provide a frozen version (octopus-freeze.json version of octopus.json) so that privatesky is not updated on every install.
No good solution for now on 2 fronts:
regarding the https://github.com/hyperledger/fabric/ the official installation script, cloneSamplesRepo()
pulls non-frozen version of the examples:
https://github.com/hyperledger/fabric/blob/c639dfb7d527a34d0e18597851e6f9d396a4848b/scripts/install-fabric.sh#L154
So, every time the install-all.sh is executed, we risk fetching an incompatible version.
regarding the https://github.com/PharmaLedger-IMI/hf-adapter/ the chain-code docker runs "dev-install" (see https://github.com/PharmaLedger-IMI/hf-adapter/blob/772b3647751fcca84a0f6c86a7bc02c699228948/cc-anchor/Dockerfile#L10 ), and there is not even an octopus-freeze.json, so we would need to fork this repo to build a frozen version. This is seems important because the ./startInit.sh
recreates this docker every time.