example
Examples
Three short Node.js scripts, each run in this repository: generate every table, prove the run, and check that two runs are identical.
Last updated 2026-09-14 · Markdown
Summary
These are the calls the website’s own build makes to put real generated rows on the homepage, so they are known to run.
Generate every table
const fs = require('node:fs');
const wl = require('./packages/sdk-node/index.js');
const recipe = JSON.parse(fs.readFileSync('examples/homepage-demo.wl.json', 'utf8'));
const run = wl.generateAll(recipe, { seed: recipe.seed });
for (const t of run.tables) {
const [header, ...rows] = t.rows; // rows[0] is the header row
console.log(t.entity, header.join(','), rows.length, 'rows');
}Prints Customer and Order with their columns and counts.
Prove the run
const proof = wl.prove(recipe, { seed: recipe.seed });
console.log(proof.passed, proof.realism.overall); // true 100
console.log(proof.receipt.content_hash); // sha256:…
for (const m of proof.realism.metrics) console.log(m.status, m.label);The receipt block is what /verify recomputes.
Two runs, one hash
const a = JSON.stringify(wl.generateAll(recipe, { seed: 7 }));
const b = JSON.stringify(wl.generateAll(recipe, { seed: 7 }));
console.log(a === b); // trueThis is the property the website build relies on before it publishes the homepage preview.
Related
SDK APIEvery function the Node.js SDK exports — generate, prove, inspect, read a file, manage packs — with what each returns.Seeds & determinismSame recipe, same seed, same bytes — on any machine. What that guarantee covers, and the three things that change the output.ReceiptsWhat a run’s proof report contains, field by field, with a real one — and the line between what it proves and what it does not.