Skip to content

Commit 1f64f04

Browse files
Merge pull request #111 from paritytech/docs/refresh-cli-docs
docs: sync CLAUDE.md and README with current source
2 parents 8acd1df + 1ecb46c commit 1f64f04

3 files changed

Lines changed: 23 additions & 15 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ These are things that aren't self-evident from reading the code and have bitten
4343
- DSN: `src/telemetry-config.ts::PLAYGROUND_SENTRY_DSN`. Region: EU (`https://de.sentry.io`).
4444
- Org slug: `paritytech`. API token: macOS keychain service `sentry-api-token` (member of paritytech org with `org:read` + `org:write`).
4545
- Attribute prefix: `cli.` (see `getCliRootAttributes` in `src/telemetry-config.ts`). Spec: `sentry-instrumentation-spec.md` at the repo root (untracked — keep there).
46-
- **Helpers (don't reimplement):** `src/telemetry.ts` exports `withCommandTelemetry`, `withRootSpan`, `withSpan` (2-arg + 4-arg overloads), `captureWarning`, `captureException`, `errorMessage`, `sanitizedErrorMessage`. `src/utils/deploy/phase.ts` exports `withDeployPhase` for deploy-phase orchestration. `src/cli-runtime.ts` exports `runCliCommand` for the standard CLI scaffolding (telemetry + watchdog + hard-exit). Every command's `.action()` body should be one `runCliCommand(name, options, async () => { ... })` call — do not re-add try/finally + `scheduleHardExit` boilerplate.
46+
- **Helpers (don't reimplement):** `src/telemetry.ts` exports `withCommandTelemetry`, `withRootSpan`, `withSpan` (3-arg `(op, name, fn)` + 4-arg `(op, name, attributes, fn)` overloads), `captureWarning`, `captureException`, `errorMessage`, `sanitizedErrorMessage`. `src/utils/deploy/phase.ts` exports `withDeployPhase` for deploy-phase orchestration. `src/cli-runtime.ts` exports `runCliCommand` for the standard CLI scaffolding (telemetry + watchdog + hard-exit). Every command's `.action()` body should be one `runCliCommand(name, options, async () => { ... })` call — do not re-add try/finally + `scheduleHardExit` boilerplate. Today: `init` runs without `hardExit`/`watchdog`; `build`, `update`, `logout` run with `hardExit` only; `deploy` and `mod` run with both `watchdog` + `hardExit`.
4747
- **Dashboards** live as JSON snapshots under `sentry/dashboards/<id>.json`:
4848
- `2143100.json`**Playground CLI Health** (production filter `!cli.tag:e2e-*`).
4949
- `2216067.json`**Playground CLI Failures** (per-error-type drill-downs).

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,31 @@ Flags:
5454
- `--signer <mode>``dev` (fast, uses shared dev keys for upload + DotNS — 0 or 1 phone approval) or `phone` (signs DotNS + publish with your logged-in account — 3 or 4 phone approvals). Interactive prompt if omitted.
5555
- `--domain <name>` — DotNS label (with or without the `.dot` suffix). Interactive prompt if omitted.
5656
- `--buildDir <path>` — directory holding the built artifacts (default `dist/`). Interactive prompt if omitted.
57+
- `--no-build` — skip the frontend build step and deploy whatever is already in `--buildDir`.
58+
- `--contracts` — also compile and deploy the foundry / hardhat / cdm contract project at the project root (interactive prompt if a contract project is detected and the flag is omitted; skipped automatically when no project is detected).
59+
- `--no-contract-build` — skip the contract compile step (`forge build --resolc`, `cargo-contract build`, `npx hardhat compile`) and deploy pre-built artifacts. Requires `--contracts` and headless mode (i.e. all of `--signer`, `--domain`, `--buildDir`, `--playground`).
5760
- `--playground` — publish to the playground registry so the app appears under "my apps". Interactive prompt (default: no) if omitted.
61+
- `--private` — publish to the playground with private (owner-only) visibility. Requires `--playground`. Not interactively prompted; pass the flag to opt in.
5862
- `--modable` / `--no-modable` — publish the source repo URL alongside the deploy so others can `dot mod` it. Requires `--playground`. Interactive prompt (default: no) if omitted. When set, `dot deploy` uses the existing `origin` URL without pushing. If there is no `origin`, it ensures `git` and `gh` are installed (auto-installs if missing), confirms `gh` is authenticated (run `gh auth login` first if not — the deploy will fail with a hint otherwise), then runs `gh repo create --public --push` to set one up. The resulting URL is recorded in the Bulletin metadata.
5963
- `--repo-name <name>` — repo name to use when `--modable` needs to create a new GitHub repo (no existing `origin`). Defaults to the basename of the project directory; validated against GitHub's repository-name rules.
6064
- `--suri <suri>` — override signer with a dev secret URI (e.g. `//Alice`). Useful for CI.
6165
- `--env <env>``testnet` (default) or `mainnet` (not yet supported).
6266

63-
Passing all four of `--signer`, `--domain`, `--buildDir`, and `--playground` runs in fully non-interactive mode. Any absent flag is filled in by the TUI prompt. `--modable` is independently optional in both modes — its absence means a non-modable deploy.
67+
Passing all four of `--signer`, `--domain`, `--buildDir`, and `--playground` runs in fully non-interactive mode. Any absent flag is filled in by the TUI prompt. `--modable`, `--private`, and `--contracts` are independently optional in both modes — their absence means a non-modable, public, frontend-only deploy.
6468

6569
**Requirement**: the `ipfs` CLI (Kubo) must be on `PATH`. `dot init` installs it; if you skipped init you can install it manually (`brew install ipfs` or follow [docs.ipfs.tech/install](https://docs.ipfs.tech/install/)). This is a temporary requirement while `bulletin-deploy`'s pure-JS merkleizer has a bug that makes the browser fallback unusable.
6670

6771
The publish step is always signed by the user so the registry contract records their address as the app owner — this is what drives the Playground "my apps" view.
6872

69-
#### CI / automation flags for `dot deploy`
73+
#### CI / automation usage
7074

71-
These flags are designed for non-interactive (CI) usage. Combining all four of `--signer`, `--domain`, `--buildDir`, and `--playground` triggers fully headless mode; the flags below layer on top.
75+
For fully non-interactive (CI) runs, combine `--signer`, `--domain`, `--buildDir`, and `--playground` to skip every TUI prompt. Layer the optional flags on top:
7276

73-
| Flag | Effect |
74-
|---|---|
75-
| `--signer dev` | Use the dev signer (no phone QR scan). Requires `--suri`. |
76-
| `--suri <suri>` | Secret URI for the user signer (e.g. `//Alice` or a full mnemonic). Required with `--signer dev`. |
77-
| `--domain <name>` | DotNS domain. Skips interactive selection. |
78-
| `--buildDir <path>` | Path to existing built frontend assets. |
79-
| `--no-build` | Skip the **frontend** build (`pnpm build`). Use pre-built `dist/`. |
80-
| `--no-contract-build` | Skip the **contract** compile (`forge build --resolc`, `cargo-contract build`, `npx hardhat compile`). Use pre-built `out/` / `target/<crate>.release.polkavm` / `artifacts/contracts/`. Requires `--contracts`. |
81-
| `--no-modable` | Don't push source to GitHub even if `--modable` would normally apply. |
82-
| `--playground` | Publish to the playground registry. Required with all the above to trigger the fully-headless code path. |
77+
- `--suri //Alice` — required with `--signer dev` so the dev signer has a known keypair (works with any dev name or full BIP-39 mnemonic).
78+
- `--no-build` — reuse pre-built frontend assets in `--buildDir`.
79+
- `--contracts` + `--no-contract-build` — reuse pre-built contract artefacts in `out/` / `target/<crate>.release.polkavm` / `artifacts/contracts/` (skips `forge build --resolc`, `cargo-contract build`, or `npx hardhat compile`).
80+
- `--no-modable` — explicitly skip source publishing even if `--modable` would otherwise apply.
81+
- `--private` — publish to the playground with owner-only visibility.
8382

8483
### `dot mod`
8584

@@ -94,6 +93,10 @@ Flags:
9493

9594
The local directory name is auto-generated as `<slug>-<6 hex chars>` so repeated mods of the same starter never collide (unlike GitHub forks, which were limited to one per account per repo).
9695

96+
### `dot logout`
97+
98+
Sign out of the account paired via `dot init`. Sends a `Disconnected` statement so the paired Polkadot mobile app drops its side of the connection, then clears the local session files under `~/.polkadot-apps/`. If the remote notification fails (statement store unreachable, …), the local files are still cleared and the command surfaces a `partial` status — the mobile app will show a stale pairing until it reconnects. No-op when no session is signed in.
99+
97100
## Troubleshooting
98101

99102
### Telemetry

src/utils/deploy/storage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
/**
22
* Wrapper around `bulletin-deploy`'s `deploy()` that:
3-
* - forces `jsMerkle: true` so we never shell out to Kubo (WebContainer-safe),
43
* - intercepts bulletin-deploy's `console.log` stream and turns it into
54
* typed progress events for the TUI,
65
* - surfaces bulletin-deploy's returned artifact IDs unchanged.
76
*
7+
* Note: we deliberately do NOT pass `jsMerkle: true` — bulletin-deploy's
8+
* pure-JS merkleizer drops DAG-PB structural blocks under the `rawLeaves`
9+
* + `wrapWithDirectory` path we use, leaving deployed sites unparseable.
10+
* We rely on the Kubo binary path (installed by `dot init`) until upstream
11+
* fixes `merkleizeJS`. See the call site below and CLAUDE.md for context.
12+
*
813
* All retry, nonce recovery, pool authorization, and DAG-PB verification
914
* stays inside bulletin-deploy — we do not reimplement any of it here.
1015
*/

0 commit comments

Comments
 (0)