@blockwavelabs/demo-payer
v0.1.2
Published
API-key authenticated demo payer for receipt API load and lifecycle demos.
Downloads
65
Readme
@blockwavelabs/demo-payer
API-key authenticated demo payer for receipt API load and lifecycle demos.
Npm package: https://www.npmjs.com/package/@blockwavelabs/demo-payer
Package Contents
The npm artifact is intentionally dist-only: dist/*.js, dist/*.d.ts,
README.md, LICENSE, and package.json. TypeScript src/ files and source
maps are not published.
This package creates demo receipts through POST /api/receipts, fetches the
receipt proof, then optionally polls the receipt lifecycle until COMMITTED or
ANCHORED.
It always requires an API key. It is not an anonymous public write tool.
npm install @blockwavelabs/demo-payerCLI
demo-payer run \
--api-url https://api.example.com \
--api-key "$RECEIPT_API_KEY" \
--count 100 \
--rate 5 \
--scenario skewed \
--wait anchored \
--out receipts.jsonlWhen --wait anchored is used, each JSONL result includes the receipt proof
needed by @blockwavelabs/receipt-proof, so the verification step does not
need an API URL:
receipt-proof rcpt_... --proof receipts.jsonl --jsonJavaScript API
import { DemoPayer } from '@blockwavelabs/demo-payer';
const payer = new DemoPayer({
baseUrl: 'https://api.example.com',
apiKey: process.env.RECEIPT_API_KEY!,
});
const results = await payer.run({ count: 10, ratePerSecond: 2, wait: 'anchored' });
console.log(results[0].receiptId, results[0].proof);API Key Model
Receipt creation is operator/system-key gated. Publishing this package publicly does not grant write access; callers still need a valid API key from the API operator.
