Update README

This commit is contained in:
dancoffman 2022-11-03 23:44:08 -07:00
parent be0f51bd7e
commit 46fb7cc10b
No known key found for this signature in database
GPG Key ID: 47B1F53E36A9B3CC
1 changed files with 39 additions and 8 deletions

View File

@ -1,19 +1,50 @@
This directory contains the code necessary to generate NodeJS bindings for C-KZG. This directory contains the code necessary to generate NodeJS bindings for C-KZG.
First, install: ```js
``` loadTrustedSetup: (filePath: string) => SetupHandle;
yarn install
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
``` `npm install -g yarn` if you don't have it.
make build
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
``` ```