Skip to content

Commit

Permalink
Merge branch 'master' into features/key-abstraction
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/apollo/Apollo.ts
#	src/apollo/utils/Ed25519KeyCommon.ts
#	src/apollo/utils/Ed25519KeyPair.ts
#	src/apollo/utils/Ed25519PrivateKey.ts
#	src/apollo/utils/Ed25519PublicKey.ts
#	src/apollo/utils/Secp256k1KeyCommon.ts
#	src/apollo/utils/Secp256k1KeyPair.ts
#	src/apollo/utils/Secp256k1PrivateKey.ts
#	src/apollo/utils/Secp256k1PublicKey.ts
#	src/apollo/utils/X25519KeyCommon.ts
#	src/apollo/utils/X25519KeyPair.ts
#	src/apollo/utils/X25519PrivateKey.ts
#	src/apollo/utils/X25519PublicKey.ts
#	src/castor/Castor.ts
#	src/castor/did/prismDID/PrismDIDPublicKey.ts
  • Loading branch information
elribonazo committed Jun 24, 2023
2 parents f456673 + 807e755 commit 7d31205
Show file tree
Hide file tree
Showing 55 changed files with 1,617 additions and 746 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Release Documentation

on:
workflow_dispatch:
push:
tags:
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
docs:
name: build documentation and release
runs-on: ubuntu-latest
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: https://npm.pkg.github.com/
scope: "@input-output-hk"

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Build Docs
run: npm run docs

- name: Push
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages # The branch name where you want to push the assets
FOLDER: docs # The directory where your assets are generated
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token
MESSAGE: "feat(docs): ({sha}) {msg}" # The commit message
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.db
didcomm-pkg
didcomm-pkg
generated-docs
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
generated-docs

# Development folders and files
public
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [2.0.2](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/compare/v2.0.1...v2.0.2) (2023-06-22)


### Bug Fixes

* **docs:** Correct the required commands to run the nodejs + browser … ([#64](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/issues/64)) ([fec65fe](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/commit/fec65fe0f77657fab99c6e817c8ed31d729f0d2a))
* **docs:** Improve Generated documentation ([#65](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/issues/65)) ([db3c20e](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/commit/db3c20eeb081256dbe6931c3b34e4cc53c2039f7))
* Documentation improvements ([#62](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/issues/62)) ([6d43d03](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/commit/6d43d033d2bb3019c9fe4fa000cde6afbdccc8e2))

## [2.0.1](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts/compare/v2.0.0...v2.0.1) (2023-05-31)


Expand Down
136 changes: 21 additions & 115 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,140 +15,46 @@ credentials, alongside tools and frameworks to help expand your ecosystem.
The complete platform is separated in multiple repositories:

* [atala-prism-wallet-sdk-swift](https://github.com/input-output-hk/atala-prism-wallet-sdk-swift) - Repo that implements Atala PRISM for Apple platforms in Swift.
* [atala-prism-wallet-sdk-kmm](https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm) - Repo that implements Atala PRISM for Apple platforms in kmm, jvm.
* [atala-prism-wallet-sdk-ts](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts) - Repo that implements Atala PRISM for Browser and NodeJS platforms in TypeScript.
* [atala-prism-building-blocks](https://github.com/input-output-hk/atala-prism-building-blocks) - Repo that contains the platform Building Blocks.

### Modules / APIs

Atala PRISM TypeScript SDK provides the following building blocks:
### SDK Overview
* Apollo: Provides a suite of necessary cryptographic operations.
* Castor: Provides a suite of operations to create, manage and resolve decentralized identifiers.
* Pollux: Provides a suite of operations for handling [verifiable credentials](https://github.com/input-output-hk/atala-prism-docs/blob/main/documentation/docs/concepts/glossary.md#verifiable-credentials).
* Mercury: Provides a suite of operations for handling DIDComm V2 messages.
* Pluto: Provides an interface for storage operations in a portable, storage-agnostic manner.
* PrismAgent: PrismAgent, a component using all other building blocks, provides basic edge agent capabilities, including implementing DIDComm V2 protocols.

* **Apollo**: Provides a suite of necessary cryptographic operations.
* **Castor**: Provides a suite of operations to create, manage and resolve decentralized identifiers.
* **Pollux**: Provides a suite of operations for handling verifiable credentials.
* **Mercury**: Provides a suite of operations for handling DIDComm V2 messages.
* **Pluto**: Provides an interface for storage operations in a portable, storage-agnostic manner.
* **PrismAgent**: PrismAgent, a component using all other building blocks, provides a basic edge agent capabilities, including implementation of DIDComm V2 protocols.

## DIDComm Protocol Support

| Protocol | Supported | Notes |
| --- | :--: | -- |
| [Mediator Coordinator](https://didcomm.org/mediator-coordination/2.0/) | :white_check_mark: | -- |
| Connection | :white_check_mark: | Atala PRISM proprietary |
| [DIDComm V2 Issue Credential](https://github.com/decentralized-identity/waci-didcomm/tree/main/issue_credential) | :white_check_mark: | -- |
| [DIDComm V2 Present Proof](https://github.com/decentralized-identity/waci-didcomm/blob/main/present_proof/present-proof-v3.md) | :white_check_mark: | -- |

## Getting Started

### Supported platforms

| Platform | Supported | Notes |
| --- | :--: | -- |
| Browser | :white_check_mark: | -- |
| Browser Extension | :white_check_mark: | -- |
| Node.js | :white_check_mark: | -- |
| React Native | :x: | -- |

### Installing
Install the SDK using `npm` or `yarn`:

`npm install @input-output-hk/atala-prism-wallet-sdk`

`yarn add @input-output-hk/atala-prism-wallet-sdk`

### Browser setup

Some additional steps are needed to use the SDK in the browser.

The library expects `didcomm_js_bg` WebAssembly file to be available in the route of
the project, so it need to be copied to the project's `public` folder.

One way to do it could be to add the following command to the `postinstall`:

```shell
cp node_modules/@input-output-hk/atala-prism-wallet-sdk/build/browser/didcomm_js_bg.wasm ./public/
```

If you use Webpack or Rollup, appropriate plugin could be used to copy the file instead.

The last needed step is to provide browser polyfills for `fs` and `path` modules.
We plan to remove this requirement in the future, but for now it is needed due to
`sql.js` dependency. Providing polyfills is highly dependent on the toolchain used,
so please refer to the documentation of your build tool for more information.

### Usage
Once `@input-output-hk/atala-prism-wallet-sdk` is installed as a dependency,
package could be imported using both ES modules and CommonJS syntax.

`import * as prismSDK from '@input-output-hk/atala-prism-wallet-sdk';`

or

`const prismSDK = require('@input-output-hk/atala-prism-wallet-sdk');`

Then, provided modules could be used to set up an SSI Edge Agent:

```ts
const apollo = new prismSDK.Apollo();
const api = new prismSDK.ApiImpl();
const castor = new prismSDK.Castor(apollo);
const pluto = new prismSDK.Pluto({
type: "sql",
});
const didcommWrapper = new prismSDK.DIDCommWrapper(apollo, castor, pluto);
const mercury = new prismSDK.Mercury(castor, didcommWrapper, api);
const mediatorDID = prismSDK.Domain.DID.fromString(
"did:peer:2.Ez6LSms555YhFthn1WV8ciDBpZm86hK9tp83WojJUmxPGk1hZ.Vz6MkmdBjMyB4TS5UbbQw54szm8yvMMf1ftGV2sQVYAxaeWhE.SeyJpZCI6Im5ldy1pZCIsInQiOiJkbSIsInMiOiJodHRwczovL21lZGlhdG9yLnJvb3RzaWQuY2xvdWQiLCJhIjpbImRpZGNvbW0vdjIiXX0"
);
const mediatorStore = new prismSDK.PublicMediatorStore(pluto);
const mediatorHandler = new prismSDK.BasicMediatorHandler(mediatorDID, mercury, mediatorStore);
const connectionsManager = new prismSDK.ConnectionsManager(castor, mercury, pluto, mediatorHandler);

const seedWords = apollo.createRandomSeed();

const agent = new prismSDK.Agent(
apollo,
castor,
pluto,
mercury,
mediatorHandler,
connectionsManager,
seedWords.seed
);

await agent.start();
```

### Running demos

1. For Nodejs:
First build the sdk from root folder
```bash
npm i
npm run build
```
### Getting started
This repository includes a browser and a nodejs demo application, and also a step by step documented process.

1. Running the DEMOS
For Nodejs:
Now cd into the demo directory "demos/node"
```bash
cd demos/node
npm i
node index.js
```

2. For Browser:
First build the sdk from root folder
```bash
npm i
npm run build
```

For Browser:
Now cd into the demo directory "demos/browser"
```bash
cd demos/node
cd demos/browser
npm i
npm run start
```

To run browser demo app, just run `npm run dev:browser` and browser will automatically open and load the demo app.

To run Node.js demo app, run `npm run dev:node` to build the demo app and then run it with `node build/node-test/index.js`.


2. To see how the step by steps examples can guide you refer to each section inside docs folder, Apollo, Castor, Pollux, Mercury, Pluto, Agent

3. Jump straight into the [SDK-REFERENCE](modules.html)


139 changes: 0 additions & 139 deletions docs/Agent.md

This file was deleted.

Loading

0 comments on commit 7d31205

Please sign in to comment.