mirror of
https://github.com/tlsnotary/tlsn-js.git
synced 2026-01-08 20:18:01 -05:00
92d70032d93fba1400bd1c47e99b866b817cd6d4
tlsn-js
NPM Modules for proving and verifying using TLS Notary.
The prover requires a notary-server and websockify proxy
Example
import { prove, verify, NOTARY_SERVER_PUBKEY } from '../src';
// To create a proof
const proof = await prove('https://swapi.dev/api/people/1', {
method: 'GET',
headers: {
Connection: 'close',
Accept: 'application/json',
'Accept-Encoding': 'identity',
},
body: '',
maxTranscriptSize: 20000,
notaryUrl: 'https://127.0.0.1:7047',
websocketProxyUrl: 'ws://127.0.0.1:55688',
});
// To verify a proof
const result = await verify(proof, NOTARY_SERVER_PUBKEY);
console.log(result);
Running a local websockify proxy for https://swapi.dev
git clone https://github.com/novnc/websockify && cd websockify
./docker/build.sh
docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443
Install as NPM Package
npm install tlsn-js
Development
npm install
npm run lint
npm test
Build
npm install
npm run build
Description
Releases
10
Languages
TypeScript
87.2%
JavaScript
9.8%
Shell
1.6%
EJS
1.4%