@cmts-dev/carmentis-sdk
v1.20.1
Published
Carmentis SDKs
Readme
Carmentis SDK
Carmentis SDK is a TypeScript library for interacting with the Carmentis blockchain platform.
Installation
npm install @cmts-dev/carmentis-sdkBuilding the Project
The project can be built using the following commands:
# Build everything (TypeScript compilation + client + server)
npm run buildAbout src/common/common.ts: As annotated in the src/common/common.ts file, it is generated by Barrelsby.
The generation process is transparent using the npm run build command, performing the file generation under the hood.
To generate the file manually, use npm run build:common-export or more directly using the Barrelsby binary with npx barrelsby
with the appropriate parameters.
Testing
The project uses Jest for testing. To run the tests:
# Run all tests
npx jest
# Run tests with coverage
npx jest --coverage
# Run specific test file
npx jest path/to/test-file.spec.tsTests are located in .spec.ts files throughout the source code.
Documentation
To generate documentation using JSDoc:
npm run docsUsage
Client-side Usage
import { BlockchainFacade } from '@cmts-dev/carmentis-sdk/client';
// Initialize the blockchain client
const blockchain = BlockchainFacade.createFromNodeURL("https://ares.testnet.carmentis.io");
// Use the SDK functionality
// ...Server-side Usage
import { BlockchainFacade } from '@cmts-dev/carmentis-sdk/server';
// Initialize the blockchain server
const blockchain = BlockchainFacade.createFromNodeURL("https://ares.testnet.carmentis.io");
// Use the SDK functionality
// ...License
See the LICENSE.txt file for details.
