c-kzg-4844/bindings/node.js/CONTRIBUTING.md

1.4 KiB

Contribution Guidelines

Thanks for your interest in contributing to the Node.js bindings for c-kzg-4844.

Prerequisites

Setup

Open a terminal and navigate to the root of the c-kzg-4844 repo and run the following commands if you have not already done so:

git submodule update --init # Install the blst submodule
cd src
make blst # Build blst
cd ../bindings/node.js
yarn install --ignore-scripts # Install dependencies
make # Build bindings and verify build worked

Project Commands

  • make clean - cleans artifacts
  • make build - prepares assets and builds bindings
  • make test - runs unit tests
  • make format - lints code
  • make bundle - builds dist for publishing
  • make publish - runs npm publish

n-api and node-addon-api

There are two different flavors of abi-stable node addons. n-api is the C api that is natively exported by node.js. There is also a header-only C++ implementation of the n-api called node-addon-api. There is mixed usage of the two in this library.

The addon was built to be context-aware so it will be safe to run on a worker thread. Be sure not to use any static/global variables as those are not thread safe.