Skip to content

Commit

Permalink
client-sdk: merge enclave and vc-sdk packages into one (#3128)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Alvarez <jonathan@litentry.com>
  • Loading branch information
jonalvarezz authored Oct 15, 2024
1 parent 5a1cb48 commit 414b4e8
Show file tree
Hide file tree
Showing 82 changed files with 434 additions and 1,791 deletions.
6 changes: 3 additions & 3 deletions tee-worker/identity/client-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![Logo](https://avatars.githubusercontent.com/u/51339301?s=200&v=4)

# Litentry Client SDK
# Litentry Client Packages

This repository contains packages that are published on NPM for dApps to interact with the Litentry Protocol.

Learn more about it on [Litentry's official documentation](https://docs.litentry.com/parachain/client-sdks-documentation).

## Packages

- `@litentry/enclave` ([go-to](packages/enclave/README.md)): provides helpers for dApps to interact with the Litentry Protocol's Enclave
- `@litentry/vc-sdk` ([go-to](packages/vc-sdk/README.md)): provides the common functionality to help dApps parse and validate Litentry issued Verifiable Credentials.
- `@litentry/client-sdk` ([go-to](packages/enclave/README.md)): provides helpers for dApps to interact with the Litentry Protocol
- `@litentry/chaindata` ([go-to](packages/chaindata/README.md)): provides chain information of Litentry networks.
2 changes: 1 addition & 1 deletion tee-worker/identity/client-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "client-sdk",
"name": "@litentry-client-sdk/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions tee-worker/identity/client-sdk/packages/client-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## 2024-10-14

Initial version. Merge [@litentry/enclave](https://www.npmjs.com/package/@litentry/enclave) and [@litentry/vc-sdk](https://www.npmjs.com/package/@litentry/vc-sdk) into this one.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @litentry/enclave
# @litentry/client-sdk

This package provides helpers for dApps to interact with the Litentry Protocol's Enclave.
This package provides helpers for dApps to interact with the Litentry Protocol.

The Enclave is the Litentry's Trusted Execution Environment (TEE), that provides the hightest security and privacy for users to store their identity.

Expand All @@ -10,22 +10,22 @@ This is a browser package, it may not work as-is on Node.js due to Crypto Subtle

1. Install from NPM

```
npm install @litentry/parachain-api @litentry/sidechain-api @litentry/enclave
```
```
npm install @litentry/parachain-api @litentry/sidechain-api @litentry/client-sdk
```
2. Set the right environment
Litentry's Protocol is currently available in three main stages: local (development), `tee-dev` (staging), and `tee-prod` (production).
Litentry's Protocol is currently available in three main stages: local (development), `tee-dev` (staging), and `tee-prod` (production).
You can set what stage to use by setting the `LITENTRY_NETWORK` environment variable. Valid values are:
You can set what stage to use by setting the `LITENTRY_NETWORK` environment variable. Valid values are:
- `litentry-local`: will point to a local enclave `ws://localhost:2000`
- `litentry-dev` (default): will point to `tee-dev`'s Enclave.
- `litentry-staging`: will point to `tee-staging`'s Enclave.
- `litentry-prod`: will point to `tee-prod`'s Enclave.
- `litentry-local`: will point to a local enclave `ws://localhost:2000`
- `litentry-dev` (default): will point to `tee-dev`'s Enclave.
- `litentry-staging`: will point to `tee-staging`'s Enclave.
- `litentry-prod`: will point to `tee-prod`'s Enclave.
`NX_*` prefixed env variables (NX projects) will work too.
`NX_*` prefixed env variables (NX projects) will work too.
### Versions
Expand All @@ -41,50 +41,52 @@ Please refer to the `examples` folder in this repository to learn more about all
### Quick start
These are the steps for publishing the package locally for development purposes.
1. Install dependencies
```
pnpm install
```
```
pnpm install
```
2. Spin up an local NPM registry
```
pnpm nx local-registry
```
```
pnpm nx local-registry
```
3. Publish locally
Follow the steps of [Publish new versions](#publish-new-versions). The step 1 can be skipped.
Follow the steps of [Publish new versions](#publish-new-versions). The step 1 can be skipped.
As long as the local registry is up, any publishing will happen locally.
As long as the local registry is up, any publishing will happen locally.
4. Run test and lint checks
```
pnpm nx run enclave:lint
```
pnpm nx run client-sdk:lint
pnpm nx run enclave:test
```
pnpm nx run client-sdk:test
```
### Publish new versions
1. Bump the version on package.json to for instance `1.0.0`.
2. Update the latest documentation
```
pnpm nx run enclave:generate-doc
```
```
pnpm nx run client-sdk:generate-doc
```
3. Build the project
```
pnpm nx run enclave:build
```
```
pnpm nx run client-sdk:build
```
4. Publish the distribution files
```
pnpm nx run enclave:publish --ver 1.0.0 --tag latest
```
```
pnpm nx run client-sdk:publish --ver 1.0.0 --tag latest
```
Loading

0 comments on commit 414b4e8

Please sign in to comment.