feat: add the token-forge side alongside the Canton Coin one - #163
Conversation
build: vendor the canton-token-forge and vesting DARs
build: add the canton-token-forge registry service as a dev dependency
…E.md's bootstrap bullet
…vesting operator and factory
feat(scripts): seed the DBT instrument admin and config in bootstrap
…real process on down
…t URL and hide the bearer
feat(scripts): deploy the vendored DARs and run the token registry on 3013
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…start to its port
d2def36 to
321a183
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core dev infrastructure (dev-stack process lifecycle, a build-script-running git dependency, and the lockfile) whose full up integration path depends on dpm/Docker/LocalNet and cannot be end-to-end validated here.
Pull request overview
This PR stands up the canton-token-forge registry side-by-side with the existing Canton Coin path, so the read-only CIP-56 registry can be proven against a barebones participant before a larger backend rewrite begins. It vendors both required DARs as committed binaries, seeds a DBT instrument during bootstrap, and wires the registry into the dev-stack.sh local loop on port 3013 — all driven by a KEY=value block that bootstrap prints on stdout and dev-stack.sh reads back, so no config file exists to go stale.
Changes:
- Vendors
canton-token-forge.darandvesting.dar(withPROVENANCE.mdand a*.dar binarygitattribute), and adds@bootnodedev/canton-token-forge@v0.2.0as a git devDependency (lockfile,allowBuilds,knipignore). - Extends
bootstrap-vesting.mjsto create an instrument admin, seed oneDBTInstrumentConfig, and print a registry env block; adds a contract test that keeps the printed keys anddev-stack.sh'sREGISTRY_ENV_KEYSin sync. - Adds registry start/stop/port lifecycle to
dev-stack.sh, and switches bothbootstrap-vesting.mjsandmint-token.mjsfrom anargv[1]comparison toimport.meta.main(fixing a symlinked-checkout no-op), with a new symlink test.
File summaries
| File | Description |
|---|---|
vendor/PROVENANCE.md |
Documents both vendored DARs; checksums/sizes verified to match the committed binaries. |
scripts/bootstrap-vesting.mjs |
Seeds the instrument admin + DBT config, adds formatRegistryEnv, guards main() with import.meta.main. |
scripts/bootstrap-vesting.test.mjs |
New contract test asserting the printed block matches the keys dev-stack.sh reads back. |
scripts/mint-token.mjs / .test.mjs |
Switches guard to import.meta.main; adds a symlinked-path invocation test. |
scripts/dev-stack.sh |
Deploys vendored DARs, teeing bootstrap output, and manages the registry lifecycle on 3013. |
README.md / CLAUDE.md / architecture.md |
Document the registry service, updated loop steps, and the bootstrap/dev-stack contract. |
pnpm-workspace.yaml / pnpm-lock.yaml / package.json / knip.json |
Register the git dependency and its build/ignore entries. |
.gitattributes |
Marks *.dar as binary. |
I reviewed the shell lifecycle, env-key contract, ledger/bootstrap logic, and docs, and verified import.meta.main behavior (including through a symlink) plus the vendored DAR checksums. I found no concrete defects to comment on: the env-key contract is consistent between bootstrap and dev-stack.sh, the module-guard change is correct for the pinned Node 24.20, and the vendored binaries match their documented provenance. The one known cosmetic nit (the "Stack is up" heredoc hardcoding 3013) is explicitly acknowledged and deferred in the PR description.
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
- Files reviewed: 12/16 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Closes #154
The backend rewrite cannot start until the registry is proven against a barebones
participant, which had never been tried. This lands that infrastructure on its own and
leaves the Canton Coin path running.
Changes
bootstrapseeds the instrument admin and oneDBTinstrumentKEY=valueblock bootstrap prints on stdout, so no config file exists to go staleupdeploys the vendored DARs and blocks until the registry answers/readyzbootstrapandmint-tokenguardmain()onimport.meta.main: comparingargv[1]against a realpathed path made a symlinked checkout exit 0 having created nothingDOTENV_CONFIG_PATH=/dev/nullso wallet-service's.env, theCANTON_AUTH_SECRETsigning key included, stays out of its environmentdpmprecheck,build-darand the Canton Coin path are untouchedDeviations
/registry/metadata/v1/infocarries onlyadminIdandsupportedApis, so theDBTcheck is/instruments. The Does the canton-token-forge registry boot against a barebones participant? #151 spike found this and issue Add the token-forge side alongside the Canton Coin one #154's second criterion has been corrected to matchv0.2.0, not the spec'sv0.1.0: the asset is byte-identical, so one tag governs both the DAR and the registry pinAcceptance criteria
dev-stack.sh upstarts five services and the registry answers/readyzon 3013/registry/metadata/v1/instrumentsreports oneDBTinstrumentdev-stack.sh downleaves 3010-3013 freeTest plan
Automated tests
pnpm installpnpm testmint-tokenthrough a symlinked pathManual verification
dpmis on PATH, then run./scripts/dev-stack.sh upcurl -sS http://localhost:3013/readyzand expect{"status":"ready"}curl -sS http://localhost:3013/registry/metadata/v1/instrumentsand expect oneDBTinstrument withdecimals: 10./scripts/dev-stack.sh down, then expectlsof -nP -iTCP:3010-3013 -sTCP:LISTENto report nothingSteps 3, 4 and 6 were verified against a live LocalNet while the task PRs landed. Steps 1,
2 and 5 need a machine with
dpm, which PR 3 removes, so the two criteria they cover areleft unchecked above.
Known minors
start_registrylogs$port.registry_port()now exists and would close it in one line, deferred rather than widened into this PR.Breaking changes
None.
Checklist
Screenshots
None.