Skip to content

Commit

Permalink
docs(examples): supply chain app example
Browse files Browse the repository at this point in the history
The idea is to have a very quickly testable demonstration
of how Cactus can be used to develop an (overly simplistic)
business use case that involves transacting over multiple
ledgers. This example does not yet provide an exhaustive
example on how to implement atomic swaps for example,
it is purely aimed at showing how code can be written
with the help of Cactus to perform basic tasks on
different ledgers.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Nov 2, 2020
1 parent ed5eda5 commit 1cf5176
Show file tree
Hide file tree
Showing 91 changed files with 22,330 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,41 @@
This project is an _Incubation_ Hyperledger project. For more information on the history of this project see the [Cactus wiki page](https://wiki.hyperledger.org/display/cactus). Information on what _Active_ entails can be found in
the [Hyperledger Project Lifecycle document](https://wiki.hyperledger.org/display/TSC/Project+Lifecycle).

Hyperledger Cactus aims to provide Decentralized, Secure and Adaptable Integration between Blockchain Networks.
Hyperledger Cactus aims to provide Decentralized, Secure and Adaptable Integration between Blockchain Networks.
Hyperledger Cactus is currently undergoing a major refactoring effort to enable the desired to-be architecture which will enable plug-in based collaborative development to increase the breadth of use cases & Ledgers supported.

## Scope of Project

As blockchain technology proliferates, blockchain integration will become an increasingly important topic in the broader blockchain ecosystem. For instance, people might want to trade between multiple different blockchains that are run on different platforms. The blockchain integration framework is a web application system designed to allow users to securely integrate different blockchains. It includes a set of libraries, data models, and SDK to accelerate development of an integrated services application. Our goal is to deliver a system that allows users of our code to securely conduct transactions between all of the most commonly used blockchains.

## Run the Examples

### Supply Chain Example

```sh
git clone https://github.com/hyperledger/cactus.git
cd cactus
npm install
npm run configure
cd examples/supply-chain-app/
npm install --no-package-lock
cd ../../
npm run build:dev
$ npm start:example-supply-chain
...
[2020-10-27T00:38:00.574Z] INFO (api-server): Cactus API reachable http://127.0.0.1:5000
[2020-10-27T00:38:00.574Z] INFO (api-server): Cactus Cockpit reachable http://127.0.0.1:6000
...
[2020-10-27T00:38:00.574Z] INFO (api-server): Cactus API reachable http://127.0.0.1:5100
[2020-10-27T00:38:00.574Z] INFO (api-server): Cactus Cockpit reachable http://127.0.0.1:6100
```

Once the last command has finished executing, open link printed on the console with a web browser of your choice

### Car Trade Example

TODO

## Documentation

* [Project Wiki](https://wiki.hyperledger.org/display/cactus): Schedule and logs of the maintainer meetings
Expand Down
25 changes: 25 additions & 0 deletions examples/supply-chain-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Hyperledger Cactus Example - Supply Chain App


> <p style="color:red">
> **WORK IN PROGRESS**
> ---
> </p>
>
> <p style="color:red">
> **NOT YET OPERATIONAL**
> ---
> </p>
## Usage

1. Build the project as instructed by the [BUILD.md](../../BUILD.md) file.
2. Execute the following while standing in the project root directory:
```sh
cd examples/supply-chain-app
npm i
npm start
```
3. Observe the example application pulling up
1. the test ledger containers,
2. a test consortium with multiple members and their Cactus nodes
53 changes: 53 additions & 0 deletions examples/supply-chain-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@hyperledger/cactus-example-supply-chain-backend-app",
"version": "0.2.0",
"description": "An example project demonstrating how Cactus can be used for cross-chain dapp development.",
"scripts": {
"start": "node ./node_modules/.bin/cactus-example-supply-chain-backend",
"start-direct": "node ./node_modules/@hyperledger/cactus-example-supply-chain-backend/dist/lib/main/typescript/supply-chain-app-cli.js"
},
"private": true,
"publishConfig": {
"access": "restricted"
},
"engines": {
"node": ">=10",
"npm": ">=6"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hyperledger/cactus.git"
},
"keywords": [
"Hyperledger",
"Cactus",
"Blockchain Integration",
"Distributed Ledger Technology"
],
"author": {
"name": "Hyperledger Cactus Contributors",
"email": "cactus@lists.hyperledger.org",
"url": "https://www.hyperledger.org/use/cactus"
},
"contributors": [
{
"name": "Please add yourself to the list of contributors",
"email": "your.name@example.com",
"url": "https://example.com"
},
{
"name": "Peter Somogyvari",
"email": "peter.somogyvari@accenture.com",
"url": "https://accenture.com"
}
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/hyperledger/cactus/issues"
},
"homepage": "https://github.com/hyperledger/cactus#readme",
"dependencies": {
"@hyperledger/cactus-example-supply-chain-backend": "file:../../packages/cactus-example-supply-chain-backend"
},
"devDependencies": {}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"generate-api-server-config": "node ./tools/generate-api-server-config.js",
"start:api-server": "node ./packages/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js --config-file=.config.json",
"start:cockpit": "lerna run --scope '*/cactus-cockpit' --stream serve:proxy",
"start:example-supply-chain": "node ./examples/supply-chain-app/node_modules/.bin/cactus-example-supply-chain-backend",
"export-open-api-spec": "ts-node -e 'import(\"./packages/cactus-cmd-api-server/src/main/typescript/openapi-spec\").then((x) => x.exportToFileSystemAsJson());'",
"pregenerate-sdk": "npm-run-all export-open-api-spec",
"generate-sdk": "openapi-generator generate --input-spec cactus-openapi-spec.json -g typescript-axios -o packages/cactus-api-client/src/main/typescript/generated/openapi/typescript-axios/",
Expand All @@ -30,6 +31,7 @@
"test:plugin-ledger-connector-quorum": "tap --jobs=1 --timeout=60 \"packages/cactus-*-quorum/src/test/typescript/{unit,integration}/\"",
"build:dev:plugin-ledger-connector-fabric": "lerna exec --stream --scope '*/*connector-fabric' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:plugin-consortium-manual": "lerna exec --stream --scope '*/*manual-consortium' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:example-supply-chain-backend": "lerna exec --stream --scope '*/*example-supply-chain-b*' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --display-modules --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:sdk": "lerna exec --stream --scope '*/*sdk' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"webpack": "npm-run-all webpack:dev webpack:prod",
"webpack:dev": "lerna run webpack:dev",
Expand Down
Loading

0 comments on commit 1cf5176

Please sign in to comment.