Skip to content

Commit

Permalink
docs(examples/cbdc): migrate frontend to Typescript
Browse files Browse the repository at this point in the history
* Closes #2817
* Depends on #2912

Signed-off-by: André Augusto <[email protected]>
  • Loading branch information
AndreAugusto11 committed Dec 2, 2023
1 parent 7c46c08 commit 683ca7c
Show file tree
Hide file tree
Showing 36 changed files with 3,244 additions and 5,531 deletions.
2 changes: 1 addition & 1 deletion examples/cactus-example-cbdc-bridging-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"scripts": {
"build:dev:backend:postbuild": "mkdir -p ./dist/lib/fabric-contracts && cp -r ./src/fabric-contracts/* ./dist/lib/fabric-contracts/",
"solidity": "hardhat compile",
"start": "CONFIG_FILE=./example-config.json node dist/lib/main/typescript/cbdc-bridging-app-cli.js",
"start": "node dist/lib/main/typescript/cbdc-bridging-app-cli.js dotenv_config_path=./process.env",
"test": "nyc cucumber-js ./src/test/typescript/cucumber/features/*.feature --require-module ts-node/register --require './src/test/typescript/cucumber/*/*.ts'",
"watch": "npm-watch",
"webpack": "npm-run-all webpack:dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import {
import {
Configuration,
DefaultApi as OdapApi,
} from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/index";
IOdapPluginKeyPair,
} from "@hyperledger/cactus-plugin-odap-hermes";
import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory";
import { CbdcBridgingAppDummyInfrastructure } from "./infrastructure/cbdc-bridging-app-dummy-infrastructure";
import { DefaultApi as FabricApi } from "@hyperledger/cactus-plugin-ledger-connector-fabric";
import { DefaultApi as BesuApi } from "@hyperledger/cactus-plugin-ledger-connector-besu";
import { IOdapPluginKeyPair } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway";
import { DefaultApi as IpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs";
import { FabricOdapGateway } from "./odap-extension/fabric-odap-gateway";
import { BesuOdapGateway } from "./odap-extension/besu-odap-gateway";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { PluginRegistry } from "@hyperledger/cactus-core";
import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs";
import AssetReferenceContractJson from "../../../solidity/asset-reference-contract/AssetReferenceContract.json";
import CBDCcontractJson from "../../../solidity/cbdc-erc-20/CBDCcontract.json";
import { IOdapPluginKeyPair } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway";
import { IOdapPluginKeyPair } from "@hyperledger/cactus-plugin-odap-hermes";
import { FabricOdapGateway } from "../odap-extension/fabric-odap-gateway";
import { BesuOdapGateway } from "../odap-extension/besu-odap-gateway";
import { PluginImportType } from "@hyperledger/cactus-core-api";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
import {
IOdapPluginKeyPair,
PluginOdapGateway,
} from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript";
} from "@hyperledger/cactus-plugin-odap-hermes";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-odap-hermes";
import { ClientHelper } from "./client-helper";
import { ServerHelper } from "./server-helper";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { SHA256 } from "crypto-js";
import {
PluginOdapGateway,
TransferInitializationV1Request,
} from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript";
import { ClientGatewayHelper } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/client/client-helper";
import { OdapMessageType } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway";
ClientGatewayHelper
} from "@hyperledger/cactus-plugin-odap-hermes";
import { OdapMessageType } from "@hyperledger/cactus-plugin-odap-hermes";
import { FabricOdapGateway } from "./fabric-odap-gateway";
import { BesuOdapGateway } from "./besu-odap-gateway";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
import {
IOdapPluginKeyPair,
PluginOdapGateway,
} from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript/gateway/plugin-odap-gateway";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-odap-hermes/src/main/typescript";
} from "@hyperledger/cactus-plugin-odap-hermes";
import { SessionDataRollbackActionsPerformedEnum } from "@hyperledger/cactus-plugin-odap-hermes";
import { ClientHelper } from "./client-helper";
import { ServerHelper } from "./server-helper";

Expand Down
Empty file.
7 changes: 4 additions & 3 deletions examples/cactus-example-cbdc-bridging-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@


FROM node:16-alpine

WORKDIR /usr/src/app

COPY ./examples/cbdc-bridging-fabric-evm-frontend/package.json ./
COPY package.json ./

RUN npm install

COPY ./examples/cbdc-bridging-fabric-evm-frontend/ .
COPY . .

EXPOSE 2000

CMD [ "npm", "start" ]
CMD [ "npm", "start" ]
30 changes: 12 additions & 18 deletions examples/cactus-example-cbdc-bridging-frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
# Available Scripts
# Getting Started with Create React App

In the project directory, you can run:
## Run with Docker

## `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
### Using a pre-built image

The page will reload when you make changes.\
You may also see any lint errors in the console.
`docker run -p 2000:2000 aaugusto11/cactus-example-cbdc-bridging-frontend`

## `npm test`
### Building the image

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
```docker build -t cbdc-app-frontend .
docker run -p 2000:2000 cbdc-app-frontend```
## `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
## `npm start`
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
Runs the app in the development mode.\
Open [http://localhost:2000](http://localhost:2000) to view it in the browser.
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
The page will reload if you make edits.\
You will also see any lint errors in the console.
Loading

0 comments on commit 683ca7c

Please sign in to comment.