This folder contains a simple example web application demonstrating Tendermint Light Client verification.
- Rust stable latest
- NodeJS (tested with v14.15.5)
- wasm-pack
You first need to build a few things before you can try this example out locally.
From the light-client-js
folder:
wasm-pack build
This will build our WASM binary and JavaScript/TypeScript wrappers and place
them into a pkg
directory.
From this directory (light-client-js/examples/verifier-web
):
# Install all dependencies
npm install
# Build/start the example app
npm run start
This should build the example and start a server at http://localhost:8080
When you open up at http://localhost:8080, you should see something like the following:
Copy/paste the JSON representation of a trusted block alongside that of the untrusted block you wish to verify into the supplied editors. Configure your desired Light Client parameters, as well as the timestamp at which you want to check whether the untrusted block is trustworthy, and click the Verify button.
This will show you the raw JSON object received back from the verifier.
- This example only demonstrates verification, and is pretty manual right now (you must manually copy/paste the JSON representations of untrusted and trusted blocks, and supply options/timestamps manually). No network I/O happens here, so bring your own I/O to fetch light blocks.
- The WASM binary built in step 1 only works for bundled web applications (e.g. using webpack).