Skip to content

Commit 3291dcc

Browse files
committed
feat(indy-sdk): replace indy SDK with AFJ
- Refactor test ledger `indy-testnet` into `indy-all-in-one`. New package uses the latest indy version, has healtcheck script, updated startup / cleanup scripts. - Remove `indy-sdk-cli` image since it's not used anymore. - Refactor `cactus-example-discounted-asset-trade` to use own aries agent instead of indy connector. This way it doesn't need to use indy-sdk anymore, and python indy connector can be safely removed / upgraded. - Update sample app readme to explain current workflow. - Remove client scripts since `cactus-example-discounted-asset-trade-client` can now be used to interact with the sample app. - Add `cactus-example-discounted-asset-trade-client`. It contains script for setting up test credentials on the ledger, script with interactive menu for interacting with `cactus-example-discounted-asset-trade` sample app, and bunch of helper functions used for writing these apps. Depends on #2859 Depends on #2860 Signed-off-by: Michal Bajer <[email protected]>
1 parent 31eefd6 commit 3291dcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3011
-1765
lines changed

.cspell.json

+7
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
"adminpw",
88
"Albertirsa",
99
"ALLFORTX",
10+
"Anoncreds",
11+
"anoncreds",
1012
"ANYFORTX",
1113
"APIV",
1214
"approveformyorg",
15+
"Askar",
16+
"askar",
1317
"Authz",
1418
"authzn",
1519
"AWSSM",
@@ -37,9 +41,12 @@
3741
"couchdb",
3842
"COUCHDBADDRESS",
3943
"COUCHDBCONFIG",
44+
"Creds",
4045
"data",
4146
"dclm",
4247
"DHTAPI",
48+
"Dids",
49+
"dids",
4350
"DockerOde",
4451
"ealen",
4552
"ecparams",

.dcilintignore

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ docs-cactus/source/conf.py
1010
# Links would be broken if we refactored the offending lines
1111
docs/docs/contributing/requesting-a-change.md
1212

13-
# Cannot be edited due to configuration schema of third party software
14-
examples/register-indy-data/register-indy-data.py
15-
16-
# Cannot be edited due to configuration schema of third party software
17-
tools/docker/indy-testnet/Dockerfile
18-
1913
# Cannot be edited due to configuration schema of third party software
2014
packages/cactus-test-tooling/src/main/typescript/keycloak/keycloak-container.ts
2115

examples/cactus-example-cbdc-bridging-frontend/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@
4949
},
5050
"devDependencies": {
5151
"@types/uuid": "^9.0.7"
52+
},
53+
"engines": {
54+
"node": ">=18",
55+
"npm": ">=8"
5256
}
5357
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# cactus-example-discounted-asset-trade-client
2+
- Client applications and helper libraries for interacting with test indy ledger and Cacti discounted asset trade example app.
3+
- Uses Hyperledger Aries Framework JavaScript (AFJ).
4+
- **Before running any of the script make sure that test indy ledger is running and it's config is available under `/etc/cactus/indy-all-in-one/` (at least `pool_transactions_genesis` should be there.)**
5+
6+
## Build
7+
- This package will be build as part of main cacti build (`yarn run configure` in root dir), or can be build manually by running `yarn run build` from this directory).
8+
9+
## Setup Credentials Script
10+
- This script can be used to setup indy credentials before running the example app, or to simply check indy test ledger operational status.
11+
- Script will register employment credential, issue it to agent `Alice`, and check that employment proof is correct.
12+
- Can be run repeatadelly.
13+
14+
``` bash
15+
# Run the script
16+
yarn setup-credentials
17+
18+
# Run with debug logs
19+
LOG_LEVEL=DEBUG yarn setup-credentials
20+
```
21+
22+
### Sample output
23+
24+
``` bash
25+
Running with log level INFO
26+
Connecting Alice with Issuer...
27+
Connecting aliceCactiAgent to issuerCactiAgent...
28+
Agents connected!
29+
Register and issue the employment credential...
30+
Register Credential Schema...
31+
Register employment certificate credential schema 'cactiJobCert'...
32+
Register Credential Definition...
33+
Register job certificate credential definition (schemaId: 'did:indy:cacti:test:Th7MpTaRZVRYnPiabds81Y/anoncreds/v0/SCHEMA/cactiJobCert/1.0.0') ...
34+
Issue the credential...
35+
Accepting credential 018e6578-4e52-4ae0-8381-8c935c8a13dc...
36+
Credential accepted!
37+
Credential was issed and accepted by a peer agent!
38+
Verify employment status proof...
39+
Proof request was sent
40+
Accepting proof 5c0986ab-4f1d-4850-a2ff-53c90ce34a12...
41+
Proof request accepted!
42+
Requested proof status: done
43+
Finishing - cleaning up the agents...
44+
All done.
45+
``````
46+
47+
## Discounted Asset Trade Client
48+
- Used to interact with discounted asset trade example application.
49+
- Will connect Alice agent to sample application. After that you can choose action to perform.
50+
- Actions:
51+
- `Start the trade`: Will send trade request to example app, asset2 will change owner and payment will be processed on etherem (see `cactus-example-discounted-asset-trade` README for more details)
52+
- `Get this agent credentials`: Get list of Alice credentials.
53+
- `Get assets`: Get example app asset list (both fabric assets and ethereum balances)
54+
- `Exit`: Cleanup and leave. Note - may take few seconds due to ongoing timeouts etc...
55+
- Note: Use arrow keys to restore menu if any async message caused it to disappear.
56+
57+
``` bash
58+
# Run the script
59+
yarn run-discounted-asset-trade-client
60+
61+
# Run with debug logs
62+
LOG_LEVEL=DEBUG yarn run-discounted-asset-trade-client
63+
```
64+
65+
### Sample output
66+
67+
``` bash
68+
Running with log level INFO
69+
Connected to the discounted asset trade sample app agent! ID: 5a4f0cf6-b53a-4f3d-9494-112edfdfd626
70+
Action: (Use arrow keys)
71+
❯ Start the trade
72+
Get this agent credentials
73+
Get assets
74+
Exit
75+
``````
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "@hyperledger/cactus-example-discounted-asset-trade-client",
3+
"version": "2.0.0-alpha.2",
4+
"description": "Client for interacting with discounted asset trade sample app and some tools for setting up indy enviroment",
5+
"keywords": [
6+
"Hyperledger",
7+
"Cacti",
8+
"Cactus",
9+
"Integration",
10+
"Blockchain",
11+
"Distributed Ledger Technology"
12+
],
13+
"homepage": "https://github.com/hyperledger/cacti#readme",
14+
"bugs": {
15+
"url": "https://github.com/hyperledger/cacti/issues"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "git+https://github.com/hyperledger/cacti.git"
20+
},
21+
"license": "Apache-2.0",
22+
"author": {
23+
"name": "Hyperledger Cacti Contributors",
24+
"email": "[email protected]",
25+
"url": "https://www.hyperledger.org/use/cacti"
26+
},
27+
"contributors": [
28+
{
29+
"name": "Please add yourself to the list of contributors",
30+
"email": "[email protected]",
31+
"url": "https://example.com"
32+
},
33+
{
34+
"name": "Michal Bajer",
35+
"email": "[email protected]",
36+
"url": "https://www.fujitsu.com/global/"
37+
}
38+
],
39+
"main": "dist/lib/main/typescript/index.js",
40+
"module": "dist/lib/main/typescript/index.js",
41+
"types": "dist/lib/main/typescript/index.d.ts",
42+
"bin": {
43+
"run-discounted-asset-trade-client": "dist/lib/main/typescript/scripts/run-discounted-asset-trade-client.js",
44+
"setup-credentials": "dist/lib/main/typescript/scripts/setup-credentials.js"
45+
},
46+
"files": [
47+
"dist/*"
48+
],
49+
"scripts": {
50+
"build": "tsc",
51+
"run-discounted-asset-trade-client": "node dist/lib/main/typescript/scripts/run-discounted-asset-trade-client.js",
52+
"setup-credentials": "node dist/lib/main/typescript/scripts/setup-credentials.js"
53+
},
54+
"dependencies": {
55+
"@hyperledger/anoncreds-nodejs": "0.2.0-dev.4",
56+
"@hyperledger/aries-askar-nodejs": "0.2.0-dev.1",
57+
"@hyperledger/indy-vdr-nodejs": "0.2.0-dev.3",
58+
"axios": "1.5.1",
59+
"inquirer": "8.2.6",
60+
"loglevel": "1.8.1"
61+
},
62+
"devDependencies": {
63+
"@aries-framework/anoncreds": "0.5.0-alpha.58",
64+
"@aries-framework/anoncreds-rs": "0.5.0-alpha.58",
65+
"@aries-framework/askar": "0.5.0-alpha.58",
66+
"@aries-framework/core": "0.5.0-alpha.58",
67+
"@aries-framework/indy-sdk": "0.5.0-alpha.58",
68+
"@aries-framework/indy-vdr": "0.5.0-alpha.58",
69+
"@aries-framework/node": "0.5.0-alpha.58",
70+
"@types/inquirer": "8.2.6"
71+
},
72+
"engines": {
73+
"node": ">=18",
74+
"npm": ">=8"
75+
},
76+
"publishConfig": {
77+
"access": "public"
78+
}
79+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./public-api";

0 commit comments

Comments
 (0)