Skip to content

Concordium/concordium-node-sdk-js

Concordium SDK for Javascript

Contributor Covenant

Wrappers for interacting with the Concordium node.

Table of Contents:

Documentation

Please see the documentation for more information

Packages

Contains the different packages for the JS-SDKs.

SDK package

The SDK contains the actual SDK, which can used in both a web and NodeJS environment.

Rust-bindings package

The rust-bindings contains bindings for Rust code, which is used by the SDK through WASM. This package is a utility package that should not be used directly, only through the usage of the SDK.

Ccd-js-gen package

The ccd-js-gen contains a library and CLI for generating smart contract clients for TypeScript and JavaScript.

Install/updating dependencies

To install/update dependencies for the project, run

git submodule update --init --recursive

and

yarn

MacOS arm64

It may be necessary to install Xcode when installing dependencies on a mac.

On a mac with an arm64 processor, it might also be required to explicitly set the target architecture of dependencies to x64, as not all dependencies are available for the new mac processors. This is done by replacing the yarn command with

npm_config_target_arch=x64 yarn

Build

Building for a release

To build the project run

yarn build

This will build all the subprojects.

Building for development

To build the project quickly during development run

yarn build:dev

This will build all the subprojects. Note that this skips generating the grpc API and optimizing the wasm modules.

Making a new release

The following describes the requirements for creating a new release for each of the packages contained in this repository.

SDK

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Commit and tag the release.
    • Tag should be sdk/x.y.z.
  • Run the deploy workflow.
    • Under github actions, run the "deploy" workflow and download the build-release artifact. Unpack this file and use it for the release.
  • Publish the release to NPM.
    • From the sdk package directory (packages/sdk) run yarn npm publish

rust-bindings

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Update the dependency to rust-bindings in the sdk
  • Update the CHANGELOG in the sdk
    • Add a change entry: Bumped @concordium/rust-bindings to x.y.z.
  • Commit and tag the release.
    • Tag should be rust-bindings/x.y.z.
  • Build the release.
    • Under github actions, run the "deploy" workflow and download the build-release artifact. Unpack this file and use it for the release.
  • Publish the release to NPM.
    • From the rust-bindings package directory (packages/rust-bindings) run yarn npm publish

ccd-js-gen

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Commit and tag the release.
    • Tag should be ccd-js-gen/x.y.z.
  • Run the deploy workflow.
    • Under github actions, run the "deploy" workflow and download the build-release artifact. Unpack this file and use it for the release.
  • Publish the release to NPM.
    • From the ccd-js-gen package directory (packages/ccd-js-gen) run yarn npm publish

Test

An automatic test suite is part of this project, and it is run by executing:

yarn test

This will run the tests for each package.

Note that the tests for nodejs require a locally running concordium-node on the testnet. Otherwise the tests will fail.