Files
tlsn-js/utils/web.ts
2024-01-08 17:08:48 -05:00

25 lines
607 B
TypeScript

import { prove, verify } from '../src';
(async function runTest() {
try {
console.log('hihihihihihihih')
console.time('prove');
const proof = await prove('https://swapi.dev/api/people/1', {
method: 'GET',
maxTranscriptSize: 16384,
notaryUrl: 'http://localhost:7047',
websocketProxyUrl: 'ws://localhost:55688',
});
console.timeEnd('prove');
console.time('verify');
const result = await verify(proof);
console.timeEnd('verify');
console.log(result);
} catch(err) {
console.log('caught error from wasm');
console.error(err);
}
})();