libzeropool-rs-node v0.3.5-dd
libzeropool-rs-node
This project was bootstrapped by create-neon.
Installing libzeropool-rs-node
Installing libzeropool-rs-node requires a supported version of Node and Rust.
You can install the project with npm. In the project directory, run:
$ npm installThis fully installs the project, including installing any dependencies and running the build.
Building libzeropool-rs-node
If you have already installed the project and only want to run the build, run:
$ npm run buildThis command uses the cargo-cp-artifact utility to run the Rust build and copy the built library into ./index.node.
Example
const zp = require('libzeropool-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:
npm install
Installs the project, including running npm run build.
npm build
Builds the Node addon (index.node) from source.
npm test
Runs the unit tests by calling cargo test. You can learn more about adding tests to your Rust code from the Rust book.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago