forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hyperledger:main' into main
- Loading branch information
Showing
204 changed files
with
20,124 additions
and
4,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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+\\]"], | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,6 @@ | |
}, | ||
"devDependencies": { | ||
"@types/escape-html": "1.0.1", | ||
"@types/node": "15.14.7" | ||
"@types/node": "15.14.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": [ | ||
{ | ||
|
@@ -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", | ||
|
@@ -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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": [ | ||
{ | ||
|
@@ -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", | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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...` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
122
examples/cactus-example-cbdc-bridging-backend/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.