From 931becd274337ba5fdc3fa6db94565e91728c70b Mon Sep 17 00:00:00 2001 From: spacesops Date: Tue, 26 May 2026 02:27:14 -0400 Subject: [PATCH] v0.0.9.3 --- README.md | 19 ++++++++-------- startos/i18n/dictionaries/default.ts | 3 +++ startos/interfaces.ts | 22 +++++++++++++++++++ startos/main.ts | 5 ++++- startos/versions/index.ts | 4 ++-- startos/versions/{v0.0.9.2.ts => v0.0.9.3.ts} | 7 +++--- 6 files changed, 45 insertions(+), 15 deletions(-) rename startos/versions/{v0.0.9.2.ts => v0.0.9.3.ts} (90%) diff --git a/README.md b/README.md index 8bc30bc..f2f31ff 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ preserved. | Subspaces Prover | 8888 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `subs-prover` RISC Zero prover server (no GPU). Its own StartOS interface. Only useful while Subspaces is enabled. | | Subspaces Registry | 8081 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `registry-server` for publishing/resolving handles (remapped from its upstream default 8080 to avoid colliding with the gotty terminal on 8080). Its own StartOS interface. Only useful while Subspaces is enabled. | | Certrelay | 7778 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `certrelay` server (always on). Serves cryptographic proofs binding handles to owner keys. **Setup:** run **Configure Certrelay** and set `CERTRELAY_SELF_URL` to the publicly visible URL StartOS exposes for this interface. | -| Spaced RPC | 7225 | HTTP JSON-RPC | **Loopback only** | Internal use, static-cred-authenticated via `SPACED_RPC_USER` / `SPACED_RPC_PASSWORD` from `store.json.spacedAuth` | +| Spaces API (spaced RPC) | 7225 | HTTP JSON-RPC | LAN / `.local` / Tor / clearnet (via StartOS) | spaced JSON-RPC, now bound to `0.0.0.0` and exposed as the **Spaces API** interface. Static-cred-authenticated via `SPACED_RPC_USER` / `SPACED_RPC_PASSWORD` from `store.json.spacedAuth`. Internal clients still connect over loopback. | | PostgreSQL | 5432 | Postgres wire protocol | **Loopback only** (`listen_addresses=127.0.0.1`) | Username/password from `store.json.dbAuth`; full `DB_URL` exported into the web terminal | ## Actions @@ -194,7 +194,7 @@ the same idempotent init logic runs and reuses the existing credentials in | ID | Display | Grace period | Behaviour | | --- | --- | --- | --- | | `postgres` (daemon `ready`) | Database | 60 s | TCP listen on `127.0.0.1:5432` | -| `spaced` (daemon `ready`) | Spaced RPC | 120 s | TCP listen on `127.0.0.1:7225` | +| `spaced` (daemon `ready`) | Spaced RPC | 120 s | TCP listen on `0.0.0.0:7225` (exposed as the Spaces API interface) | | `subs-prover` (daemon `ready`) | Subspaces Prover | 60 s | TCP listen on `0.0.0.0:8888`. Only present when Subspaces **and** the `set-subs-prover` toggle are enabled (toggle defaults off). Polled every 30 s; nothing depends on it. | | `subs-registry` (daemon `ready`) | Subspaces Registry | 60 s | TCP listen on `0.0.0.0:8081`. Only present when Subspaces is enabled. | | `subs` (daemon `ready`) | Subspaces Web UI | 60 s | TCP listen on `0.0.0.0:7777`. Only present when Subspaces is enabled. | @@ -211,12 +211,13 @@ the same idempotent init logic runs and reuses the existing credentials in 3. **Space-CLI Web UI is a terminal, not a graphical app.** All Spaces operations happen via `space-cli` (aliased as `spaces` inside the shell). 4. **Externally exposed ports** (each a StartOS interface): 8080 (gotty - Space-CLI Web UI, always on), 7778 (Certrelay, always on), and — only while - their feature is enabled — 3000 (Explorer Web UI, currently stubbed), 7777 - (Subspaces Web UI), 8888 (Subspaces Prover), 8081 (Subspaces Registry). - **Loopback-only:** spaced RPC (7225) and PostgreSQL (5432). The Subspaces - registry is remapped from its upstream default 8080 to 8081 to avoid - colliding with the gotty terminal. + Space-CLI Web UI, always on), 7225 (Spaces API / spaced RPC, always on), + 7778 (Certrelay, always on), and — only while their feature is enabled — + 3000 (Explorer Web UI, currently stubbed), 7777 (Subspaces Web UI), 8888 + (Subspaces Prover), 8081 (Subspaces Registry). **Loopback-only:** PostgreSQL + (5432). The spaced RPC is authenticated (static creds) even though it's now + externally exposed. The Subspaces registry is remapped from its upstream + default 8080 to 8081 to avoid colliding with the gotty terminal. 5. **Bitcoin Core 31.x is the only supported dependency.** Earlier majors are not allowed by the manifest version range. 6. **The web terminal is independent of spaced.** Gotty stays reachable even @@ -308,7 +309,7 @@ ports: subspaces_prover: 8888 # external (its own interface), subspaces only subspaces_registry: 8081 # external (its own interface), subspaces only; remapped from upstream 8080 certrelay: 7778 # external (its own interface), always on - spaced_rpc: 7225 # loopback only + spaced_rpc: 7225 # external (Spaces API interface); spaced binds 0.0.0.0, auth-gated postgres: 5432 # loopback only dependencies: - bitcoind diff --git a/startos/i18n/dictionaries/default.ts b/startos/i18n/dictionaries/default.ts index 3f8c4f6..a2b7810 100644 --- a/startos/i18n/dictionaries/default.ts +++ b/startos/i18n/dictionaries/default.ts @@ -141,6 +141,9 @@ const dict = { 'Subs API': 141, 'REST API of the subs daemon (subsd) for Subspaces operations. Distinct from the Subspaces Prover and Subspaces Registry. Only useful while Subspaces is enabled.': 142, + 'Spaces API': 143, + 'JSON-RPC API served by the spaced daemon. Authenticated with the spaced RPC credentials (SPACED_RPC_USER / SPACED_RPC_PASSWORD from store.spacedAuth). spaced binds 0.0.0.0 so external processes can reach this endpoint.': + 144, // interfaces.ts 'Space-CLI Web UI': 12, diff --git a/startos/interfaces.ts b/startos/interfaces.ts index 73cf0e1..24d1ed8 100644 --- a/startos/interfaces.ts +++ b/startos/interfaces.ts @@ -3,6 +3,7 @@ import { sdk } from './sdk' import { CERTRELAY_PORT, EXPLORER_PORT, + spacedRpcPort, SUBSPACES_PROVER_PORT, SUBSPACES_REGISTRY_PORT, SUBSPACES_UI_PORT, @@ -151,6 +152,26 @@ export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => { const certrelayReceipt = await certrelayMultiOrigin.export([certrelay]) + const spacedMulti = sdk.MultiHost.of(effects, 'spaced-api-multi') + const spacedMultiOrigin = await spacedMulti.bindPort(spacedRpcPort, { + protocol: 'http', + }) + const spacedApi = sdk.createInterface(effects, { + name: i18n('Spaces API'), + id: 'spaces-api', + description: i18n( + 'JSON-RPC API served by the spaced daemon. Authenticated with the spaced RPC credentials (SPACED_RPC_USER / SPACED_RPC_PASSWORD from store.spacedAuth). spaced binds 0.0.0.0 so external processes can reach this endpoint.', + ), + type: 'api', + masked: false, + schemeOverride: null, + username: null, + path: '', + query: {}, + }) + + const spacedApiReceipt = await spacedMultiOrigin.export([spacedApi]) + return [ uiReceipt, explorerReceipt, @@ -158,5 +179,6 @@ export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => { proverReceipt, registryReceipt, certrelayReceipt, + spacedApiReceipt, ] }) diff --git a/startos/main.ts b/startos/main.ts index 54dac2c..f7e4a5a 100644 --- a/startos/main.ts +++ b/startos/main.ts @@ -62,7 +62,10 @@ export const main = sdk.setupMain(async ({ effects }) => { const spacedEnv = { SPACED_CHAIN, SPACED_DATA_DIR: dataDir, - SPACED_RPC_BIND: '127.0.0.1', + // Listen on all interfaces so the spaced RPC can be exposed externally via + // the "Spaces API" StartOS interface. Internal clients (subs, certrelay, + // indexer, space-cli, health checks) still connect over loopback below. + SPACED_RPC_BIND: '0.0.0.0', SPACED_RPC_PORT: String(spacedRpcPort), SPACED_RPC_URL: `http://127.0.0.1:${spacedRpcPort}`, SPACED_BLOCK_INDEX: 'true', diff --git a/startos/versions/index.ts b/startos/versions/index.ts index 07515d9..bb3887d 100644 --- a/startos/versions/index.ts +++ b/startos/versions/index.ts @@ -1,7 +1,7 @@ import { VersionGraph } from '@start9labs/start-sdk' -import { v_0_0_9_2 } from './v0.0.9.2' +import { v_0_0_9_3 } from './v0.0.9.3' export const versionGraph = VersionGraph.of({ - current: v_0_0_9_2, + current: v_0_0_9_3, other: [], }) diff --git a/startos/versions/v0.0.9.2.ts b/startos/versions/v0.0.9.3.ts similarity index 90% rename from startos/versions/v0.0.9.2.ts rename to startos/versions/v0.0.9.3.ts index 763ab7c..e1c682d 100644 --- a/startos/versions/v0.0.9.2.ts +++ b/startos/versions/v0.0.9.3.ts @@ -1,9 +1,10 @@ import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk' -export const v_0_0_9_2 = VersionInfo.of({ - version: '0.0.9:2', +export const v_0_0_9_3 = VersionInfo.of({ + version: '0.0.9:3', releaseNotes: { - en_US: `- Added a dedicated "Subs API" interface (type api) on the subs daemon's port (7777), distinct from the Subspaces Prover (8888) and Subspaces Registry (8081) interfaces. The subs daemon is "subsd — an HTTP REST API server"; this surfaces that REST API as its own dashboard entry. + en_US: `- Exposed the spaced JSON-RPC API as a new "Spaces API" StartOS interface (port 7225) and changed SPACED_RPC_BIND from 127.0.0.1 to 0.0.0.0 so external processes can reach it. It remains authenticated with the spaced RPC credentials (store.spacedAuth); internal clients still connect over loopback. +- Added a dedicated "Subs API" interface (type api) on the subs daemon's port (7777), distinct from the Subspaces Prover (8888) and Subspaces Registry (8081) interfaces. The subs daemon is "subsd — an HTTP REST API server"; this surfaces that REST API as its own dashboard entry. - New "Enable / Disable Subspaces Prover" action independently gates just the subs-prover daemon (store.enableSubsProver), **disabled by default**. When off, subs-prover does not start (it runs lengthy boot-time timing tests), but its interface on 8888 stays registered. It is added last and nothing depends on it, so its slow startup never blocks subs, the registry, or certrelay. - Embedded Certrelay (prebuilt \`horologger/certrelay:v0.2.3\` image, static musl binaries). Always on — runs the \`certrelay\` server on port 7778 from service start, as its own StartOS interface. It serves cryptographic proofs binding Bitcoin-anchored handles to owner keys, talking to the local spaced over loopback using the store.spacedAuth credentials. The bundled \`fabric\` CLI is copied to /data/bin/fabric so it's runnable from the Space-CLI Web UI. New "Configure Certrelay" action sets CERTRELAY_SELF_URL, CERTRELAY_BOOTSTRAP, and CERTRELAY_HEALTHCHECK_HANDLE (stored in store.json; saving restarts the service). Set CERTRELAY_SELF_URL to the publicly visible URL StartOS exposes for the Certrelay interface. - Removed the build-from-source chains for the Go indexer and the SvelteKit explorer, and dropped their builder images (\`golang:1.23-alpine\`, \`node:20-alpine\`). This shrinks the .s9pk and removes the multi-minute first-enable compile. The indexer + explorer-UI daemons are now stubbed with TODOs in startos/main.ts pending prebuilt images (indexer image not yet produced; explorer image to be provided). Enabling the embedded explorer currently starts PostgreSQL only. All explorer-indexer actions (show-db-credentials, reset-db-state, reset-indexer-state, reset-explorer-state) are retained.