From 53a0a156251c4e71ce67679d7ca0a40e6bc409b4 Mon Sep 17 00:00:00 2001 From: aldousalvarez Date: Wed, 10 Jan 2024 13:55:41 +0800 Subject: [PATCH] docs(examples/supply-chain): fix yarn --no-lockfile Primary Changes --------------- 1. Removed examples/supply-chain-app/package.json and moved the other files to cactus-example-supply -chain-backend 2. Updated the docs to match the updated path of the supply-chain-app files to cactus-example-supply- chain-backend and the new steps on how run the latest supply chain app 3. Updated the code responses in connector-fabric from null to (0) based on the logs and responses while running the application. 4. Added a parse.int for shelfCount in bookshelf- converter because it requires a number but instead the value becomes a string before it is submitted. Fixes #2721 Signed-off-by: aldousalvarez --- .github/workflows/ci.yaml | 2 +- .../example-supply-chain-app-publish.yaml | 2 +- .vscode/template.launch.json | 2 +- .../source/examples/supply-chain-app.md | 2 +- docs/docs/cactus/examples/supply-chain-app.md | 84 +++++++++---------- .../.dockerignore | 2 +- .../Dockerfile | 6 +- .../README.md | 10 +-- .../healthcheck.sh | 0 .../package.json | 2 + .../process.env | 0 .../main/solidity/BambooHarvestRepository.sol | 2 +- .../main/solidity/BookshelfRepository .sol | 2 +- .../supervisord.conf | 2 +- .../model/converter/bookshelf-converter.ts | 5 +- .../angular.json | 8 +- examples/supply-chain-app/package.json | 55 ------------ package.json | 4 +- .../plugin-ledger-connector-fabric.ts | 12 +-- .../fabric/fabric-test-ledger-v1.ts | 2 +- yarn.lock | 28 +++---- 21 files changed, 91 insertions(+), 141 deletions(-) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/.dockerignore (91%) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/Dockerfile (89%) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/README.md (93%) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/healthcheck.sh (100%) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/process.env (100%) rename examples/{supply-chain-app => cactus-example-supply-chain-backend}/supervisord.conf (75%) delete mode 100644 examples/supply-chain-app/package.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b262fc1d96..d0bc17f10e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2151,7 +2151,7 @@ jobs: steps: - uses: actions/checkout@v3.5.2 - name: ghcr.io/hyperledger/cactus-example-supply-chain-app - run: DOCKER_BUILDKIT=1 docker build . -f ./examples/supply-chain-app/Dockerfile -t cactus-example-supply-chain-app + run: DOCKER_BUILDKIT=1 docker build . -f ./examples/cactus-example-supply-chain-backend/Dockerfile -t cactus-example-supply-chain-app - name: Run Trivy vulnerability scan for cactus-example-supply-chain-app uses: aquasecurity/trivy-action@0.11.2 with: diff --git a/.github/workflows/example-supply-chain-app-publish.yaml b/.github/workflows/example-supply-chain-app-publish.yaml index ba932ee715e..5c329008eac 100644 --- a/.github/workflows/example-supply-chain-app-publish.yaml +++ b/.github/workflows/example-supply-chain-app-publish.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-20.04 env: DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./examples/supply-chain-app/Dockerfile + DOCKERFILE_PATH: ./examples/cactus-example-supply-chain-backend/Dockerfile DOCKER_BUILD_DIR: ./ permissions: packages: write diff --git a/.vscode/template.launch.json b/.vscode/template.launch.json index 7264b43e2c3..97dd6d34182 100644 --- a/.vscode/template.launch.json +++ b/.vscode/template.launch.json @@ -60,7 +60,7 @@ ], "console": "integratedTerminal", "sourceMaps": true, - "cwd": "${workspaceFolder}/examples/supply-chain-app/", + "cwd": "${workspaceFolder}/examples/cactus-example-supply-chain-backend/", "outFiles": [ "${workspaceFolder}/**/*.js", "!**/node_modules/**" diff --git a/docs-cactus/source/examples/supply-chain-app.md b/docs-cactus/source/examples/supply-chain-app.md index c4384b8481b..89c31c7f016 100644 --- a/docs-cactus/source/examples/supply-chain-app.md +++ b/docs-cactus/source/examples/supply-chain-app.md @@ -1,3 +1,3 @@ -```{include} ../../../examples/supply-chain-app/README.md +```{include} ../../../examples/cactus-example-supply-chain-backend/README.md :relative-images: ``` \ No newline at end of file diff --git a/docs/docs/cactus/examples/supply-chain-app.md b/docs/docs/cactus/examples/supply-chain-app.md index 71409a80e77..0e8a0d309f7 100644 --- a/docs/docs/cactus/examples/supply-chain-app.md +++ b/docs/docs/cactus/examples/supply-chain-app.md @@ -5,7 +5,7 @@ Usage -------------------------------------------- 1. Execute the following from: - + docker run \\ \--rm \\ \--privileged \\ @@ -16,17 +16,17 @@ Usage \-p 4100:4100 \\ \-p 4200:4200 \\ ghcr.io/hyperledger/cactus-example-supply-chain-app:2022-04-05--feat-1579 - + 2. Observe the example application pulling up in the logs - + 1. the test ledger containers, - + 2. a test consortium with multiple members and their Cactus nodes - + 3. Wait for the output to show the message `INFO (api-server): Cactus Cockpit reachable http://0.0.0.0:3200` - + 4. Visit http://0.0.0.0:3200 in your web browser with Javascript enabled - + Building and running the container locally ---------------------------------------------------------------------------------------------------------------------- @@ -34,7 +34,7 @@ Building and running the container locally \# Change directories to the project root \# Build the docker image and tag it as "scaeb" for supply chain app example backend -DOCKER\_BUILDKIT\=1 docker build \-f ./examples/supply-chain-app/Dockerfile . \-t scaeb +DOCKER\_BUILDKIT\=1 docker build \-f ./examples/cactus-example-supply-chain-backend/Dockerfile . \-t scaeb \# Run the built image with ports mapped to the host machine as you see fit \# The --privileged flag is required because we use Docker-in-Docker for pulling @@ -47,7 +47,7 @@ Building the image with a specific npm package version: DOCKER\_BUILDKIT\=1 docker build \\ \--build-arg NPM\_PKG\_VERSION\=jwt-supply-chain \\ - \--file ./examples/supply-chain-app/Dockerfile \\ + \--file ./examples/cactus-example-supply-chain-backend/Dockerfile \\ \--tag scaeb \\ ./ @@ -58,70 +58,70 @@ Running the Example Application Locally On the terminal, issue the following commands: -1. `npm run install-yarn` - -2. `yarn configure` - +1. `npm run enable-corepack` + +2. `yarn run configure` + 3. `yarn start:example-supply-chain` - + Debugging the Example Application Locally -------------------------------------------------------------------------------------------------------------------- On the terminal, issue the following commands (steps 1 to 6) and then perform the rest of the steps manually. -1. `npm run install-yarn` - +1. `npm run enable-corepack` + 2. `yarn configure` - + 3. `yarn build:dev` - -4. `cd ./examples/supply-chain-app/` - -5. `yarn --no-lockfile` - + +4. `cd ./examples/cactus-example-supply-chain-backend/` + +5. `yarn install` + 6. `cd ../../` - + 7. Locate the `.vscode/template.launch.json` file - + 8. Within that file locate the entry named `"Example: Supply Chain App"` - + 9. Copy the VSCode debug definition object from 2) to your `.vscode/launch.json` file - + 10. At this point the VSCode `Run and Debug` panel on the left should have an option also titled `"Example: Supply Chain App"` which starts the application - + 11. When the application finishes loading, the JWT token generated is displayed on the terminal - + 12. Visit http://localhost:3200 in a web browser with Javascript enabled and insert the token when prompted - + Live Reloading the GUI Application ------------------------------------------------------------------------------------------------------ -1. `npm run install-yarn` - +1. `npm run enable-corepack` + 2. `yarn configure` - + 3. `yarn build:dev` - + 4. Locate the `.vscode/template.launch.json` file - + 5. Within that file locate the entry named `"Example: Supply Chain App"` - + 6. Copy the VSCode debug definition object from 2) to your `.vscode/launch.json` file - + 7. At this point the VSCode `Run and Debug` panel on the left should have an option also titled `"Example: Supply Chain App"` which starts the application - + 8. `cd ./examples/cactus-example-supply-chain-frontend/` - + 9. `yarn serve:proxy` - + 10. When the application finishes loading, the JWT token generated is displayed on the terminal - + 11. Visit http://localhost:8000 in a web browser with Javascript enabled and insert the token when prompted - + 12. At this point if you modify the source code of the GUI application under the `./examples/cactus-example-supply-chain-frontend/` path it will automatically reload the browser window (you will need to paste in the JWT again when this happens) - + [Previous](../examples.md "Examples") [Next](../governance.md "Governance") diff --git a/examples/supply-chain-app/.dockerignore b/examples/cactus-example-supply-chain-backend/.dockerignore similarity index 91% rename from examples/supply-chain-app/.dockerignore rename to examples/cactus-example-supply-chain-backend/.dockerignore index 74cfa6a5d32..87ce227e104 100644 --- a/examples/supply-chain-app/.dockerignore +++ b/examples/cactus-example-supply-chain-backend/.dockerignore @@ -39,7 +39,7 @@ coverage/ # Introperability App specifics examples/simple-asset-transfer/fabric/**/hfc-key-store/ -examples/supply-chain-app/Dockerfile +examples/cactus-example-supply-chain-backend/Dockerfile bin/ .tmp/ diff --git a/examples/supply-chain-app/Dockerfile b/examples/cactus-example-supply-chain-backend/Dockerfile similarity index 89% rename from examples/supply-chain-app/Dockerfile rename to examples/cactus-example-supply-chain-backend/Dockerfile index 92b34b4fc1b..8487b3b150d 100644 --- a/examples/supply-chain-app/Dockerfile +++ b/examples/cactus-example-supply-chain-backend/Dockerfile @@ -43,7 +43,7 @@ RUN source ~/.bashrc && \ SHELL ["/bin/bash", "--login", "-c"] -COPY --chown=${APP_USER}:${APP_USER} ./examples/supply-chain-app/healthcheck.sh / +COPY --chown=${APP_USER}:${APP_USER} ./examples/cactus-example-supply-chain-backend/healthcheck.sh / ENV AUTHORIZATION_CONFIG_JSON="{}" ENV AUTHORIZATION_PROTOCOL=NONE @@ -67,7 +67,7 @@ ENV API_PORT=4000 ENV GRPC_TLS_ENABLED=false ENV LOG_LEVEL=TRACE -COPY examples/supply-chain-app/supervisord.conf /etc/supervisord.conf +COPY examples/cactus-example-supply-chain-backend/supervisord.conf /etc/supervisord.conf # supervisord web ui/dashboard EXPOSE 9001 @@ -91,4 +91,4 @@ USER root ENTRYPOINT ["/usr/bin/supervisord"] CMD ["--configuration", "/etc/supervisord.conf", "--nodaemon"] HEALTHCHECK --interval=1s --timeout=5s --start-period=20s --retries=250 \ - CMD /usr/src/app/examples/supply-chain-app/healthcheck.sh + CMD /usr/src/app/examples/cactus-example-supply-chain-backend/healthcheck.sh diff --git a/examples/supply-chain-app/README.md b/examples/cactus-example-supply-chain-backend/README.md similarity index 93% rename from examples/supply-chain-app/README.md rename to examples/cactus-example-supply-chain-backend/README.md index 2c2f09b0470..eb360c64b30 100644 --- a/examples/supply-chain-app/README.md +++ b/examples/cactus-example-supply-chain-backend/README.md @@ -28,7 +28,7 @@ # Change directories to the project root # Build the docker image and tag it as "scaeb" for supply chain app example backend -DOCKER_BUILDKIT=1 docker build -f ./examples/supply-chain-app/Dockerfile . -t scaeb +DOCKER_BUILDKIT=1 docker build -f ./examples/cactus-example-supply-chain-backend/Dockerfile . -t scaeb # Run the built image with ports mapped to the host machine as you see fit # The --privileged flag is required because we use Docker-in-Docker for pulling @@ -43,7 +43,7 @@ Building the image with a specific npm package version: ```sh DOCKER_BUILDKIT=1 docker build \ --build-arg NPM_PKG_VERSION=jwt-supply-chain \ - --file ./examples/supply-chain-app/Dockerfile \ + --file ./examples/cactus-example-supply-chain-backend/Dockerfile \ --tag scaeb \ ./ ``` @@ -63,10 +63,10 @@ On the terminal, issue the following commands: On the terminal, issue the following commands (steps 1 to 6) and then perform the rest of the steps manually. 1. `npm run enable-corepack` -2. `npm run configure` +2. `yarn run configure` 3. `yarn build:dev` -4. `cd ./examples/supply-chain-app/` -5. `yarn --no-lockfile` +4. `cd ./examples/cactus-example-supply-chain-backend/` +5. `yarn install` 6. `cd ../../` 7. Locate the `.vscode/template.launch.json` file 8. Within that file locate the entry named `"Example: Supply Chain App"` diff --git a/examples/supply-chain-app/healthcheck.sh b/examples/cactus-example-supply-chain-backend/healthcheck.sh similarity index 100% rename from examples/supply-chain-app/healthcheck.sh rename to examples/cactus-example-supply-chain-backend/healthcheck.sh diff --git a/examples/cactus-example-supply-chain-backend/package.json b/examples/cactus-example-supply-chain-backend/package.json index 8c96b4aa58b..9ccef504b82 100644 --- a/examples/cactus-example-supply-chain-backend/package.json +++ b/examples/cactus-example-supply-chain-backend/package.json @@ -43,6 +43,8 @@ "dist/*" ], "scripts": { + "start": "node -r dotenv/config dist/lib/main/typescript/supply-chain-app-cli.js dotenv_config_path=process.env", + "start-direct": "node ./node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/examples/supply-chain-app/process.env b/examples/cactus-example-supply-chain-backend/process.env similarity index 100% rename from examples/supply-chain-app/process.env rename to examples/cactus-example-supply-chain-backend/process.env diff --git a/examples/cactus-example-supply-chain-backend/src/main/solidity/BambooHarvestRepository.sol b/examples/cactus-example-supply-chain-backend/src/main/solidity/BambooHarvestRepository.sol index 73a7de6ed39..4bc2a27e121 100644 --- a/examples/cactus-example-supply-chain-backend/src/main/solidity/BambooHarvestRepository.sol +++ b/examples/cactus-example-supply-chain-backend/src/main/solidity/BambooHarvestRepository.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.7.0; +pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import { SupplyChainAppDataModelLib as model } from "./SupplyChainAppDataModel.sol"; diff --git a/examples/cactus-example-supply-chain-backend/src/main/solidity/BookshelfRepository .sol b/examples/cactus-example-supply-chain-backend/src/main/solidity/BookshelfRepository .sol index 0f3e7272b09..3b29d0929ff 100644 --- a/examples/cactus-example-supply-chain-backend/src/main/solidity/BookshelfRepository .sol +++ b/examples/cactus-example-supply-chain-backend/src/main/solidity/BookshelfRepository .sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.7.0; +pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import { SupplyChainAppDataModelLib as model } from "./SupplyChainAppDataModel.sol"; diff --git a/examples/supply-chain-app/supervisord.conf b/examples/cactus-example-supply-chain-backend/supervisord.conf similarity index 75% rename from examples/supply-chain-app/supervisord.conf rename to examples/cactus-example-supply-chain-backend/supervisord.conf index f8cb6c029fb..8b1281e7179 100644 --- a/examples/supply-chain-app/supervisord.conf +++ b/examples/cactus-example-supply-chain-backend/supervisord.conf @@ -13,7 +13,7 @@ stderr_logfile=/usr/src/app/log/dockerd.err.log stdout_logfile=/usr/src/app/log/dockerd.out.log [program:supply-chain-app] -command=/home/appuser/.nvm/versions/node/v16.8.0/bin/node /usr/src/app/node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js +command=/home/appuser/.nvm/versions/node/v16.14.2/bin/node /usr/src/app/node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js autostart=true autorestart=unexpected startretries=20 diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts index 91f25dbc7ee..36af34f9435 100644 --- a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts +++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts @@ -26,7 +26,10 @@ export class BookshelfConverter { const errMsg = `Expected the value of arr[${BookshelfConverter.SOLIDITY_FIELD_ID}] to be a string`; throw new RuntimeError(errMsg); } - const shelfCount = arr[BookshelfConverter.SOLIDITY_FIELD_SHELF_COUNT]; + const shelfCountStr = arr[ + BookshelfConverter.SOLIDITY_FIELD_SHELF_COUNT + ] as string; + const shelfCount = parseInt(shelfCountStr, 10); if (typeof shelfCount !== "number") { const errMsg = `Expected the value of arr[${BookshelfConverter.SOLIDITY_FIELD_SHELF_COUNT}] to be a number`; throw new RuntimeError(errMsg); diff --git a/examples/cactus-example-supply-chain-frontend/angular.json b/examples/cactus-example-supply-chain-frontend/angular.json index 23b53104205..c66ed33423c 100644 --- a/examples/cactus-example-supply-chain-frontend/angular.json +++ b/examples/cactus-example-supply-chain-frontend/angular.json @@ -88,13 +88,15 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "app:build" + "browserTarget": "app:build", + "proxyConfig": "proxy.conf.json" }, "configurations": { "production": { "browserTarget": "app:build:production" }, "ci": { + } } }, @@ -176,9 +178,7 @@ } }, "cli": { - "schematicCollections": [ - "@ionic/angular-toolkit" - ], + "schematicCollections": ["@ionic/angular-toolkit"], "analytics": false }, "schematics": { diff --git a/examples/supply-chain-app/package.json b/examples/supply-chain-app/package.json deleted file mode 100644 index 79d55c531e4..00000000000 --- a/examples/supply-chain-app/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "@hyperledger/cactus-example-supply-chain-backend-app", - "version": "0.2.0", - "description": "An example project demonstrating how Cactus can be used for cross-chain dapp development.", - "scripts": { - "start": "node -r dotenv/config node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js dotenv_config_path=process.env", - "start-direct": "node ./node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js" - }, - "private": true, - "publishConfig": { - "access": "restricted" - }, - "engines": { - "node": ">=10", - "npm": ">=6" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/hyperledger/cactus.git" - }, - "keywords": [ - "Hyperledger", - "Cactus", - "Blockchain Integration", - "Distributed Ledger Technology" - ], - "author": { - "name": "Hyperledger Cactus Contributors", - "email": "cactus@lists.hyperledger.org", - "url": "https://www.hyperledger.org/use/cacti" - }, - "contributors": [ - { - "name": "Please add yourself to the list of contributors", - "email": "your.name@example.com", - "url": "https://example.com" - }, - { - "name": "Peter Somogyvari", - "email": "peter.somogyvari@accenture.com", - "url": "https://accenture.com" - } - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/hyperledger/cactus/issues" - }, - "homepage": "https://github.com/hyperledger/cactus#readme", - "dependencies": { - "@hyperledger/cactus-example-supply-chain-backend": "file:../cactus-example-supply-chain-backend", - "@hyperledger/cactus-example-supply-chain-frontend": "file:../cactus-example-supply-chain-frontend", - "dotenv": "8.2.0" - }, - "devDependencies": {} -} diff --git a/package.json b/package.json index a094dfd42f1..646b62b9067 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "generate-api-server-config": "node ./tools/generate-api-server-config.js", "sync-ts-config": "TS_NODE_PROJECT=tools/tsconfig.json node --experimental-json-modules --loader ts-node/esm ./tools/sync-npm-deps-to-tsc-projects.ts", "start:api-server": "node ./packages/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js --config-file=.config.json", - "start:example-supply-chain": "yarn build:dev && cd ./examples/supply-chain-app/ && yarn --no-lockfile && yarn start", + "start:example-supply-chain": "yarn build:dev && cd ./examples/cactus-example-supply-chain-backend/ && yarn && yarn start", "start:example-carbon-accounting": "CONFIG_FILE=examples/cactus-example-carbon-accounting-backend/example-config.json node examples/cactus-example-carbon-accounting-backend/dist/lib/main/typescript/carbon-accounting-app-cli.js", "start:example-cbdc-bridging-app": "node -r ts-node/register examples/cactus-example-cbdc-bridging-backend/dist/lib/main/typescript/cbdc-bridging-app-cli.js dotenv_config_path=examples/cactus-example-cbdc-bridging-backend/process.env", "purge-build-cache": "del-cli .build-cache/*", @@ -167,7 +167,7 @@ "shebang-loader": "0.0.1", "simple-git": "3.19.1", "sort-package-json": "1.57.0", - "source-map-loader": "3.0.2", + "source-map-loader": "4.0.1", "stream-browserify": "3.0.0", "tap": "16.3.8", "tape": "5.6.6", diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts b/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts index 618ab22bfa0..4dac5a77bf4 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts @@ -747,14 +747,14 @@ export class PluginLedgerConnectorFabric log.debug(`Copy to CLI Container CMD: ${copyToCliCmd}`); const copyToCliRes = await ssh.execCommand(copyToCliCmd, sshCmdOptions); log.debug(`Copy to CLI Container CMD Response: %o`, copyToCliRes); - Checks.truthy(copyToCliRes.code === null, `copyToCliRes.code === null`); + Checks.truthy(copyToCliRes.code === 0, `copyToCliRes.code === 0`); { const goModInitCmd = `${dockerBuildCmd} go mod init ${ccName}`; log.debug(`go mod init CMD: ${goModInitCmd}`); const goModInitRes = await ssh.execCommand(goModInitCmd, sshCmdOptions); log.debug(`go mod init CMD Response: %o`, goModInitRes); - Checks.truthy(goModInitRes.code === null, `goModInitRes.code === null`); + Checks.truthy(goModInitRes.code === 0, `goModInitRes.code === 0`); } const pinnedDeps = req.pinnedDeps || []; @@ -763,7 +763,7 @@ export class PluginLedgerConnectorFabric log.debug(`go get CMD: ${goGetCmd}`); const goGetRes = await ssh.execCommand(goGetCmd, sshCmdOptions); log.debug(`go get CMD Response: %o`, goGetRes); - Checks.truthy(goGetRes.code === null, `goGetRes.code === null`); + Checks.truthy(goGetRes.code === 0, `goGetRes.code === 0`); } { @@ -771,7 +771,7 @@ export class PluginLedgerConnectorFabric log.debug(`go mod tidy CMD: ${goModTidyCmd}`); const goModTidyRes = await ssh.execCommand(goModTidyCmd, sshCmdOptions); log.debug(`go mod tidy CMD Response: %o`, goModTidyRes); - Checks.truthy(goModTidyRes.code === null, `goModTidyRes.code === null`); + Checks.truthy(goModTidyRes.code === 0, `goModTidyRes.code === 0`); } { @@ -779,7 +779,7 @@ export class PluginLedgerConnectorFabric log.debug(`go mod vendor CMD: ${goVendorCmd}`); const goVendorRes = await ssh.execCommand(goVendorCmd, sshCmdOptions); log.debug(`go mod vendor CMD Response: %o`, goVendorRes); - Checks.truthy(goVendorRes.code === null, `goVendorRes.code === null`); + Checks.truthy(goVendorRes.code === 0, `goVendorRes.code === 0`); } { @@ -787,7 +787,7 @@ export class PluginLedgerConnectorFabric log.debug(`go build CMD: ${goBuildCmd}`); const goBuildRes = await ssh.execCommand(goBuildCmd, sshCmdOptions); log.debug(`go build CMD Response: %o`, goBuildRes); - Checks.truthy(goBuildRes.code === null, `goBuildRes.code === null`); + Checks.truthy(goBuildRes.code === 0, `goBuildRes.code === 0`); } const installationCommandResponses: SSHExecCommandResponse[] = []; diff --git a/packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts b/packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts index 976bf9232cf..e02045005fd 100644 --- a/packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts +++ b/packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts @@ -495,7 +495,7 @@ export class FabricTestLedgerV1 implements ITestLedger { const cInfo = await this.getContainerInfo(); const container = this.getContainer(); const CCP_JSON_PATH_FABRIC_V1 = - "/fabric-samples/first-network/connection-org" + orgName + ".json"; + "/fabric-samples/first-network/connection-" + orgName + ".json"; const CCP_JSON_PATH_FABRIC_V2 = connectionProfilePath; const ccpJsonPath = compareVersions.compare( this.getFabricVersion(), diff --git a/yarn.lock b/yarn.lock index 135237a76e0..a063a93362d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8719,7 +8719,7 @@ __metadata: shebang-loader: 0.0.1 simple-git: 3.19.1 sort-package-json: 1.57.0 - source-map-loader: 3.0.2 + source-map-loader: 4.0.1 stream-browserify: 3.0.0 tap: 16.3.8 tape: 5.6.6 @@ -44579,19 +44579,6 @@ __metadata: languageName: node linkType: hard -"source-map-loader@npm:3.0.2, source-map-loader@npm:^3.0.0": - version: 3.0.2 - resolution: "source-map-loader@npm:3.0.2" - dependencies: - abab: ^2.0.5 - iconv-lite: ^0.6.3 - source-map-js: ^1.0.1 - peerDependencies: - webpack: ^5.0.0 - checksum: d5a4e2ab190c93ae5cba68c247fbaa9fd560333c91060602b634c399a8a4b3205b8c07714c3bcdb0a11c6cc5476c06256bd8e824e71fbbb7981e8fad5cba4a00 - languageName: node - linkType: hard - "source-map-loader@npm:4.0.1": version: 4.0.1 resolution: "source-map-loader@npm:4.0.1" @@ -44605,6 +44592,19 @@ __metadata: languageName: node linkType: hard +"source-map-loader@npm:^3.0.0": + version: 3.0.2 + resolution: "source-map-loader@npm:3.0.2" + dependencies: + abab: ^2.0.5 + iconv-lite: ^0.6.3 + source-map-js: ^1.0.1 + peerDependencies: + webpack: ^5.0.0 + checksum: d5a4e2ab190c93ae5cba68c247fbaa9fd560333c91060602b634c399a8a4b3205b8c07714c3bcdb0a11c6cc5476c06256bd8e824e71fbbb7981e8fad5cba4a00 + languageName: node + linkType: hard + "source-map-resolve@npm:^0.5.0": version: 0.5.3 resolution: "source-map-resolve@npm:0.5.3"