1.1.0 • Published 12 months ago

libzkbob-rs-node v1.1.0

Weekly downloads
-
License
MIT OR Apache-2.0
Repository
-
Last release
12 months ago

libzkbob-rs-node

This project was bootstrapped by create-neon.

Installing libzkbob-rs-node

Installing libzkbob-rs-node requires a supported version of Node and Rust.

You can install the project with yarn. In the project directory, run:

$ yarn install

This fully installs the project, including installing any dependencies and running the build.

Building libzkbob-rs-node

If you have already installed the project and only want to run the build, run:

$ yarn build

This command uses the cargo-cp-artifact utility to run the Rust build and copy the built library into ./index.node.

Example

const zp = require('libzkbob-rs-node');

const tree = new zp.MerkleTree('./treedb');
const storage = new zp.TxStorage('./txdb');

for (let i = 0; i < 100; ++i) {
    storage.add(i, Buffer.alloc(128));
    tree.addHash(i, Buffer.alloc(32));
}

const proof = tree.getProof(50);
console.log('Proof', proof);

Available Scripts

In the project directory, you can run:

yarn install

Installs the project, including running yarn build.

yarn build

Builds the Node addon (index.node) from source.

yarn test

Runs the unit tests by calling cargo test. You can learn more about adding tests to your Rust code from the Rust book.

Testing suite

You can find the library usage example with few tests in test.js file You can launch it with the following command after building the local library:

$ node test.js
1.1.0

12 months ago

1.0.0

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.2

1 year ago

0.1.27

2 years ago

0.1.26

2 years ago

0.1.25

2 years ago