Giter Site home page Giter Site logo

ssb-validate2-rsjs-node-archived's Introduction

โš ๏ธ This repo was moved to https://github.com/ssbc/ssb-validate2-rsjs-node. This archival will remain in this GitHub org ssb-ngi-pointer to demonstrate the outcome of the work done by the SSB NGI Pointer team during 2020 and 2021. The SSB NGI Pointer team is no longer active because we completed our grant project.

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.

ssb-validate2-rsjs-node-archived's People

Contributors

mycognosist avatar staltz avatar

Watchers

Henry avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.