This cheatsheet runs the local Caliper demo from local seeded generator data to learner context and VP creation.
- Install dependencies:
npm ci
- Have TLCS API reachable locally (or deployed and reachable).
Run whichever local start flow you use for this repo (API + queue consumer).
If testing UI:
npm run dev:learner-ux
Add these values to the repo root .env file:
CALIPER_INGEST_URL=https://<your-api>/ingest/caliperOptional auth/token settings in the same .env file:
# Option A: direct bearer token
# CALIPER_INGEST_TOKEN=<bearer-token-if-required>
# Option B: auto-mint token from Cognito client credentials
CALIPER_OAUTH_TOKEN_URL=https://<your-cognito-domain>/oauth2/token
CALIPER_OAUTH_CLIENT_ID=<app-client-id>
CALIPER_OAUTH_CLIENT_SECRET=<app-client-secret>
# Optional scope string (space-delimited)
CALIPER_OAUTH_SCOPE=
export CALIPER_SENSOR_ID="urn:uuid:local-sensor-demo"
export GENERATOR_WARMUP_SECONDS="3"
export GENERATOR_PUSH_INTERVAL_SECONDS="20"npm run generate:caliperExpected console output includes startup plus repeating loop output:
sent entities snapshotsent random scenarios- total count of envelope
data[]items sent
- Confirm ingest accepted (from logs or response with
submissionId). - Check submission status:
GET /submissions/{submissionId}
- Confirm learner context is materialized:
GET /learners/{learnerId}/context
- Confirm stacked timeline projection is available:
GET /learners/{learnerId}/context?view=timeline&stackBy=day
You should see session-oriented context derived from projected Caliper session credentials.
Timeline mode should include timeline.layers[] with graph node/edge counts and snapshot provenance.
Create VP:
POST /presentation/create- Include:
learnerId- selected credential IDs and claim IDs
audience,purpose,expirationDate
Verify VP:
POST /presentation/verify- Include created
vp.
- Generator now rotates through randomized story mixes (
quick,assessment-heavy,instructor-review,discussion,practice). - Keep generator running to demonstrate replay-safe persistence as fresh random scenarios arrive.
- Step 1 - quick user/course setup
- Run generator and call Caliper ingest.
- Narrate: "Institution systems send learner activity to Caliper endpoint."
- Step 2 - context builds up
- Open learner UX and
Load ContextwithstackBy=day. - Show stacked timeline layers increasing as new events are ingested.
- Open learner UX and
- Step 3 - opinionated filtering
- Select subset of credential claims in learner view.
- Mention policy enforcement: known issuers only + max claims per credential.
- Step 4 - download filtered context
- Generate VP and download JSON.
- Step 5 - upload and verify
- Upload VP on verifier page and run verify.
- Step 6 - prove source and tamper checks
- Show verifier checks and provenance hints in approved content cards.