npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ssb-validate2-rsjs-node

v1.0.4

Published

Cryptographic validation of Scuttlebutt messages.

Downloads

38

Readme

ssb-validate2-rsjs-node

Cryptographic validation of Scuttlebutt messages in the form of Rust bindings for Node.js.

Perform batch verification and validation of SSB message values using ssb-verify-signatures and ssb-validate from the Sunrise Choir.

Note: messages are expected to be values and not KVT's (key, value, timestamp). The key is returned for each successfully validated message.

The node-bindgen crate is currently used to generate the bindings from Rust code.

Build

Rust first needs to be installed in order to build the bindings (installation instructions).

git clone [email protected]:ssb-ngi-pointer/ssb-validate2-rsjs-node.git
cd ssb-validate2-rsjs-node
cargo install nj-cli
# generate release build of ssb-validate2-rsjs-node
npm run build
# run the tests
npm run test

The build process creates bindings in ./dist/index.node.

If you wish to rebuild the bindings after making changes to the code, use the nj-cli tool:

nj-cli build --release

Tests

Tests for single-author and multi-author messages are included. These tests are defined and executed using tape. Test data (SSB messages) are dynamically-generated using ssb-fixtures. The tests can be found in the native/test directory.

Performance Benchmarks

After performing build instructions (see above):

cd ssb-validate2-rsjs-node
# Run benchmarks
npm run perf

The default values for the performance benchmarks (test/perf.js) are 100 messages from 1 author, for a total of 10 iterations. These value constants can be changed in test/perf.js. Performance benchmarks for the multi-author method default to 100 messages from 5 authors, for a total of 10 iterations (test/multiAuthorPerf.js).

Releasing New Versions

To release a new version, all that you need to do is update the version number in package.json and commit with a message that starts with the word "release", e.g. release 1.1.0. Then, CI (GitHub Actions) will detect that, and compile this library for many variations of operating system and Node.js versions and then publish those as prebuilds to NPM. This repository has an environment variable NPM_TOKEN set up so that GitHub Actions has publish permissions for this package.

License

LGPL 3.0.