Tonomy-Foundation / Tonomy-ID-SDK

This Software Development Kit is used in Tonomy ID to interact and call with the Antelope blockchain and services. It is also used as the public API for integration by applications to do single sign-on, share credentials and sign transactions.
https://tonomy-id-sdk-tonomy-foundation.vercel.app
Apache License 2.0
5 stars 1 forks source link
blockchain eosio sdk ssi sso

Tonomy ID SDK

The Software Development Kit is used in the Tonomy ID ecosystems to interact with Tonomy identities and services.

See https://docs.tonomy.foundation for documentation.

The SDK is written in typescript with jest to run tests.

Dependencies

Integration tests:

Documentation:

Sub-Repositories

Build

yarn run build

Build notes:

Run

yarn start

This builds to /build and runs the project in watch mode so any edits you save inside src causes a rebuild to /build.

To do a one-off build, use yarn run build.

Tests

To show logs during tests export LOG=true

Unit tests

Tests individual class and function logic within the SDK.

yarn test:unit

Integration tests

Tests end-to-end functions across more than one service.

First run the blockchain or Tonomy Communication service locally.

yarn run test:setup

Then run the tests

yarn run test:integration

Governance tests

Tests the governance of the system. Can only be run once before a blockchain reset is required.

First run the blockchain or Tonomy Communication service locally.

yarn run test:setup

Then run the tests

yarn run test:governance

Run all tests in the VS Code debugger

Make sure you install the Jest extension (recommended automatically when you open VS Code)

If you also want to do this with the integration tests then run yarn run test:setup first

Then go to any test e.g. test/app.test.ts and you can click ▶️ or right click and press "Debug test". You can also look at the Jest Test Explorer in the left-side activity bar.

Command line interface

yarn run cli

Bootstrapping

yarn run cli bootstrap

Environment variables are required to bootstrap the network. These values are provided by default in test and develpment environments but must be provided externally for non-dev environments:

Linting

Linting is done with eslint. Install the recommended VS Code plugin to see markers in your code.

yarn run lint

Error handling

See errors.ts. All errors have a registered unique enumeration code.

Documentation

Documentation is in the ./docs folder and runs with mkdocs with material theme.

Install with

sudo apt-get -y install mkdocs
pip install mkdocs-material

Then yarn run docs:serve