#consensus #bft #cometbft #tendermint #blockchain

cometbft-light-client-js

cometbft-light-client-js provides a lightweight, WASM-based interface to the CometBFT Light Client's verification functionality

1 unstable release

0.1.0-alpha.2 Jan 27, 2024

#9 in #cometbft

Apache-2.0

1MB
16K SLoC

Light-Client API for JavaScript

At present this just exposes the CometBFT Light Client's verification logic via WASM. This allows simple access to verification from JavaScript:

import * as LightClient from 'cometbft-light-client-js';

// Verify an untrusted block against a trusted one, given the specified options
// and current date/time.
let verdict = LightClient.verify(untrusted, trusted, options, now);

For an example of how to use this, please see the verifier-web example.


lib.rs:

CometBFT Light Client JavaScript/WASM interface.

This crate exposes some of the cometbft-light-client-verifier crate's functionality to be used from the JavaScript ecosystem.

For a detailed example, please see the verifier-web example in the repository.

Dependencies

~8.5MB
~157K SLoC