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.
Integration tests:
- Docker v20.10+
Documentation:
- Contracts (inside SDK repo) - Smart contracts to run the governance, identity, DAO, token and other ecosystem tools. This is used to run the integration tests
- Communication (inside SDK repo) - Service to provide peer-to-peer messaging for Tonomy ID users. This is used to run the integration tests
yarn run build
Build notes:
- Build just the sdk
yarn run build:sdk
- Build just the cli
yarn run build:cli
- Cli has dependency of
argon2
package, which is not needed by SDK and should be moved to a devDependency if these softwares are ever separated.
- Cli has dependency of
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
.
To show logs during tests export LOG=true
Tests individual class and function logic within the SDK.
yarn test:unit
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
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
yarn run cli
Linting is done with eslint
. Install the recommended VS Code plugin to see markers in your code.
yarn run lint
See errors.ts. All errors have a registered unique enumeration code.
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