feat: reduce LocalNet setup to pnpm install and dev-stack.sh up - #122
Open
gabitoesmiapodo wants to merge 6 commits into
Open
feat: reduce LocalNet setup to pnpm install and dev-stack.sh up#122gabitoesmiapodo wants to merge 6 commits into
gabitoesmiapodo wants to merge 6 commits into
Conversation
The LocalNet config now lives at the repo root instead of a folder each developer scaffolds by hand, with validators.appUser.ui and sv.scanUI on so nginx serves /api/validator. The CLI is a pinned devDependency rather than an npx resolution, and knip ignores it because nothing imports it.
`up` now mints CANTON_BACKEND_TOKEN into a fresh .env itself, between the .env.example copy the mint recipe is read from and the source that has to see the value, so a clean clone needs no pasted token. The scaffold-a-config warning path is gone with the config committed, and the CLI is reached through pnpm exec so its version is the pinned one.
The Stack table gains a row for the LocalNet provider, and the passages that described init as a setup step and ~/canton-localnet as the default directory now describe the committed config and the repo-root default. README is left for a separate pass.
Setup is now one install: the canton-barebones config is committed and dev-stack.sh mints the token itself, so the scaffold-a-folder and paste-a-token steps are gone. The step-by-step path keeps its manual commands, run from the repo root through pnpm exec.
The scaffolded config is a derived artifact, not a tracked file: dev-stack.sh builds .canton-localnet/ from the pinned tool's own template and turns on validators.appUser.ui and sv.scanUI, without which nginx serves no /api/validator or /api/scan. It re-scaffolds whenever that template moves past the local copy, on a config version bump the tool would otherwise reject outright or a Splice tag bump that would otherwise hold the stack on a version the tool was not tested against. Committing the file could not do either: init never overwrites, so a tracked copy goes stale the same way and freezes the tag besides. Anything else set there survives until the template moves; a standing deviation goes in its own directory via CANTON_LOCALNET_DIR. The Splice checkout and the runtime env land inside .canton-localnet/ too, so one ignored folder holds the whole LocalNet working state.
Setup stays one install. The step-by-step section keeps the manual scaffold, flag edit and start it always had, now against .canton-localnet.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9 tasks
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 #121
Standing up the LocalNet took a folder outside the repo, an
init, two hand-editedflags and a pasted token. A clean clone now needs
pnpm installand./scripts/dev-stack.sh up. Stacked onfeat/119(PR #120).Changes
@bootnodedev/canton-barebonespinned exact, replacing the floatingnpx --yesinvocationupscaffolds the LocalNet config itself into the gitignored.canton-localnet/, forcing the two flags nginx needs for/api/validatorand/api/scanLOCALNET_DIRdefaults to the repo root; positional andCANTON_LOCALNET_DIRoverrides unchangedupmintsCANTON_BACKEND_TOKENinto a fresh.envitself, leaving an already-set token alone and never echoing itReview guide
scripts/localnet-config.mjsis the one file needing real review: it decides when to replace a developer's LocalNet config, and getting that wrong silently discards local edits. Read its staleness rule and the flag-forcing, alongside the three known gaps under Follow-ups.Then the mint block in
scripts/dev-stack.sh: confirm the token never reaches stdout and that an already-set one is left alone.Skimmable: the docs. Generated:
pnpm-lock.yaml.Deviations
initnever overwrites, so a tracked config goes stale exactly like a local one, freezessplice.tag, and turns a config-format bump into every command failing until someone runsinit --forceand re-applies the flags by hand. Scaffolding from the installed template keeps it tracking the pinned version, and keeps the LocalNet folder untracked@bootnodedev/canton-barebonesstays out of knip'signoreDependencies, becauselocalnet-config.mjsimports itFollow-ups
Not fixed here:
upforces the two flags on whateverLOCALNET_DIRpoints at; it should only own the directory it createssplice.tagbump replaces the whole config where updating the tag in place would dopnpm execresolves a bin only inside the workspace, so./scripts/dev-stack.sh ~/some-folderfails for a directory outside the repoAcceptance criteria
@bootnodedev/canton-barebonespinned exact in root devDependencies and added toignoreDependenciesinknip.json— see Deviationscanton-barebones.config.jsoncommitted at the repo root withvalidators.appUser.ui: trueandsv.scanUI: true— see Deviationssplice-localnet-overrides.yamlcommitted beside it,splice.tagleft at whateverinitproduces — see Deviations.generated/ignored and untrackeddev-stack.shdefaultsLOCALNET_DIRto the repo root, keeping the positional andCANTON_LOCALNET_DIRoverridesdev-stack.shcallspnpm exec canton-barebones, and the scaffold-a-config warning path is gonedev-stack.shmintsCANTON_BACKEND_TOKENinto a fresh.envitself, never echoing it to the terminal.envreaches the dApp on 3012 through the two commands alonepnpm lint,typecheck,test,build,knip,docs:checkandcheck:anatomyall passTest plan
All of the below passed on this branch, plus a faked stale
splice.tagre-scaffoldingand re-applying the flags, and
downtearing the stack back down.Automated tests
pnpm installpnpm lint,pnpm typecheck,pnpm test,pnpm build,pnpm knip,pnpm docs:checkandpnpm run check:anatomypnpm testcovers the new scaffolding unit testsManual verification
rm -f .env && rm -rf .canton-localnetin the repo rootpnpm install./scripts/dev-stack.sh upwith no arguments.canton-localnet/is absent fromgit status./scripts/dev-stack.sh upagain and expectCANTON_BACKEND_TOKEN already set in .env.Breaking changes
None.
Checklist
Screenshots
None.