npm.io
0.1.14 • Published 1 month ago

@iota/notarization

Licence
Apache-2.0
Version
0.1.14
Deps
1
Size
5.8 MB
Vulns
0
Weekly
0
Stars
4

IOTA Notarization

Install the Library

If your project does not contain it already, install the peer dependency @iota/iota-sdk as well.

npm install @iota/iota-sdk

You can install the latest alpha version of the library by running the following command:

npm install @iota/notarization@alpha

Build the Library

Alternatively, you can build the bindings yourself if you have Rust installed. If not, refer to rustup.rs for the installation.

Requirements
  • Node.js (>= v20)
  • Rust (>= 1.65)
  • Cargo (>= 1.65)
  • for running example: a local network node with the IOTA Notarization Package deployed as being described here
1. Install Local Tooling

If you want to build the library from source you have to install additional build tools locally.

Install wasm-bindgen-cli

First you need to install wasm-bindgen-cli. A manual installation is required because we use the Weak References feature, which wasm-pack does not expose.

cargo install --force wasm-bindgen-cli
Install wasm-opt

To reduce the size of the wasm package, it is optimized with wasm-opt, which is part of binaryen.

You can either download a release of binaryen and make the bin folder available in your PATH or check if your operating system tooling offers a more convenient way of installing the binaries like APT, Homebrew, etc.

Some examples:

  • Linux via APT: sudo apt-get update && sudo apt-get -y install binaryen (taken from here)
  • MacOS via Homebrew: brew install binaryen (see Homebrew entry)
2. Install Dependencies

After installing local tooling, you can install the necessary dependencies using the following command:

npm install
3. Build

You can build the bindings for node.js using the following command:

npm run build:nodejs