diff --git a/DEVREADME.md b/DEVREADME.md index 647e619421..cea95a96da 100644 --- a/DEVREADME.md +++ b/DEVREADME.md @@ -2,11 +2,6 @@ This file is intended for developers working on the internals of the framework. If you're just looking how to get started with the framework, see the [docs](./docs) -## Installing dependencies - -Right now, as a patch that will later be changed, some platforms will have an "error" when installing the dependencies with yarn. This is because the BBS signatures library that we use is built for Linux x86 and MacOS x86 (and not Windows and MacOS arm). This means that it will show that it could not download the binary. -This is not an error for developers, the library that fails is `node-bbs-signaturs` and is an optional dependency for perfomance improvements. It will fallback to a, slower, wasm build. - ## Running tests Test are executed using jest. Some test require either the **mediator agents** or the **ledger** to be running. When running tests that require a connection to the ledger pool, you need to set the `TEST_AGENT_PUBLIC_DID_SEED` and `GENESIS_TXN_PATH` environment variables. diff --git a/packages/bbs-signatures/README.md b/packages/bbs-signatures/README.md index 0bf81ab439..2da1dfe930 100644 --- a/packages/bbs-signatures/README.md +++ b/packages/bbs-signatures/README.md @@ -29,3 +29,47 @@
Aries Framework JavaScript BBS Module provides an optional addon to Aries Framework JavaScript to use BBS signatures in W3C VC exchange. + +## Installation + +```sh +yarn add @aries-framework/bbs-signatures +``` + +### React Native + +When using AFJ inside the React Native environment, temporarily, a dependency for creating keys, signing and verifying, with bbs keys must be swapped. Inside your `package.json` the following must be added. This is only needed for React Native environments + +#### yarn + +```diff ++ "resolutions": { ++ "@mattrglobal/bbs-signatures": "@animo-id/react-native-bbs-signatures@^0.1.0", ++ }, + "dependencies": { + ... ++ "@animo-id/react-native-bbs-signatures": "^0.1.0", + } +``` + +#### npm + +```diff ++ "overrides": { ++ "@mattrglobal/bbs-signatures": "@animo-id/react-native-bbs-signatures@^0.1.0", ++ }, + "dependencies": { + ... ++ "@animo-id/react-native-bbs-signatures": "^0.1.0", + } +``` + +The resolution field says that any instance of `@mattrglobal/bbs-signatures` in any child dependency must be swapped with `@animo-id/react-native-bbs-signatures`. + +The added dependency is required for autolinking and should be the same as the one used in the resolution. + +[React Native Bbs Signature](https://github.com/animo/react-native-bbs-signatures) has some quirks with setting it up correctly. If any errors occur while using this library, please refer to their README for the installation guide. + +### Issue with `node-bbs-signatures` + +Right now some platforms will see an "error" when installing the `@aries-framework/bbs-signatures` package. This is because the BBS signatures library that we use under the hood is built for Linux x86 and MacOS x86 (and not Windows and MacOS arm). This means that it will show that it could not download the binary. This is not an error for developers, the library that fails is `node-bbs-signatures` and is an optional dependency for performance improvements. It will fallback to a (slower) wasm build. diff --git a/packages/bbs-signatures/package.json b/packages/bbs-signatures/package.json index 16c8df6f70..8d54629716 100644 --- a/packages/bbs-signatures/package.json +++ b/packages/bbs-signatures/package.json @@ -30,12 +30,18 @@ "@stablelib/random": "^1.0.2" }, "peerDependencies": { - "@aries-framework/core": "0.2.5" + "@aries-framework/core": "0.2.5", + "@animo-id/react-native-bbs-signatures": "^0.1.0" }, "devDependencies": { "@aries-framework/node": "0.2.5", "reflect-metadata": "^0.1.13", "rimraf": "~3.0.2", "typescript": "~4.3.0" + }, + "peerDependenciesMeta": { + "@animo-id/react-native-bbs-signatures": { + "optional": true + } } } diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 944a1c22b3..a53d68ee31 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -29,7 +29,6 @@ "events": "^3.3.0" }, "devDependencies": { - "@animo-id/react-native-bbs-signatures": "^0.1.0", "@types/indy-sdk-react-native": "npm:@types/indy-sdk@^1.16.21", "@types/react-native": "^0.64.10", "indy-sdk-react-native": "^0.2.2", @@ -43,7 +42,6 @@ "peerDependencies": { "indy-sdk-react-native": "^0.2.2", "react-native-fs": "^2.18.0", - "react-native-get-random-values": "^1.7.0", - "@animo-id/react-native-bbs-signatures": "^0.1.0" + "react-native-get-random-values": "^1.7.0" } } diff --git a/yarn.lock b/yarn.lock index 9187c4a305..a097054007 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,11 +10,6 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@animo-id/react-native-bbs-signatures@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@animo-id/react-native-bbs-signatures/-/react-native-bbs-signatures-0.1.0.tgz#f62bc16b867c9f690977982d66f0a03566b21ad2" - integrity sha512-7qvsiWhGfUev8ngE8YzF6ON9PtCID5LiYVYM4EC5eyj80gCdhx3R46CI7K1qbqIlGsoTYQ/Xx5Ubo5Ji9eaUEA== - "@azure/core-asynciterator-polyfill@^1.0.0": version "1.0.2" resolved "https://registry.yarnpkg.com/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.2.tgz#0dd3849fb8d97f062a39db0e5cadc9ffaf861fec"