Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Local Development Guide

Prerequisites

  • Node.js 20+
  • Yarn
  • impl-node cloned alongside impl-saas (same parent directory)
  • utils/ethereum cloned alongside (for testnet)
dev/
  impl-node/        ENC protocol node
  impl-saas/        this repo
  utils/ethereum/   Ethereum testnet

Setup

cd impl-saas
cd provisioner && yarn install && cd ..
cd frontend && yarn install && cd ..

Start Everything

yarn dev

Starts 4 servers:

ServicePortDescription
Ethereum devnet8545EVM testnet + USDT deployed
ENC Node8787Protocol node
Provisioner8788SaaS API
Frontend5173React 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 browser

All tests start their own servers — you don't need yarn dev running.

Login Flow

  1. Open http://localhost:5173
  2. Click Connect Wallet
  3. Click + Dev account (creates a local keypair)
  4. 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