diff --git a/bindings/node.js/README.md b/bindings/node.js/README.md index 6a76169..fc529d0 100644 --- a/bindings/node.js/README.md +++ b/bindings/node.js/README.md @@ -1,19 +1,50 @@ This directory contains the code necessary to generate NodeJS bindings for C-KZG. -First, install: +```js -``` -yarn install + loadTrustedSetup: (filePath: string) => SetupHandle; + + freeTrustedSetup: (setupHandle: SetupHandle) => void; + + blobToKzgCommitment: (blob: Blob, setupHandle: SetupHandle) => KZGCommitment; + + computeAggregateKzgProof: ( + blobs: Blob[], + setupHandle: SetupHandle + ) => KZGProof; + + verifyAggregateKzgProof: ( + blobs: Blob[], + expectedKzgCommitments: KZGCommitment[], + kzgAggregatedProof: KZGProof, + setupHandle: SetupHandle + ) => boolean; ``` -Then build +Spec: https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md -``` -make build +`npm install -g yarn` if you don't have it. + +Install the blst submodule + +```sh +git submodule update --init ``` -Run the TypeScript tests +Build blst and c_kzg_4844.c ``` -yarn test +cd src && make blst lib +``` + +Generate NodeJS bindings and run the TypeScript tests against them + +```sh +cd ../bindings/node.js && yarn install && make test +``` + +After doing this once, you can re-build (if necessary) and re-run the tests with + +```sh +make build test ```