feat(scripts): deploy the vendored DARs and run the token registry on 3013 - #162
Merged
lmcorbalan merged 3 commits intoSep 4, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…t URL and hide the bearer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #153
dev-stack.shbrought up four services and deployed one built DAR, so the token-forgeside of the stack could not be exercised by anyone who had not wired it up by hand. This
adds the fifth service and the two vendored DARs it needs, and closes PR 1 of the
token-forge migration.
The registry takes its whole non-secret configuration from the
KEY=valueblockbootstrapprints on stdout, whichupnow tees and reads back. Nothing is written todisk, so nothing can go stale between the two scripts.
LEDGER_API_TOKENis the onevariable outside that block, because bootstrap never sees the bearer and supplies it from
.envinstead.Changes
updeploysvendor/canton-token-forge.darthenvendor/vesting.darafter the built DARupstarts the token registry on 3013 and blocks until/readyzreturns 2xxdownstops the registry, and bothdownandstatuscover 3010-3013dev-stack.sh'sREGISTRY_ENV_KEYStogetheruprestarts a registry left from an earlier run rather than skipping the busyport, and fails if anything else holds it
uphands the resolved participant URL tobootstrap, so an exportedCANTON_JSON_API_URLmoves every step of the run rather than only some of themenv's argvDeviations
scripts/bootstrap-vesting.test.mjs, not the plan'sbootstrap-registry-env.test.mjs: Seed the DBT instrument admin and config in bootstrap #152's review renamed it to match its sibling source.architecture.md; Seed the DBT instrument admin and config in bootstrap #152 already landed one.README.mdgains a Token registry step beyond the plan's DAR-block edit, because theREADME documents the manual loop and the acceptance criteria ask it to name the registry.
down's fallback matchescanton-token-forge/registry/dist, not the plan'scanton-token-forge-registry. The plan's pattern cannot match the running process: thebin is a shim that execs
node .../canton-token-forge/registry/dist/index.js, so thehyphenated string survives only on the
pnpm execparent thatstop_pidfilealreadykilled. Left as written,
downcould leave 3013 held with no diagnostic.start_registryrestarts a busy port instead of skipping it as wallet-service and vitedo. Those two are configured from
.envand the repo, so an already-running one is theprocess
upwould have started; the registry is configured from the block bootstrapprinted this run, and bootstrap mints a fresh admin party and
InstrumentConfigeverytime. A leftover therefore serves a superseded instrument while still answering
/readyz, so skipping it is silently wrong and no readiness probe would catch it.Known minors
start_registryderives the port from thebootstrap block, as do the
lsof -iTCP:3010-3013ranges indownandstatus. The porthas one definition, in
bootstrap-vesting.mjs, and the shell has no constant to thread.restart. Better end state, but it changes what Seed the DBT instrument admin and config in bootstrap #152 landed, so it is not in this PR.
Acceptance criteria
updeployscanton-token-forge.darbeforevesting.darLEDGER_API_TOKENcomes from.env, never from that blockupgates on a 2xx/readyzdownstops the registry and leaves 3010-3013 freedev-stack.sh's key list and bootstrap's printed keys togetherarchitecture.md,CLAUDE.mdandREADME.mdname the registry and the vendored DARsTest plan
Automated tests
pnpm testcoversscripts/bootstrap-vesting.test.mjs, which now parsesdev-stack.shfor its
REGISTRY_ENV_KEYSarray and asserts that bootstrap prints every key it readsexactly once, that
LEDGER_API_TOKENis not among them, and that the five template idssurvive quote-stripping unchanged. Add a registry variable to one file and the test fails
until the other follows.
Full gate run on this branch:
lint,typecheck,test,knip,docs:check,check:anatomyand CI's build step all pass.Manual verification
./scripts/dev-stack.sh upcurl -sS http://localhost:3013/readyzreturns{"status":"ready"}curl -sS http://localhost:3013/registry/metadata/v1/inforeports anadminIdequal tothe
adminline bootstrap printed in that runcurl -sS http://localhost:3013/registry/metadata/v1/instrumentsreports oneDBTinstrument with
decimals: 10./scripts/dev-stack.sh down, thenlsof -nP -iTCP:3013 -sTCP:LISTENreports nothingThe restart path was exercised separately, against a stand-in process launched from a real
canton-token-forge/registry/dist/index.jspath sopkill -fmatches the same argv itwould in a live run: the leftover is stopped and 3013 frees, while an unrelated listener on
3013 survives, which is the case that now aborts
uprather than reusing it.Steps 2-5 were verified against a live LocalNet. Step 1 could not be:
upstill prechecksfor
dpm, which PR 3 removes, so bootstrap'sAmuletVestingFactoryhalf was skipped andits instrument half run unchanged to produce a real env block. The registry then booted
from that block through the script's own parser, and the teardown was confirmed against a
live process. A successful boot is itself proof the parser strips the block's single
quotes: the registry rejects a template id that still carries one.
Breaking changes
None.
Checklist
Screenshots
None.