Skip to content

Commit

Permalink
Merge branch 'hyperledger:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zondervancalvez authored Aug 21, 2023
2 parents 315f0ed + 38502b5 commit d66614d
Show file tree
Hide file tree
Showing 204 changed files with 20,124 additions and 4,919 deletions.
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"cafile",
"caio",
"cccs",
"cbdc",
"Cbdc",
"ccid",
"celo",
"cids",
Expand Down Expand Up @@ -60,6 +62,7 @@
"htlc",
"Htlc",
"HTLC",
"Hursley",
"HyperLedger",
"ipaddress",
"ipfs",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
JEST_TEST_PATTERN: packages/cactus-cmd-api-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts
JEST_TEST_RUNNER_DISABLED: false
TAPE_TEST_PATTERN: >-
--files={./packages/cactus-cmd-api-server/src/test/typescript/benchmark/artillery-api-benchmark.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/jwt-socketio-endpoint-authorization.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-from-github.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-without-install.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/remote-plugin-imports.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/certificates-work-for-mutual-tls.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/generates-working-certificates.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-js-proto-loader-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-m-tls-enabled.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-consortium-manual.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-keychain-memory.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-quorum-0-7-0.test.ts}
--files={./packages/cactus-cmd-api-server/src/test/typescript/benchmark/artillery-api-benchmark.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-from-github.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-without-install.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/remote-plugin-imports.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/certificates-work-for-mutual-tls.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/generates-working-certificates.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-js-proto-loader-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-m-tls-enabled.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-consortium-manual.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-keychain-memory.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-quorum-0-7-0.test.ts}
TAPE_TEST_RUNNER_DISABLED: false
needs: build-dev
runs-on: ubuntu-20.04
Expand Down
1 change: 0 additions & 1 deletion .taprc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ files:
- ./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/get-single-status-endpoint.test.ts
- ./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/openapi/openapi-validation.test.ts
- ./packages/cactus-cmd-api-server/src/test/typescript/benchmark/artillery-api-benchmark.test.ts
- ./packages/cactus-cmd-api-server/src/test/typescript/integration/jwt-socketio-endpoint-authorization.test.ts
- ./packages/cactus-cmd-api-server/src/test/typescript/integration/remote-plugin-imports.test.ts
- ./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-from-github.test.ts
- ./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-without-install.test.ts
Expand Down
25 changes: 25 additions & 0 deletions .vscode/template.launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
},
{
"name": "Example: CBDC Bridging Fabric-EVM App",
"type": "node",
"request": "launch",
"protocol": "inspector",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
},
"args": [
"${workspaceFolder}/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/cbdc-bridging-app-cli.ts",
"dotenv_config_path=${workspaceFolder}/examples/cactus-example-cbdc-bridging-backend/process.env"
],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"dotenv/config"
],
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
}
]
}
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: { "footer-max-line-length": [1, "always", 100] },
parserPreset: {
parserOpts: {
noteKeywords: ["\\[\\d+\\]"],
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
},
"devDependencies": {
"@types/escape-html": "1.0.1",
"@types/node": "15.14.7"
"@types/node": "15.14.9"
}
}
14 changes: 7 additions & 7 deletions examples/cactus-example-carbon-accounting-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"author": {
"name": "Hyperledger Cactus Contributors",
"email": "[email protected]",
"url": "https://www.hyperledger.org/use/cactus"
"url": "https://www.hyperledger.org/use/cacti"
},
"contributors": [
{
Expand Down Expand Up @@ -62,11 +62,11 @@
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-ledger-connector-xdai": "2.0.0-alpha.1",
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1",
"@openzeppelin/contracts": "4.9.2",
"@openzeppelin/contracts-upgradeable": "4.9.2",
"@openzeppelin/contracts": "4.9.3",
"@openzeppelin/contracts-upgradeable": "4.9.3",
"async-exit-hook": "2.0.1",
"fabric-network": "2.2.10",
"fs-extra": "10.0.0",
"fabric-network": "2.2.18",
"fs-extra": "10.1.0",
"openapi-types": "9.1.0",
"typescript-optional": "2.0.1",
"uuid": "8.3.2",
Expand All @@ -75,9 +75,9 @@
},
"devDependencies": {
"@types/express": "4.17.13",
"@types/fs-extra": "9.0.12",
"@types/fs-extra": "9.0.13",
"@types/json-stable-stringify": "1.0.34",
"@types/uuid": "8.3.1",
"@types/uuid": "8.3.4",
"express-jwt": "8.4.1",
"hardhat": "2.13.1",
"http-status-codes": "2.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/chai": "4.3.5",
"@types/crypto-js": "4.1.1",
"@types/mocha": "8.2.2",
"@types/node": "16.18.40",
"@types/node": "16.18.41",
"@types/rewire": "2.5.28",
"chai": "4.3.7",
"mocha": "8.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"author": {
"name": "Hyperledger Cactus Contributors",
"email": "[email protected]",
"url": "https://www.hyperledger.org/use/cactus"
"url": "https://www.hyperledger.org/use/cacti"
},
"contributors": [
{
Expand Down Expand Up @@ -73,7 +73,7 @@
"devDependencies": {
"@types/express": "4.17.13",
"@types/ssh2": "0.5.47",
"@types/uuid": "8.3.1"
"@types/uuid": "8.3.4"
},
"engines": {
"node": ">=10",
Expand Down
Empty file.
69 changes: 69 additions & 0 deletions examples/cactus-example-cbdc-bridging-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM cruizba/ubuntu-dind:19.03.11

USER root

RUN apt-get update
RUN apt -y upgrade

# Need curl for healthchecks
RUN apt-get -y install --no-install-recommends curl

# The file binary is used to inspect exectubles when debugging container image issues
RUN apt-get -y install --no-install-recommends file

RUN apt-get -y install --no-install-recommends ca-certificates
RUN apt-get -y install --no-install-recommends tzdata

RUN apt-get -y install --no-install-recommends git
RUN apt-get -y install --no-install-recommends apt-utils

RUN apt -y install --no-install-recommends default-jdk

ARG APP=/usr/src/app/cactus/
COPY . ${APP}

ENV TZ=Etc/UTC

RUN mkdir -p ${APP}

RUN mkdir -p "${APP}/log/"

WORKDIR ${APP}

SHELL ["/bin/bash", "--login", "-i", "-c"]
# Installing Node Version Manager (nvm)
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

RUN source ~/.bashrc && \
nvm install 16.8.0 && \
npm install -g yarn && \
npm run configure

SHELL ["/bin/bash", "--login", "-c"]

COPY ./examples/cactus-example-cbdc-bridging-backend/healthcheck.sh /

ENV API_HOST=localhost
ENV API_SERVER_1_PORT=4000
ENV API_SERVER_2_PORT=4100
ENV API_HOST_FRONTEND=localhost
ENV API_PORT_FRONTEND=2000

COPY examples/cactus-example-cbdc-bridging-backend/src/fabric-contracts /usr/src/app/cactus/examples/cactus-example-cbdc-bridging-backend/dist/lib/fabric-contracts
COPY examples/cactus-example-cbdc-bridging-backend/supervisord.conf /etc/supervisord.conf
COPY examples/cactus-example-cbdc-bridging-backend/run-cbdc-app.sh /run-cbdc-app.sh
RUN chmod +x /run-cbdc-app.sh

# supervisord web ui/dashboard
EXPOSE 9001
# API #1
EXPOSE 4000
# API #2
EXPOSE 4100

# Extend the parent image's entrypoint
# https://superuser.com/questions/1459466/can-i-add-an-additional-docker-entrypoint-script
ENTRYPOINT ["/usr/bin/supervisord"]
CMD ["--configuration", "/etc/supervisord.conf", "--nodaemon"]
HEALTHCHECK --interval=1s --timeout=5s --start-period=20s --retries=250 \
CMD /usr/src/app/cactus/examples/cbdc-bridge-app/healthcheck.sh
38 changes: 38 additions & 0 deletions examples/cactus-example-cbdc-bridging-backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Hyperledger Cactus Example - CBDC Bridging between Fabric and Besu Backend

## Running the Test Suites

> Make sure you have all the dependencies set up as explained in `BUILD.md`
On the terminal, issue the following commands in the project root:

1. `npm run configure`
2. `npm run start:example-cbdc-bridging-app`

Wait for the output to show the message `CbdcBridgingApp running...`

In a second terminal run the following commands from the project root:
3. `cd examples/cactus-example-cbdc-bridging-backend`
4. `npm run test`

## Running the Example Application Locally

> Make sure you have all the dependencies set up as explained in `BUILD.md`
On the terminal, issue the following commands:

1. `npm run configure`
2. `npm run start:example-cbdc-bridging-app`

Wait for the output to show the message `CbdcBridgingApp running...`

## 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 configure`
2. Locate the `.vscode/template.launch.json` file
3. Within that file locate the entry named `"Example: CBDC Bridging Fabric-EVM App"`
4. Copy the VSCode debug definition object from 2) to your `.vscode/launch.json` file
5. At this point the VSCode `Run and Debug` panel on the left should have an option also titled `"Example: CBDC Bridging Fabric-EVM App"` which starts the application
6. Wait for the output to show the message `CbdcBridgingApp running...`
3 changes: 3 additions & 0 deletions examples/cactus-example-cbdc-bridging-backend/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

curl -v -i -X OPTIONS http://127.0.0.1:${API_SERVER_1_PORT}
122 changes: 122 additions & 0 deletions examples/cactus-example-cbdc-bridging-backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"name": "@hyperledger/cactus-example-cbdc-bridging-backend",
"version": "2.0.0-alpha.1",
"description": "An example application showing how to use Cacti when implementing a CBDC bridging application between Hyperledger Fabric and Hyperledger Besu.",
"keywords": [
"Hyperledger",
"Cacti",
"ODAP",
"Fabric",
"Besu",
"Blockchain",
"CBDC"
],
"homepage": "https://github.com/hyperledger/cacti#readme",
"bugs": {
"url": "https://github.com/hyperledger/cacti/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hyperledger/cacti.git"
},
"license": "Apache-2.0",
"author": {
"name": "Hyperledger Cacti Contributors",
"email": "[email protected]",
"url": "https://www.hyperledger.org/use/cacti"
},
"contributors": [
{
"name": "Please add yourself to the list of contributors",
"email": "[email protected]",
"url": "https://example.com"
},
{
"name": "André Augusto",
"email": "[email protected]"
}
],
"main": "dist/lib/main/typescript/index.js",
"module": "dist/lib/main/typescript/index.js",
"browser": "dist/cactus-example-cbdc-bridging-backend.web.umd.js",
"types": "dist/lib/main/typescript/index.d.ts",
"files": [
"dist/*"
],
"scripts": {
"solidity": "hardhat compile",
"start": "CONFIG_FILE=./example-config.json node dist/lib/main/typescript/cbdc-bridging-app-cli.js",
"watch": "npm-watch",
"test": "nyc cucumber-js ./src/test/typescript/cucumber/features/*.feature --require-module ts-node/register --require './src/test/typescript/cucumber/*/*.ts'",
"webpack": "npm-run-all webpack:dev",
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web",
"webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js",
"webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js",
"build:dev:backend:postbuild": "mkdir -p ./dist/lib/fabric-contracts && cp -r ./src/fabric-contracts/* ./dist/lib/fabric-contracts/"
},
"dependencies": {
"@hyperledger/cactus-api-client": "2.0.0-alpha.1",
"@hyperledger/cactus-cmd-api-server": "2.0.0-alpha.1",
"@hyperledger/cactus-common": "2.0.0-alpha.1",
"@hyperledger/cactus-core": "2.0.0-alpha.1",
"@hyperledger/cactus-core-api": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-ledger-connector-besu": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-ledger-connector-fabric": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-ledger-connector-xdai": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-object-store-ipfs": "2.0.0-alpha.1",
"@hyperledger/cactus-plugin-odap-hermes": "2.0.0-alpha.1",
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.1",
"@openzeppelin/contracts": "4.9.3",
"@openzeppelin/contracts-upgradeable": "4.9.3",
"async-exit-hook": "2.0.1",
"axios": "^0.27.2",
"crypto-js": "4.1.1",
"dotenv": "^16.0.1",
"fabric-network": "2.2.10",
"fs-extra": "10.1.0",
"ipfs-http-client": "51.0.1",
"knex": "2.5.1",
"nyc": "^13.1.0",
"openapi-types": "9.1.0",
"sqlite3": "^5.0.8",
"typescript-optional": "2.0.1",
"uuid": "8.3.2",
"web3-core": "1.5.2",
"web3-utils": "1.5.2"
},
"devDependencies": {
"@types/chai": "^4.3.1",
"@types/crypto-js": "4.1.1",
"@types/cucumber": "^4.0.4",
"@types/express": "4.17.13",
"@types/express-jwt": "6.0.2",
"@types/fs-extra": "9.0.13",
"@types/node": "^10.17.60",
"@types/uuid": "8.3.4",
"chai": "^4.1.2",
"cucumber": "^5.0.3",
"hardhat": "2.6.0",
"http-status-codes": "2.1.4",
"jose": "4.9.2",
"remix-tests": "^0.1.34",
"ts-node": "^7.0.1"
},
"engines": {
"node": ">=10",
"npm": ">=6"
},
"publishConfig": {
"access": "public"
},
"browserMinified": "dist/cactus-example-cbdc-bridging-backend.web.umd.min.js",
"mainMinified": "dist/cactus-example-cbdc-bridging-backend.node.umd.min.js",
"watch": {
"solidity": {
"patterns": [
"./src/main/solidity/"
],
"extensions": "sol"
}
}
}
5 changes: 5 additions & 0 deletions examples/cactus-example-cbdc-bridging-backend/process.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API_HOST=localhost
API_SERVER_1_PORT=4000
API_SERVER_2_PORT=4100
API_HOST_FRONTEND=localhost
API_PORT_FRONTEND=2000
Loading

0 comments on commit d66614d

Please sign in to comment.