Skip to content

Commit 4145011

Browse files
committed
docs(emergency-withdraw): update README for deployment, i18n, build setup
- New "Deployment" section — documents the GitHub Pages workflow (.github/workflows/deploy-emergency-withdraw.yml), the public/CNAME custom domain, and the one-time repo + DNS setup. - New "Languages" section — English / 繁體中文 / 日本語, globe switcher, localStorage persistence, all bundled so it works offline. - Development: fix the stale `cd v1/reference/emergency-withdraw` path to `cd emergency-withdraw`; prefer `npm ci` now that package-lock.json is committed. - Usage Option A: emergency.optivaults.app is live — drop the "once published" qualifier. - Trust model: refresh the SPA line-count note and mention i18n.
1 parent dd199e6 commit 4145011

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

README-zh-TW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OptiVaults V1 **刻意被設計成兩個可分離的層**:
4141
| `keeper/` | 🚧 Placeholder | V1 keeper 參考實作,在 keeper 驗證里程碑之後遷入。TypeScript、vitest 測試。 |
4242
| `frontend/` | ✅ 已發布 | React 19 + Vite 8 + TailwindCSS v4 SPA。CIP-30 錢包整合、**瀏覽器內 TX 建構(Lucid Evolution)**(無獨立 API server——原本的 `api/` 元件已併入 frontend client-side)、Blockfrost 直接 REST、vitest 測試。7 個頁面、EN / zh-TW / ja 三語 i18n。Operator-specific URL + Cloudflare Pages 部署腳本已在 `frontend/README.md` 為 forker 標註。 |
4343
| `withdraw-cli/` | ✅ 已發布 | Node CLI,用於 self-serve Withdraw(不依賴任何基礎設施)。 |
44-
| `emergency-withdraw/` | ✅ 已發布 | 靜態 HTML 的 self-serve 緊急提領工具——瀏覽器內運作、無 backend 依賴。 |
44+
| `emergency-withdraw/` | ✅ 已發布 | 靜態 HTML 的 self-serve 緊急提領工具——瀏覽器內運作、無 backend 依賴。English / zh-TW / ja 三語 i18n。 |
4545

4646
剩餘元件會在驗證為 V1-ready 後分批遷入。
4747

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ See the [OptiVaults whitepaper](https://github.com/OptiVaults/optivaults-protoco
4141
| `keeper/` | 🚧 Placeholder | V1 keeper reference implementation coming post keeper-verification milestone. TypeScript, vitest-tested. |
4242
| `frontend/` | ✅ Published | React 19 + Vite 8 + TailwindCSS v4 SPA. CIP-30 wallet integration, **in-browser TX building via Lucid Evolution** (no separate API server — the previous `api/` component has been folded into the frontend client-side), Blockfrost direct REST, vitest tests. 7 pages with EN / zh-TW / ja i18n. Operator-specific URLs + Cloudflare Pages deploy script flagged in `frontend/README.md` for forkers. |
4343
| `withdraw-cli/` | ✅ Published | Node CLI for self-serve Withdraw (no infrastructure dependency). |
44-
| `emergency-withdraw/` | ✅ Published | Static HTML self-serve emergency-withdraw tool — in-browser, no backend dependency. |
44+
| `emergency-withdraw/` | ✅ Published | Static HTML self-serve emergency-withdraw tool — in-browser, no backend dependency. English / zh-TW / ja i18n. |
4545

4646
Remaining components will be added in batches as each is verified V1-ready against the on-chain contracts.
4747

emergency-withdraw/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ V1 ships a different on-chain contract surface from V9.x / V10:
2020
|---|---|
2121
| Smart contract | OptiVaults V1 contract code on Cardano (open source, multiple rounds of internal audit, external Q2-Q3 2027 audit pending — Withdraw-Zero pattern + R55 compile-time Vault NFT anchor + V1 Layer 3 governance safety) |
2222
| Vault identity | One-shot Vault NFT minted at deploy ceremony — the validator script hashes physically encode the real NFT policy, and the page verifies the target vault UTXO holds that NFT before building the TX |
23-
| Withdrawal logic | This static React/Vite SPA (open source, ~700 lines logic + 700 lines UI) |
23+
| Withdrawal logic | This static React/Vite SPA open source, ~700 lines of withdrawal logic in `lib/` plus the React UI (English / 繁體中文 / 日本語 i18n) |
2424
| Chain query | Blockfrost (your own API key) |
2525
| Deploy state | A `v1-deploy-state.json` ceremony file (operator-published, but you can swap it via `?config=<url>` query param) |
2626
| TX signing | Your CIP-30 wallet extension |
@@ -32,11 +32,15 @@ The page detects the network from the loaded ceremony JSON's `network` field, th
3232

3333
V1 currently runs on **Preprod only** (release `v1-preprod-p23`). Mainnet deploy lands when V1 ceremony is performed.
3434

35+
## Languages
36+
37+
The UI ships in English, 繁體中文, and 日本語 — switch via the globe selector in the header. The choice is saved to `localStorage`, and on first visit it follows the browser language. All translations are bundled into the page (no network fetch), so they work in an offline-saved copy too.
38+
3539
## Usage
3640

3741
### Option A — online (operator-hosted)
3842

39-
Visit the operator's URL (e.g. `https://emergency.optivaults.app` once published).
43+
Visit the operator's URL: <https://emergency.optivaults.app>.
4044

4145
### Option B — offline (recommended for worst-case)
4246

@@ -80,15 +84,25 @@ Useful if you've forked the contract for your own instance and want to share an
8084
## Development
8185

8286
```bash
83-
cd v1/reference/emergency-withdraw
84-
npm install
87+
cd emergency-withdraw
88+
npm ci # reproducible install from package-lock.json (npm install also works)
8589
npm run dev # vite dev server on :5173
8690
npm run build # outputs dist/ (Buffer polyfill auto-injected post-build)
8791
npm run preview # serve dist/ locally
8892
```
8993

9094
The build outputs a multi-file dist (HTML + JS chunks + WASM). For true single-file offline mode, run the build then drag `dist/index.html` into a browser; modern browsers inline assets automatically when saving "Webpage HTML Only".
9195

96+
## Deployment
97+
98+
The page is a static SPA, so any static host works. The OptiVaults-operated instance is published to GitHub Pages straight from this repo:
99+
100+
- [`.github/workflows/deploy-emergency-withdraw.yml`](../.github/workflows/deploy-emergency-withdraw.yml) builds the SPA on every push to `v1` that touches `emergency-withdraw/`, then publishes `dist/` via `actions/deploy-pages`.
101+
- `public/CNAME` carries the custom domain `emergency.optivaults.app`. The site is served from the domain root, so Vite's default `base` (`/`) is left unchanged.
102+
- One-time repo setup: **Settings → Pages → Source → "GitHub Actions"**, plus a DNS `CNAME` record `emergency``optivaults.github.io`.
103+
104+
Forking your own instance: repoint `public/CNAME` at your domain, or delete it and serve from the `*.github.io` project URL (set Vite `base` to match the sub-path), or drop the built `dist/` on any other static host.
105+
92106
## License
93107

94108
Apache License 2.0 (permissive open-source, OSI-approved).

0 commit comments

Comments
 (0)