Local Development Guide
Prerequisites
- Node.js 20+
- Yarn
impl-nodecloned alongsideimpl-saas(same parent directory)utils/ethereumcloned alongside (for testnet)
dev/
impl-node/ ENC protocol node
impl-saas/ this repo
utils/ethereum/ Ethereum testnetSetup
cd impl-saas
cd provisioner && yarn install && cd ..
cd frontend && yarn install && cd ..Start Everything
yarn devStarts 4 servers:
| Service | Port | Description |
|---|---|---|
| Ethereum devnet | 8545 | EVM testnet + USDT deployed |
| ENC Node | 8787 | Protocol node |
| Provisioner | 8788 | SaaS API |
| Frontend | 5173 | React dashboard |
The script auto-initializes D1, seeds the shared node, and deploys USDT.
Open http://localhost:5173 in your browser.
Test
# SDK + API tests (node:test)
yarn test # 61 cloud SDK tests
yarn test:api # 27 API integration tests
# Playwright E2E (browser)
yarn test:e2e # headless
yarn test:e2e:headed # see the browserAll tests start their own servers — you don't need yarn dev running.
Login Flow
- Open http://localhost:5173
- Click Connect Wallet
- Click + Dev account (creates a local keypair)
- Dashboard appears — deploy enclaves from there
Project Structure
provisioner/
src/index.js Cloudflare Worker (routes, RBAC manifest builder)
src/manifests.js 6 enclave templates + buildNodeManifest
src/schema.sql D1 schema (tenants, enclaves, nodes, payments, faucet)
manifests/ Canonical enclave manifests (Hello, DM, Group, etc.)
test/ All test suites
api.test.js Node.js integration tests
cloud-sdk.test.js Cloud SDK tests
deploy.test.js Playwright E2E (deploy + explorer)
demo.test.js Playwright E2E (mass events + pagination + billing)
pw-setup.js Shared Playwright server setup
seed-events.mjs Seed N events to an enclave
helpers.js Shared test helpers
frontend/
src/App.tsx App shell
src/auth.tsx Login (passkey, dev wallet, extension)
src/Dashboard.tsx Enclave management (uses CloudClient)
src/Billing.tsx Billing + payment (uses CloudClient)
src/Faucet.tsx Testnet faucet (uses CloudClient)
src/EnclaveExplorer.tsx Event browser + WebSocket live updates
sdk/
index.js @enc-protocol/cloud — CloudClient class
scripts/
keygen.js Generate admin credentials
start.js yarn dev entry point