Skip to content

Commit

Permalink
feat(cactus-plugin-ledger-connector-fabric-socketio): remove fabric-s…
Browse files Browse the repository at this point in the history
…ocketio connector

- Remove cactus-plugin-ledger-connector-fabric-socketio connector.
- Refactor discounted cartrade sample to use openapi fabric connector instead of fabric-socketio.
    Sample app will use delegated signing, similar to offline signing in old connector.
- Remove dead code from cmd-socketio-server
- Update fabric SDK to 2.X in all cacti projects, refactor code that use it where necessary.
    Only exception is fabric persistence plugin which uses fabric SDK as dev dependency (for tests).
    It can be updated in separate PR later on.

Depends on: #2644

Signed-off-by: Michal Bajer <[email protected]>
  • Loading branch information
outSH committed Oct 12, 2023
1 parent 392ca8d commit 50f6ce5
Show file tree
Hide file tree
Showing 70 changed files with 672 additions and 6,000 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1215,33 +1215,6 @@ jobs:
- run: npm run configure
- run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-with-ws-ids.test.ts

cactus-plugin-ledger-connector-fabric-socketio:
continue-on-error: false
env:
FULL_BUILD_DISABLED: true
JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts
JEST_TEST_RUNNER_DISABLED: false
TAPE_TEST_RUNNER_DISABLED: true
needs: build-dev
runs-on: ubuntu-20.04
steps:
- name: Use Node.js v16.14.2
uses: actions/[email protected]
with:
node-version: v16.14.2
- uses: actions/[email protected]

- id: yarn-cache
name: Restore Yarn Cache
uses: actions/[email protected]
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn --version
- run: yarn install
- run: ./tools/ci.sh
cactus-plugin-ledger-connector-go-ethereum-socketio:
continue-on-error: false
env:
Expand Down
25 changes: 8 additions & 17 deletions examples/cactus-example-discounted-asset-trade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Alice will use credentials and other Indy formats such as schema and definition

## Setup Overview

### fabric-socketio-validator
### fabric-connector

- Validator for fabric ledger.
- Docker networks: `fabric-all-in-one_testnet-2x`, `cactus-example-discounted-asset-trade-net`
- Started as part of discounted asset trade BLP.

### ethereum-validator

Expand Down Expand Up @@ -114,8 +114,6 @@ Alice will use credentials and other Indy formats such as schema and definition
```
cactus-example-discounted-asset-trade-ethereum-validator | listening on *:5050
...
cactus-example-discounted-asset-trade-fabric-socketio-validator | listening on *:5040
...
cactus-example-discounted-asset-trade-indy-validator | 2022-01-31 16:00:49,552 INFO success: validator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
...
cactus-example-discounted-asset-trade-indy-validator-nginx | 2022/01/31 16:00:49 [notice] 1#1: start worker process 35
Expand Down Expand Up @@ -154,9 +152,6 @@ For development purposes, it might be useful to run the sample application outsi
1. Configure cactus and start the ledgers as described above.
1. Run `./script-dockerless-config-patch.sh` from `cactus-example-discounted-asset-trade/` directory. This will patch the configs and copy it to global location.
1. Start validators (each in separate cmd window).
1. ```bash
cd packages/cactus-plugin-ledger-connector-fabric-socketio/ && npm run start
```
1. ```bash
cd packages/cactus-plugin-ledger-connector-go-ethereum-socketio/ && npm run start
```
Expand Down Expand Up @@ -207,8 +202,6 @@ For development purposes, it might be useful to run the sample application outsi
1. Run the transaction execution:
**For docker-compose environment, run:**
```
./script-post-trade-request.sh
```
Expand All @@ -219,17 +212,10 @@ For development purposes, it might be useful to run the sample application outsi
docker run --rm -ti -v "$(pwd)/etc/cactus/":"/etc/cactus/" --net="host" register-indy-data
```
**For dockerless environment, run:**
```bash
pushd ../register-indy-data && sh ./script-build-docker.sh && popd &&
docker run --rm -ti -v/etc/cactus/:/etc/cactus/ --net="host" register-indy-data --force
```
**After sending the requests**
- The transactions are executed by order.
- When the following log appears on the BLP console, the transactions are completed.
- When the following log appears on the BLP console, the transactions are completed (you may need to scroll a bit to find it).
```
[INFO] BusinessLogicAssetTrade - ##INFO: completed asset-trade, businessLogicID: guks32pf, tradeID: *******-001
Expand Down Expand Up @@ -295,3 +281,8 @@ For development purposes, it might be useful to run the sample application outsi
./script-cleanup.sh
popd
```
#### Possible improvements
- Ethereum events are duplicated, causing trade to proceed even if previous step was not successfull.
- Handle this case properly - ignore duplciated events, move forward only if current step was completed.
- Investigate and fix duplicated events in Verifier / Ethereum connector (or use openapi ethereum connector).
Loading

0 comments on commit 50f6ce5

Please sign in to comment.