From 24b5888247d134ea417fc0e83dccc9826b4075f3 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Fri, 12 Jul 2024 13:18:39 -0700 Subject: [PATCH] refactor: retire connector plugin specific container images, fix docs BREAKING CHANGE: Container images are being deleted here and will also get deleted from GHCR. Though the public APIs of the Typescript code do not change, still, some parts of the documentation will become invalid until we update it to match the changes here. I invested a large amount of effort into doing this documentation update as part of this change but it is very likely that I've missed a few spots and therefore it is best to mark this as a breaking change in my opinion to call attention to the fact that we still have ways to go with updating the documentation around these container images. 1. Deleted all the container images that were just wrappers around the cmd-api-server container image installing their own npm package from the registry. The reason for this is that they ended up just being maintenance burden since we can achieve the exact same things just by re-using the API server's container image directly. 2. This way we don't have to deal with CVEs in 10x container images when it's really just the one container image that we use as the base that needs to deal with them anyway. 3. I also spent quite a bit of effort in this change to update the README.md files of the packages where previously we had plugin specific container images defined so that the README.md files have the tutorials that are more up to date compared to how they were (most of them had the tutorials completely broken for a long while which was causing a lot of difficulties to the newcomers who were trying to work with the packages). 4. The reason why they got so out of date traces back to the undue maintenance burden of keeping separate images for each connector plugin. We hope that with this simplification we can keep the documentation continuously up to date since it will require less time do so. 5. Also deleted the ci.yaml container building jobs which were relevant to the scope of this change so that we also save on CI resources, another long-running project that's been in need of some attention from the maintainers. Signed-off-by: Peter Somogyvari --- .github/workflows/ci.yaml | 39 --- .gitignore | 1 + .../cactus-plugin-ledger-connector-besu.md | 2 +- .../cactus-plugin-ledger-connector-fabric.md | 2 +- .../README.md | 2 +- .../cactus-plugin-object-store-ipfs/README.md | 2 +- packages/cacti-ledger-browser/README.md | 2 +- .../Dockerfile | 5 - .../README.md | 75 +++-- .../cactus-plugin-htlc-eth-besu/README.md | 2 +- .../cactus-plugin-keychain-aws-sm/README.md | 2 +- .../README.md | 2 +- .../Dockerfile | 9 - .../README.md | 86 +++-- .../Dockerfile | 5 - .../README.md | 40 ++- .../Dockerfile | 5 - .../README.md | 118 ++++--- .../Dockerfile | 7 - .../README.md | 304 +++++++++++------- .../README.md | 2 +- .../README.md | 2 +- .../Dockerfile | 10 - .../README.md | 63 +--- .../Dockerfile | 5 - .../README.md | 69 ++-- .../README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- packages/cactus-plugin-satp-hermes/README.md | 2 +- packages/cactus-test-geth-ledger/README.md | 2 +- 32 files changed, 429 insertions(+), 444 deletions(-) delete mode 100644 packages/cacti-plugin-ledger-connector-stellar/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-besu/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-cdl/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-ethereum/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-fabric/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-polkadot/Dockerfile delete mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e501c6263..9aeb172065 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2528,25 +2528,6 @@ jobs: - uses: actions/checkout@v4.1.1 - name: ghcr.io/hyperledger/cactus-besu-all-in-one run: DOCKER_BUILDKIT=1 docker build ./tools/docker/besu-all-in-one/ -f ./tools/docker/besu-all-in-one/Dockerfile - ghcr-connector-besu: - needs: - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-besu-changed == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.1 - - name: ghcr.io/hyperledger/cactus-connector-besu - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-besu/ -f ./packages/cactus-plugin-ledger-connector-besu/Dockerfile -t cactus-connector-besu - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} - name: Run Trivy vulnerability scan for cactus-connector-besu - uses: aquasecurity/trivy-action@0.19.0 - with: - image-ref: 'cactus-connector-besu' - format: 'table' - exit-code: '1' - ignore-unfixed: false - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' ghcr-connector-corda-server: runs-on: ubuntu-22.04 needs: @@ -2567,26 +2548,6 @@ jobs: ignore-unfixed: false vuln-type: 'os,library' severity: 'CRITICAL,HIGH' - ghcr-connector-fabric: - runs-on: ubuntu-22.04 - needs: - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-fabric-changed == 'true' - - steps: - - uses: actions/checkout@v4.1.1 - - name: ghcr.io/hyperledger/cactus-connector-fabric - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-fabric/ -f ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile -t cactus-connector-fabric - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} - name: Run Trivy vulnerability scan for cactus-connector-fabric - uses: aquasecurity/trivy-action@0.19.0 - with: - image-ref: 'cactus-connector-fabric' - format: 'table' - exit-code: '1' - ignore-unfixed: false - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' ghcr-corda-all-in-one-flowdb: runs-on: ubuntu-22.04 steps: diff --git a/.gitignore b/.gitignore index 3a13ee5681..b8800f5aa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.cacti-config.json .config.json .nyc_output/ dist/ diff --git a/docs/docs/cactus/packages/cactus-plugin-ledger-connector-besu.md b/docs/docs/cactus/packages/cactus-plugin-ledger-connector-besu.md index ed04b4716e..8d39cc7059 100644 --- a/docs/docs/cactus/packages/cactus-plugin-ledger-connector-besu.md +++ b/docs/docs/cactus/packages/cactus-plugin-ledger-connector-besu.md @@ -299,7 +299,7 @@ Contributing We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](#../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](#../../CONTRIBUTING.md) to get started. License ------------------------------------------------ diff --git a/docs/docs/cactus/packages/cactus-plugin-ledger-connector-fabric.md b/docs/docs/cactus/packages/cactus-plugin-ledger-connector-fabric.md index 00e5b5b9a4..9a0fd4470f 100644 --- a/docs/docs/cactus/packages/cactus-plugin-ledger-connector-fabric.md +++ b/docs/docs/cactus/packages/cactus-plugin-ledger-connector-fabric.md @@ -525,7 +525,7 @@ This file lists all the prometheus metrics and what they are used for. We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](#../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](#../../CONTRIBUTING.md) to get started. 6\. License ---------------------------------------------------- diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/README.md b/extensions/cactus-plugin-htlc-coordinator-besu/README.md index a5fad51f31..cba1542e13 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/README.md +++ b/extensions/cactus-plugin-htlc-coordinator-besu/README.md @@ -96,7 +96,7 @@ shows the sequence diagram of a complete flow for a participant who wants exchan We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/extensions/cactus-plugin-object-store-ipfs/README.md b/extensions/cactus-plugin-object-store-ipfs/README.md index 7f5872bcc3..d1ee4aba7d 100644 --- a/extensions/cactus-plugin-object-store-ipfs/README.md +++ b/extensions/cactus-plugin-object-store-ipfs/README.md @@ -99,7 +99,7 @@ const timestamp = response.data.checkedAt; ## Contributing We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](https://github.com/hyperledger/cactus/blob/main/CONTRIBUTING.md "CONTIRBUTING.md") to get started. +Please review [CONTRIBUTING.md](https://github.com/hyperledger/cactus/blob/main/CONTRIBUTING.md "CONTRIBUTING.md") to get started. ## License This distribution is published under the Apache License Version 2.0 found in the [LICENSE ](https://github.com/hyperledger/cactus/blob/main/LICENSE "LICENSE ")file. diff --git a/packages/cacti-ledger-browser/README.md b/packages/cacti-ledger-browser/README.md index ee09071e1c..8dd06fd879 100644 --- a/packages/cacti-ledger-browser/README.md +++ b/packages/cacti-ledger-browser/README.md @@ -64,7 +64,7 @@ psql "postgres://postgres.DB_NAME:DB_PASS@aws-0-eu-central-1.pooler.supabase.com We welcome contributions to Hyperledger Cacti in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cacti-plugin-ledger-connector-stellar/Dockerfile b/packages/cacti-plugin-ledger-connector-stellar/Dockerfile deleted file mode 100644 index daa74e2fa5..0000000000 --- a/packages/cacti-plugin-ledger-connector-stellar/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:2024-03-18-8ddc02d - -ARG NPM_PKG_VERSION=latest - -RUN npm i @hyperledger/cacti-plugin-ledger-connector-stellar@${NPM_PKG_VERSION} --production diff --git a/packages/cacti-plugin-ledger-connector-stellar/README.md b/packages/cacti-plugin-ledger-connector-stellar/README.md index 58a2f28d8f..1b7b66b1ec 100644 --- a/packages/cacti-plugin-ledger-connector-stellar/README.md +++ b/packages/cacti-plugin-ledger-connector-stellar/README.md @@ -150,20 +150,6 @@ const res = await connector.runSorobanTransaction({ }); ``` -### Building/running the container image locally - -In the Cacti project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cacti-plugin-ledger-connector-stellar/Dockerfile . --tag cplcs --tag cacti-plugin-ledger-connector-stellar -``` - -Build with a specific version of the npm package: - -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=2.0.0-rc.2 -f ./packages/cacti-plugin-ledger-connector-stellar/Dockerfile . --tag cplcs --tag cacti-plugin-ledger-connector-stellar -``` - #### Running the container Launch container with plugin configuration as an **environment variable**: @@ -173,36 +159,71 @@ docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --env PLUGINS='[{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "instanceId": "some-unique-stellar-connector-instance-id"}}]' \ - cplcs + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --env PLUGINS='[{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "instanceId": "some-unique-stellar-connector-instance-id", "networkConfig": {}}}]' \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 ``` +> Notice that in the command above we've left the `networkConfig` parameter as +> an empty object. If you'd like the Stellar connector plugin to connect to +> a specific ledger then fill out the details of `networkConfig` accordingly. + Launch container with plugin configuration as a **CLI argument**: ```sh docker run \ --rm \ --publish 3000:3000 \ - --publish 4000:4000 \ - cplcs \ - ./node_modules/.bin/cactusapi \ - --plugins='[{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "instanceId": "some-unique-stellar-connector-instance-id"}}]' + --publish 4000:4000 \ + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "networkConfig":{}, "instanceId": "some-unique-stellar-connector-instance-id"}}]' ``` Launch container with **configuration file** mounted from host machine: ```sh +echo '{"plugins": [{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "networkConfig":{}, "instanceId": "some-unique-stellar-connector-instance-id"}}]}' > .cacti-config.json +``` -echo '[{"packageName": "@hyperledger/cacti-plugin-ledger-connector-stellar", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": { "instanceId": "some-unique-stellar-connector-instance-id"}}]' > cactus.json - +```sh docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcs \ - ./node_modules/.bin/cactusapi \ - --config-file=/cactus.json + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --mount type=bind,source="$(pwd)"/.cacti-config.json,target=/.cacti-config.json \ + cas \ + node index.js \ + --config-file=/.cacti-config.json ``` #### Testing API calls with the container @@ -293,7 +314,7 @@ yarn jest packages/cacti-plugin-ledger-connector-stellar/ We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-htlc-eth-besu/README.md b/packages/cactus-plugin-htlc-eth-besu/README.md index 51b67eb709..0783018dfa 100644 --- a/packages/cactus-plugin-htlc-eth-besu/README.md +++ b/packages/cactus-plugin-htlc-eth-besu/README.md @@ -47,7 +47,7 @@ Run ALL the solidity tests: `forge test -vvvv` We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## Nohoist configuration Foundry uses ``forge-std``and ``ds-test``modules for testing purposes. Given that Foundry cannot access files outside of the project, we use nohoist to force lerna to download the packages within the Forge project directory: diff --git a/packages/cactus-plugin-keychain-aws-sm/README.md b/packages/cactus-plugin-keychain-aws-sm/README.md index 2671205bac..c76ac004ad 100644 --- a/packages/cactus-plugin-keychain-aws-sm/README.md +++ b/packages/cactus-plugin-keychain-aws-sm/README.md @@ -158,7 +158,7 @@ This file lists all the prometheus metrics and what they are used for. We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## 5. License diff --git a/packages/cactus-plugin-ledger-connector-aries/README.md b/packages/cactus-plugin-ledger-connector-aries/README.md index 2e7b4dd9ef..1a9dca3e5b 100644 --- a/packages/cactus-plugin-ledger-connector-aries/README.md +++ b/packages/cactus-plugin-ledger-connector-aries/README.md @@ -167,7 +167,7 @@ npx jest cactus-plugin-ledger-connector-aries We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ### TODO diff --git a/packages/cactus-plugin-ledger-connector-besu/Dockerfile b/packages/cactus-plugin-ledger-connector-besu/Dockerfile deleted file mode 100644 index 737cdc9cbb..0000000000 --- a/packages/cactus-plugin-ledger-connector-besu/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:2024-03-18-8ddc02d -RUN npm install -g yarn \ - && yarn set version 4.1.0 \ - && yarn config set nodeLinker node-modules - -ENV NODE_ENV=production -ARG NPM_PKG_VERSION=latest - -RUN yarn add @hyperledger/cactus-plugin-ledger-connector-besu@${NPM_PKG_VERSION} --exact diff --git a/packages/cactus-plugin-ledger-connector-besu/README.md b/packages/cactus-plugin-ledger-connector-besu/README.md index 89c25a74f4..570fe6fa6e 100644 --- a/packages/cactus-plugin-ledger-connector-besu/README.md +++ b/packages/cactus-plugin-ledger-connector-besu/README.md @@ -128,19 +128,6 @@ Call example to deploy a private contract: > Extensive documentation and examples in the [readthedocs](https://readthedocs.org/projects/hyperledger-cactus/) (WIP) -### Building/running the container image locally - -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-besu/Dockerfile . -t cplcb -``` - -Build with a specific version of the npm package: -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=1.0.0 -f ./packages/cactus-plugin-ledger-connector-besu/Dockerfile . -t cplcb -``` - #### Running the container Launch container with plugin configuration as an **environment variable**: @@ -152,10 +139,16 @@ docker run \ --env AUTHORIZATION_PROTOCOL='NONE' \ --env AUTHORIZATION_CONFIG_JSON='{}' \ --env GRPC_TLS_ENABLED=false \ - cplcb \ - node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' \ - cplcb + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' ``` Launch container with plugin configuration as a **CLI argument**: @@ -163,25 +156,46 @@ Launch container with plugin configuration as a **CLI argument**: docker run \ --rm \ --publish 3000:3000 \ - --publish 4000:4000 \ - cplcb \ - ./node_modules/.bin/cactusapi \ + --publish 4000:4000 \ + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' ``` Launch container with **configuration file** mounted from host machine: ```sh +echo '{"plugins": [{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]}' > .cacti-config.json +``` -echo '[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' > cactus.json - +```sh docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcb \ - ./node_modules/.bin/cactusapi \ - --config-file=/cactus.json + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --mount type=bind,source="$(pwd)"/.cacti-config.json,target=/.cacti-config.json \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --config-file=/.cacti-config.json ``` #### Testing API calls with the container @@ -196,21 +210,29 @@ docker run \ --publish 0.0.0.0:8888:8888/tcp \ --publish 0.0.0.0:9001:9001/tcp \ --publish 0.0.0.0:9545:9545/tcp \ - ghcr.io/hyperledger/cactus-besu-all-in-one:2022-05-12-2330a96 + ghcr.io/hyperledger/cactus-besu-all-in-one:2024-07-04-8c030ae ``` -**Terminal Window 2 (Cactus API Server)** +**Terminal Window 2 (Cacti API Server)** ```sh docker run \ - --network host \ + --network=host \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ --env AUTHORIZATION_PROTOCOL='NONE' \ --env AUTHORIZATION_CONFIG_JSON='{}' \ --env GRPC_TLS_ENABLED=false \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' \ - cplcb + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-besu", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://127.0.0.1:8545", "rpcApiWsHost":"ws://127.0.0.1:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' ``` **Terminal Window 3 (curl - replace eth accounts as needed)** @@ -312,7 +334,7 @@ npm run test:plugin-ledger-connector-besu We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-cdl/Dockerfile b/packages/cactus-plugin-ledger-connector-cdl/Dockerfile deleted file mode 100644 index 9c333759da..0000000000 --- a/packages/cactus-plugin-ledger-connector-cdl/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:v1.0.0 - -ARG NPM_PKG_VERSION=latest - -RUN npm i @hyperledger/cactus-plugin-ledger-connector-cdl@${NPM_PKG_VERSION} --production diff --git a/packages/cactus-plugin-ledger-connector-cdl/README.md b/packages/cactus-plugin-ledger-connector-cdl/README.md index 71ba1559c7..35cdd735ab 100644 --- a/packages/cactus-plugin-ledger-connector-cdl/README.md +++ b/packages/cactus-plugin-ledger-connector-cdl/README.md @@ -8,13 +8,23 @@ This plugin provides `Cacti` a way to interact with Fujitsu CDL networks. Using ## Summary -- [Getting Started](#getting-started) -- [Usage](#usage) -- [ApiClient](#apiclient) -- [Runing the tests](#running-the-tests) -- [Contributing](#contributing) -- [License](#license) -- [Acknowledgments](#acknowledgments) +- [`@hyperledger/cactus-plugin-ledger-connector-cdl`](#hyperledgercactus-plugin-ledger-connector-cdl) + - [Summary](#summary) + - [Getting Started](#getting-started) + - [Prerequisites](#prerequisites) + - [Usage](#usage) + - [Configuration](#configuration) + - [Connector Setup](#connector-setup) + - [Gateway Setup](#gateway-setup) + - [Connector Methods](#connector-methods) + - [Methods](#methods) + - [ApiClient](#apiclient) + - [REST Functions](#rest-functions) + - [Running the tests](#running-the-tests) + - [Manual Tests](#manual-tests) + - [Contributing](#contributing) + - [License](#license) + - [Acknowledgments](#acknowledgments) ## Getting Started @@ -116,25 +126,11 @@ npx jest cactus-plugin-ledger-connector-cdl - `npx tsc` - `npx jest dist/lib/test/typescript/manual/cdl-connector-manual.test.js` -### Building/running the container image locally - -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-cdl/Dockerfile . -t CDL_connector -``` - -Build with a specific version of the npm package: - -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=0.4.1 -f ./packages/cactus-plugin-ledger-connector-cdl/Dockerfile . -t CDL_connector -``` - ## Contributing We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-ethereum/Dockerfile b/packages/cactus-plugin-ledger-connector-ethereum/Dockerfile deleted file mode 100644 index 1ea2ed65ce..0000000000 --- a/packages/cactus-plugin-ledger-connector-ethereum/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:v1.0.0 - -ARG NPM_PKG_VERSION=latest - -RUN npm i @hyperledger/cactus-plugin-ledger-connector-ethereum@${NPM_PKG_VERSION} --production diff --git a/packages/cactus-plugin-ledger-connector-ethereum/README.md b/packages/cactus-plugin-ledger-connector-ethereum/README.md index 82491dcf56..9b4fb19431 100644 --- a/packages/cactus-plugin-ledger-connector-ethereum/README.md +++ b/packages/cactus-plugin-ledger-connector-ethereum/README.md @@ -255,24 +255,10 @@ artillery run ./.manual-geth-artillery-config.yaml - `./src/test/typescript/benchmark/cli` - `run-benchmark-environment.ts` CLI for starting test environment and patching template artillery config -### Building/running the container image locally - -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-ethereum/Dockerfile . -t cplcb -``` - -Build with a specific version of the npm package: - -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=0.4.1 -f ./packages/cactus-plugin-ledger-connector-ethereum/Dockerfile . -t cplcb -``` #### Running the container Launch container with plugin configuration as an **environment variable**: - ```sh docker run \ --rm \ @@ -280,64 +266,104 @@ docker run \ --publish 4000:4000 \ --env AUTHORIZATION_PROTOCOL='NONE' \ --env AUTHORIZATION_CONFIG_JSON='{}' \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-ethereum-connector-instance-id"}}]' \ - cplcb + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-ethereum-connector-instance-id"}}]' ``` Launch container with plugin configuration as a **CLI argument**: - ```sh docker run \ --rm \ --publish 3000:3000 \ - --publish 4000:4000 \ - cplcb \ - ./node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --authorization-protocol='NONE' \ - --authorization-config-json='{}' \ - --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-ethereum-connector-instance-id"}}]' + --publish 4000:4000 \ + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId": "some-unique-ethereum-connector-instance-id"}}]' ``` Launch container with **configuration file** mounted from host machine: - ```sh +echo '{"plugins": [{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://127.0.0.1:8545", "rpcApiWsHost":"ws://127.0.0.1:8546", "instanceId": "some-unique-ethereum-connector-instance-id"}}]}' > .cacti-config.json +``` -echo '{"authorizationProtocol":"NONE","authorizationConfigJson":{},"plugins":[{"packageName":"@hyperledger/cactus-plugin-ledger-connector-ethereum","type":"org.hyperledger.cactus.plugin_import_type.LOCAL","action":"org.hyperledger.cactus.plugin_import_action.INSTALL","options":{"rpcApiHttpHost":"http://localhost:8545","instanceId":"some-unique-ethereum-connector-instance-id"}}]}' > cactus.json - +```sh docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcb \ - ./node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --config-file=/cactus.json + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --mount type=bind,source="$(pwd)"/.cacti-config.json,target=/.cacti-config.json \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --config-file=/.cacti-config.json ``` #### Testing API calls with the container -Don't have a ethereum network on hand to test with? Test or develop against our ethereum All-In-One container! +Don't have a Ethereum network on hand to test with? Test or develop against our Besu All-In-One container! **Terminal Window 1 (Ledger)** - ```sh -docker run -p 0.0.0.0:8545:8545/tcp -p 0.0.0.0:8546:8546/tcp -p 0.0.0.0:8888:8888/tcp -p 0.0.0.0:9001:9001/tcp -p 0.0.0.0:9545:9545/tcp hyperledger/cactus-quorum-all-in-one:latest +docker run \ + --publish 0.0.0.0:8545:8545/tcp \ + --publish 0.0.0.0:8546:8546/tcp \ + --publish 0.0.0.0:8888:8888/tcp \ + --publish 0.0.0.0:9001:9001/tcp \ + --publish 0.0.0.0:9545:9545/tcp \ + ghcr.io/hyperledger/cactus-besu-all-in-one:2024-07-04-8c030ae ``` -**Terminal Window 2 (Cactus API Server)** - +**Terminal Window 2 (Cacti API Server)** ```sh docker run \ - --network host \ + --network=host \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-ethereum-connector-instance-id"}}]' \ - cplcb + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-ethereum", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://127.0.0.1:8545", "rpcApiWsHost":"ws://127.0.0.1:8546", "instanceId": "some-unique-besu-connector-instance-id"}}]' ``` **Terminal Window 3 (curl - replace eth accounts as needed)** - ```sh curl --location --request POST 'http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction' \ --header 'Content-Type: application/json' \ @@ -347,19 +373,17 @@ curl --location --request POST 'http://127.0.0.1:4000/api/v1/plugins/@hyperledge "secret": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", "type": "PRIVATE_KEY_HEX" }, - "consistencyStrategy": { - "blockConfirmations": 0, - "receiptType": "NODE_TX_POOL_ACK" - }, "transactionConfig": { "from": "627306090abaB3A6e1400e9345bC60c78a8BEf57", "to": "f17f52151EbEF6C7334FAD080c5704D77216b732", - "value": 1, - "gas": 10000000 + "value": "1", + "maxPriorityFeePerGas": "0", + "maxFeePerGas": "40000000", + "gasLimit": "21000", + "type": 2 } }' ``` - The above should produce a response that looks similar to this: ```json @@ -439,7 +463,7 @@ There's a simple script for checking integration with [alchemy platform](https:/ We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-fabric/Dockerfile b/packages/cactus-plugin-ledger-connector-fabric/Dockerfile deleted file mode 100644 index a314b81d30..0000000000 --- a/packages/cactus-plugin-ledger-connector-fabric/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:2023-12-21-f8f6bcb - -RUN npm install -g yarn@1.22.17 - -ARG NPM_PKG_VERSION=latest - -RUN yarn add @hyperledger/cactus-plugin-ledger-connector-fabric@${NPM_PKG_VERSION} --production --ignore-engines diff --git a/packages/cactus-plugin-ledger-connector-fabric/README.md b/packages/cactus-plugin-ledger-connector-fabric/README.md index e7489b0479..8395cea592 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/README.md +++ b/packages/cactus-plugin-ledger-connector-fabric/README.md @@ -20,8 +20,7 @@ - [2. Architecture](#2-architecture) - [2.1. run-transaction-endpoint](#21-run-transaction-endpoint) - [3. Containerization](#3-containerization) - - [3.1. Building/running the container image locally](#31-buildingrunning-the-container-image-locally) - - [3.2. Running the container](#32-running-the-container) + - [3.1. Running the container](#31-running-the-container) - [3.3. Testing API calls with the container](#33-testing-api-calls-with-the-container) - [4. Prometheus Exporter](#4-prometheus-exporter) - [4.1. Usage Prometheus](#41-usage-prometheus) @@ -399,20 +398,8 @@ The above diagram shows the sequence diagram of enroll() method of the PluginLed ## 3. Containerization -### 3.1. Building/running the container image locally -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile . -t cplcb -``` - -Build with a specific version of the npm package: -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=0.4.1 -f ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile . -t cplcb -``` - -### 3.2. Running the container +### 3.1. Running the container Launch container with plugin configuration as an **environment variable**: ```sh @@ -420,22 +407,46 @@ docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"instanceId": "some-unique-fabric-connector-instance-id", "dockerBinary": "usr/local/bin/docker","cliContainerEnv": { - "CORE_PEER_LOCALMSPID": "Org1MSP", - "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", - "CORE_PEER_MSPCONFIGPATH": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", - "CORE_PEER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", - "ORDERER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" - }, - "discoveryOptions": { - "enabled": true, - "asLocalhost": true + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --env PLUGINS='[ + { + "packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", + "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", + "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", + "options": { + "instanceId": "some-unique-fabric-connector-instance-id", + "dockerBinary": "usr/local/bin/docker", + "peerBinary": "/fabric-samples/bin/peer", + "connectionProfile": { + "name": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "version": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "organizations": {}, + "peers": {} + }, + "cliContainerEnv": { + "CORE_PEER_LOCALMSPID": "Org1MSP", + "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", + "CORE_PEER_MSPCONFIGPATH": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", + "CORE_PEER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", + "ORDERER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + }, + "discoveryOptions": { + "enabled": true, + "asLocalhost": true + } + } } - }}}]' \ - cplcb +]' \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 ``` Launch container with plugin configuration as a **CLI argument**: @@ -443,53 +454,103 @@ Launch container with plugin configuration as a **CLI argument**: docker run \ --rm \ --publish 3000:3000 \ - --publish 4000:4000 \ - cplcb \ - ./node_modules/.bin/cactusapi \ - --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"instanceId": "some-unique-fabric-connector-instance-id", "dockerBinary": "usr/local/bin/docker","cliContainerEnv": { - "CORE_PEER_LOCALMSPID": "Org1MSP", - "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", - "CORE_PEER_MSPCONFIGPATH": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", - "CORE_PEER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", - "ORDERER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" - }, - "discoveryOptions": { - "enabled": true, - "asLocalhost": true - } - }}}]' + --publish 4000:4000 \ + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --plugins='[ + { + "packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", + "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", + "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", + "options": { + "instanceId": "some-unique-fabric-connector-instance-id", + "dockerBinary": "usr/local/bin/docker", + "peerBinary": "/fabric-samples/bin/peer", + "connectionProfile": { + "name": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "version": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "organizations": {}, + "peers": {} + }, + "cliContainerEnv": { + "CORE_PEER_LOCALMSPID": "Org1MSP", + "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", + "CORE_PEER_MSPCONFIGPATH": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", + "CORE_PEER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", + "ORDERER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + }, + "discoveryOptions": { + "enabled": true, + "asLocalhost": true + } + } + } + ]' ``` Launch container with **configuration file** mounted from host machine: ```sh +echo '{"plugins": [ + { + "packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", + "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", + "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", + "options": { + "instanceId": "some-unique-fabric-connector-instance-id", + "dockerBinary": "usr/local/bin/docker", + "peerBinary": "/fabric-samples/bin/peer", + "connectionProfile": { + "name": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "version": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "organizations": {}, + "peers": {} + }, + "cliContainerEnv": { + "CORE_PEER_LOCALMSPID": "Org1MSP", + "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", + "CORE_PEER_MSPCONFIGPATH": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", + "CORE_PEER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", + "ORDERER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + }, + "discoveryOptions": { + "enabled": true, + "asLocalhost": true + } + } + }] +}' > .cacti-config.json -echo '[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"instanceId": "some-unique-fabric-connector-instance-id", "dockerBinary": "usr/local/bin/docker","cliContainerEnv": { - "CORE_PEER_LOCALMSPID": "Org1MSP", - "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", - "CORE_PEER_MSPCONFIGPATH": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", - "CORE_PEER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", - "ORDERER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" - }, - "discoveryOptions": { - "enabled": true, - "asLocalhost": true - } - }}}]' > cactus.json +``` +```sh docker run \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcb \ - ./node_modules/.bin/cactusapi \ - --config-file=/cactus.json + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --mount type=bind,source="$(pwd)"/.cacti-config.json,target=/.cacti-config.json \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 \ + node index.js \ + --config-file=/.cacti-config.json ``` ### 3.3. Testing API calls with the container @@ -498,68 +559,91 @@ Don't have a fabric network on hand to test with? Test or develop against our fa **Terminal Window 1 (Ledger)** ```sh -docker run --privileged -p 0.0.0.0:8545:8545/tcp -p 0.0.0.0:8546:8546/tcp -p 0.0.0.0:8888:8888/tcp -p 0.0.0.0:9001:9001/tcp -p 0.0.0.0:9545:9545/tcp ghcr.io/hyperledger/cactus-fabric-all-in-one:v1.0.0-rc.2 +docker run \ + --privileged \ + --publish 0.0.0.0:8545:8545/tcp \ + --publish 0.0.0.0:8546:8546/tcp \ + --publish 0.0.0.0:8888:8888/tcp \ + --publish 0.0.0.0:9001:9001/tcp \ + --publish 0.0.0.0:9545:9545/tcp \ + ghcr.io/hyperledger/cactus-fabric2-all-in-one:2024-03-03--issue-2945-fabric-v2-5-6 ``` -**Terminal Window 2 (Cactus API Server)** +**Terminal Window 2 (Cacti API Server)** ```sh docker run \ - --network host \ + --network=host \ --rm \ --publish 3000:3000 \ --publish 4000:4000 \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"instanceId": "some-unique-fabric-connector-instance-id", "dockerBinary": "usr/local/bin/docker","cliContainerEnv": { - "CORE_PEER_LOCALMSPID": "Org1MSP", - "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", - "CORE_PEER_MSPCONFIGPATH": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", - "CORE_PEER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", - "ORDERER_TLS_ROOTCERT_FILE": - "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" - }, - "discoveryOptions": { - "enabled": true, - "asLocalhost": true + --env AUTHORIZATION_PROTOCOL='NONE' \ + --env AUTHORIZATION_CONFIG_JSON='{}' \ + --env GRPC_TLS_ENABLED=false \ + --env API_TLS_CERT_PEM=- \ + --env API_TLS_CLIENT_CA_PEM=- \ + --env API_TLS_KEY_PEM=- \ + --env API_TLS_ENABLED=false \ + --env API_MTLS_ENABLED=false \ + --env API_HOST=0.0.0.0 \ + --env LOG_LEVEL=INFO \ + --env PLUGINS='[ + { + "packageName": "@hyperledger/cactus-plugin-ledger-connector-fabric", + "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", + "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", + "options": { + "instanceId": "some-unique-fabric-connector-instance-id", + "dockerBinary": "usr/local/bin/docker", + "peerBinary": "/fabric-samples/bin/peer", + "connectionProfile": { + "name": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "version": "TODO-FILL-OUT-YOUR-CONNECTION-PROFILE-DETAILS", + "organizations": {}, + "peers": {} + }, + "cliContainerEnv": { + "CORE_PEER_LOCALMSPID": "Org1MSP", + "CORE_PEER_ADDRESS": "peer0.org1.example.com:7051", + "CORE_PEER_MSPCONFIGPATH": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp", + "CORE_PEER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt", + "ORDERER_TLS_ROOTCERT_FILE": "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + }, + "discoveryOptions": { + "enabled": true, + "asLocalhost": true + } + } } - }}}]' \ - cplcb +]' \ + ghcr.io/hyperledger/cactus-cmd-api-server:2024-07-03t18-38-45-dev-65adc3255 ``` -**Terminal Window 3 (curl - replace eth accounts as needed)** +FIXME: This does not work. We need to (at the very least) +1. add the a keychain plugin to the API server config +2. load the keychain up with credentials that can be used to access the Ledger +3. reference the keychain entry created in step 2 as the signing credential below. + +**Terminal Window 3 (cURL)** ```sh curl --location --request POST 'http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction' \ --header 'Content-Type: application/json' \ --data-raw '{ - channelName: "mychannel", - contractName: "contract-example"; - invocationType: "FabricContractInvocationType.SEND"; - methodName: "example" + "channelName": "mychannel", + "contractName": "basic", + "invocationType": "FabricContractInvocationType.SEND", + "params": ["some-unique-asset-id-1", "Green", "19", "Peter", "9999"], + "methodName": "CreateAsset", + "signingCredential": { + "keychainId": "FIXME", + "keychainRef": "FIXME" + } }' ``` The above should produce a response that looks similar to this: ```json -{ - "success": true, - "data": { - "transactionReceipt": { - "blockHash": "0x7c97c038a5d3bd84613fe23ed442695276d5d2df97f4e7c4f10ca06765033ffd", - "blockNumber": 1218, - "contractAddress": null, - "cumulativeGasUsed": 21000, - "from": "0x627306090abab3a6e1400e9345bc60c78a8bef57", - "gasUsed": 21000, - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "status": true, - "to": "0xf17f52151ebef6c7334fad080c5704d77216b732", - "transactionHash": "0xc7fcb46c735bdc696d500bfc70c72595a2b8c31813929e5c61d9a5aec3376d6f", - "transactionIndex": 0 - } - } -} +// FIXME ``` @@ -608,7 +692,7 @@ This file lists all the prometheus metrics and what they are used for. We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## 6. License diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/README.md b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/README.md index 436ce2263e..564e02cd13 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/README.md +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/README.md @@ -80,7 +80,7 @@ npm run start We welcome contributions to Hyperledger Cactus in many forms, and there's always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-iroha2/README.md b/packages/cactus-plugin-ledger-connector-iroha2/README.md index 25aeef37aa..b4ef857649 100644 --- a/packages/cactus-plugin-ledger-connector-iroha2/README.md +++ b/packages/cactus-plugin-ledger-connector-iroha2/README.md @@ -300,7 +300,7 @@ npx jest cactus-plugin-ledger-connector-iroha2 We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ### Quick connector project walkthrough diff --git a/packages/cactus-plugin-ledger-connector-polkadot/Dockerfile b/packages/cactus-plugin-ledger-connector-polkadot/Dockerfile deleted file mode 100644 index d3f0a96727..0000000000 --- a/packages/cactus-plugin-ledger-connector-polkadot/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:2024-01-02-1fb2551 - -RUN npm install -g yarn \ - && yarn set version 3.6.3 \ - && yarn config set nodeLinker node-modules - -ENV NODE_ENV=production -ARG NPM_PKG_VERSION=latest - -RUN yarn add @hyperledger/cactus-plugin-ledger-connector-polkadot@${NPM_PKG_VERSION} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-polkadot/README.md b/packages/cactus-plugin-ledger-connector-polkadot/README.md index 0af673825c..85dd368056 100644 --- a/packages/cactus-plugin-ledger-connector-polkadot/README.md +++ b/packages/cactus-plugin-ledger-connector-polkadot/README.md @@ -9,8 +9,7 @@ - [2. Architecture](#2-architecture) - [2.1. run-transaction-endpoint](#21-run-transaction-endpoint) - [3. Containerization](#3-containerization) - - [3.1. Building/running the container image locally](#31-buildingrunning-the-container-image-locally) - - [3.2. Running the container](#32-running-the-container) + - [3.1. Running the container](#31-running-the-container) - [4. Prometheus Exporter](#4-prometheus-exporter) - [4.1. Usage Prometheus](#41-usage-prometheus) - [4.2. Prometheus Integration](#42-prometheus-integration) @@ -124,68 +123,20 @@ The above diagram shows transactSigned() method being called by the transact() m ## 3. Containerization -### 3.1. Building/running the container image locally -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-polkadot/Dockerfile . -t cplcb -``` - -Build with a specific version of the npm package: -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=latest -f ./packages/cactus-plugin-ledger-connector-polkadot/Dockerfile . -t cplcb -``` - -### 3.2. Running the container +### 3.1. Running the container Launch container with plugin configuration as an **environment variable**: -```sh -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - --env AUTHORIZATION_PROTOCOL='NONE' \ - --env AUTHORIZATION_CONFIG_JSON='{}' \ - --env GRPC_TLS_ENABLED=false \ - cplcb \ - node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --env PLUGINS='[{"packageName": "cactus-plugin-ledger-connector-polkadot", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"wsProviderUrl":"ws://127.0.0.1:9944", "instanceId": "some-unique-polkadot-connector-instance-id"}}]' -``` +> FIXME Launch container with plugin configuration as a **CLI argument**: -```sh -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - --publish 5000:5000 \ - --env AUTHORIZATION_PROTOCOL='NONE' \ - --env AUTHORIZATION_CONFIG_JSON='{}' \ - --env GRPC_TLS_ENABLED=false \ - cplcb \ - node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --plugins='[{"packageName": "cactus-plugin-ledger-connector-polkadot", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"wsProviderUrl":"ws://127.0.0.1:9944", "instanceId": "some-unique-polkadot-connector-instance-id"}}]' -``` + +> FIXME Launch container with **configuration file** mounted from host machine: -```sh -echo '[{"packageName": "cactus-plugin-ledger-connector-polkadot", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"wsProviderUrl":"ws://127.0.0.1:9944", "instanceId": "some-unique-polkadot-connector-instance-id"}}]' > cactus.json - -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - --env AUTHORIZATION_PROTOCOL='NONE' \ - --env AUTHORIZATION_CONFIG_JSON='{}' \ - --env GRPC_TLS_ENABLED=false \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcb \ - node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --config-file=/cactus.json -``` +> FIXME ## 4. Prometheus Exporter @@ -231,7 +182,7 @@ This file lists all the Prometheus metrics and what they are used for. We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## 6. License diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile b/packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile deleted file mode 100644 index f1d13987bc..0000000000 --- a/packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/hyperledger/cactus-cmd-api-server:v1.0.0 - -ARG NPM_PKG_VERSION=latest - -RUN npm i @hyperledger/cactus-plugin-ledger-connector-sawtooth@${NPM_PKG_VERSION} --production diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/README.md b/packages/cactus-plugin-ledger-connector-sawtooth/README.md index fe15f4bf2d..3ddd4a03d0 100644 --- a/packages/cactus-plugin-ledger-connector-sawtooth/README.md +++ b/packages/cactus-plugin-ledger-connector-sawtooth/README.md @@ -7,13 +7,19 @@ This plugin provides `Cacti` a way to interact with Sawtooth networks. Using thi ## Summary -- [Getting Started](#getting-started) -- [Usage](#usage) -- [SawtoothApiClient](#sawtoothapiclient) -- [Runing the tests](#running-the-tests) -- [Contributing](#contributing) -- [License](#license) -- [Acknowledgments](#acknowledgments) +- [`@hyperledger/cactus-plugin-ledger-connector-sawtooth`](#hyperledgercactus-plugin-ledger-connector-sawtooth) + - [Summary](#summary) + - [Getting Started](#getting-started) + - [Prerequisites](#prerequisites) + - [Usage](#usage) + - [SawtoothApiClient](#sawtoothapiclient) + - [REST Functions](#rest-functions) + - [Asynchronous Functions (socket.io)](#asynchronous-functions-socketio) + - [Running the tests](#running-the-tests) + - [Running the container](#running-the-container) + - [Contributing](#contributing) + - [License](#license) + - [Acknowledgments](#acknowledgments) ## Getting Started @@ -74,70 +80,35 @@ To check that all has been installed correctly and that the plugin has no errors npx jest cactus-plugin-ledger-connector-sawtooth ``` -### Building/running the container image locally - -In the Cactus project root say: - -```sh -DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile . -t cplcb -``` - -Build with a specific version of the npm package: - -```sh -DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=0.4.1 -f ./packages/cactus-plugin-ledger-connector-sawtooth/Dockerfile . -t cplcb -``` - #### Running the container Launch container with plugin configuration as an **environment variable**: ```sh -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - --env AUTHORIZATION_PROTOCOL='NONE' \ - --env AUTHORIZATION_CONFIG_JSON='{}' \ - --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-sawtooth", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-sawtooth-connector-instance-id"}}]' \ - cplcb +# FIXME ``` Launch container with plugin configuration as a **CLI argument**: ```sh -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - cplcb \ - ./node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --authorization-protocol='NONE' \ - --authorization-config-json='{}' \ - --plugins='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-sawtooth", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL", "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-sawtooth-connector-instance-id"}}]' +# FIXME ``` Launch container with **configuration file** mounted from host machine: ```sh +# FIXME +``` -echo '{"authorizationProtocol":"NONE","authorizationConfigJson":{},"plugins":[{"packageName":"@hyperledger/cactus-plugin-ledger-connector-sawtooth","type":"org.hyperledger.cactus.plugin_import_type.LOCAL","action":"org.hyperledger.cactus.plugin_import_action.INSTALL","options":{"rpcApiHttpHost":"http://localhost:8545","instanceId":"some-unique-sawtooth-connector-instance-id"}}]}' > cactus.json - -docker run \ - --rm \ - --publish 3000:3000 \ - --publish 4000:4000 \ - --mount type=bind,source="$(pwd)"/cactus.json,target=/cactus.json \ - cplcb \ - ./node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js \ - --config-file=/cactus.json +```sh +# FIXME ``` ## Contributing We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/README.md b/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/README.md index d9cb61167b..25ab51f302 100644 --- a/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/README.md +++ b/packages/cactus-plugin-ledger-connector-tcs-huawei-socketio/README.md @@ -68,7 +68,7 @@ npm run start We welcome contributions to Hyperledger Cactus in many forms, and there's always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-ledger-connector-xdai/README.md b/packages/cactus-plugin-ledger-connector-xdai/README.md index 25751b5b93..e6c110a9bd 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/README.md +++ b/packages/cactus-plugin-ledger-connector-xdai/README.md @@ -151,7 +151,7 @@ npm run test:plugin-ledger-connector-xdai We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License diff --git a/packages/cactus-plugin-persistence-ethereum/README.md b/packages/cactus-plugin-persistence-ethereum/README.md index e3db7cec59..fd1b1e6af1 100644 --- a/packages/cactus-plugin-persistence-ethereum/README.md +++ b/packages/cactus-plugin-persistence-ethereum/README.md @@ -175,7 +175,7 @@ npx jest cactus-plugin-persistence-ethereum We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ### Quick plugin project walkthrough diff --git a/packages/cactus-plugin-persistence-fabric/README.md b/packages/cactus-plugin-persistence-fabric/README.md index a31cace9ad..152f7772ea 100644 --- a/packages/cactus-plugin-persistence-fabric/README.md +++ b/packages/cactus-plugin-persistence-fabric/README.md @@ -152,7 +152,7 @@ npx jest cactus-plugin-fabric-persistence-block We welcome contributions to Hyperledger Cacti in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ### Quick plugin project walkthrough diff --git a/packages/cactus-plugin-satp-hermes/README.md b/packages/cactus-plugin-satp-hermes/README.md index 6ab940d3ce..ebfb4b7ca9 100644 --- a/packages/cactus-plugin-satp-hermes/README.md +++ b/packages/cactus-plugin-satp-hermes/README.md @@ -152,7 +152,7 @@ Note that these gateways are extensions of the [default ODAP Gateway class](http ## Contributing We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](https://github.com/hyperledger/cactus/blob/main/CONTRIBUTING.md "CONTIRBUTING.md") to get started. +Please review [CONTRIBUTING.md](https://github.com/hyperledger/cactus/blob/main/CONTRIBUTING.md "CONTRIBUTING.md") to get started. ## License This distribution is published under the Apache License Version 2.0 found in the [LICENSE ](https://github.com/hyperledger/cactus/blob/main/LICENSE "LICENSE ")file. diff --git a/packages/cactus-test-geth-ledger/README.md b/packages/cactus-test-geth-ledger/README.md index 638e1f0ca9..a6d737a451 100644 --- a/packages/cactus-test-geth-ledger/README.md +++ b/packages/cactus-test-geth-ledger/README.md @@ -65,7 +65,7 @@ npx jest cactus-test-geth-ledger We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! -Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. +Please review [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. ## License