Skip to content

Concordium/concordium-node-sdk-js

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Jun 28, 2023
May 18, 2022
Jul 4, 2023
Jun 26, 2023
Aug 9, 2023
Jun 23, 2023
Jul 5, 2021
May 25, 2023
May 25, 2023
May 12, 2023
Jun 23, 2023
May 25, 2023
May 18, 2022
Apr 3, 2023
Jun 22, 2023
Jul 4, 2023
Apr 19, 2022
May 18, 2022
May 19, 2022
Apr 22, 2022
Jun 21, 2023
Jul 5, 2023

Repository files navigation

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.

Nodejs package

The Nodejs package contains the Nodejs SDK, particularly the client that wraps the GRPC calls to the node, is located here.

Web package

The Web package contains the Web SDK, which can used in a web environment.

Common package

The common package contains the shared library for the Nodejs and Web SDK's. The GRPC-client, all serialization and most utility functions are located in this package.

Rust-bindings package

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

Install/updating dependencies

To install/update dependencies for the project, run

git submodule update --init --recursive

and

yarn

MacOS arm64

When installing/updating dependencies on a mac with an arm64 processor, it might 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.

Note that you must have wasm-pack installed to build the project.

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.

common

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Update the dependency to common in the web and nodejs packages.
  • Update the CHANGELOG in the web and nodejs packages.
    • Add a change entry: Bumped @concordium/common-sdk to x.y.z.
  • Commit and tag the release.
    • Tag should be common/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 common package directory (packages/common) run yarn npm publish

nodejs

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Commit and tag the release.
    • Tag should be nodejs/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 nodejs package directory (packages/nodejs) run yarn npm publish

web

  • Bump the version in package.json.
  • Update the CHANGELOG describing the changes made.
  • Commit and tag the release.
    • Tag should be web/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 web package directory (packages/web) 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 common and web packages.
  • Update the CHANGELOG in the common and web packages.
    • 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

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.