143 lines
4.3 KiB
TypeScript
143 lines
4.3 KiB
TypeScript
import { i18n } from './i18n'
|
|
import { sdk } from './sdk'
|
|
import {
|
|
CERTRELAY_PORT,
|
|
EXPLORER_PORT,
|
|
SUBSPACES_PROVER_PORT,
|
|
SUBSPACES_REGISTRY_PORT,
|
|
SUBSPACES_UI_PORT,
|
|
uiPort,
|
|
} from './utils'
|
|
|
|
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
|
|
const uiMulti = sdk.MultiHost.of(effects, 'ui-multi')
|
|
const uiMultiOrigin = await uiMulti.bindPort(uiPort, {
|
|
protocol: 'http',
|
|
})
|
|
const ui = sdk.createInterface(effects, {
|
|
name: i18n('Space-CLI Web UI'),
|
|
id: 'ui',
|
|
description: i18n(
|
|
'Browser terminal that exposes space-cli inside the Spaces container.',
|
|
),
|
|
type: 'ui',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const uiReceipt = await uiMultiOrigin.export([ui])
|
|
|
|
const explorerMulti = sdk.MultiHost.of(effects, 'explorer-multi')
|
|
const explorerMultiOrigin = await explorerMulti.bindPort(EXPLORER_PORT, {
|
|
protocol: 'http',
|
|
})
|
|
const explorer = sdk.createInterface(effects, {
|
|
name: i18n('Explorer Web UI'),
|
|
id: 'explorer',
|
|
description: i18n(
|
|
'SvelteKit explorer for the Spaces protocol. Reads from the embedded PostgreSQL populated by the indexer. Only useful while the embedded explorer is enabled.',
|
|
),
|
|
type: 'ui',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const explorerReceipt = await explorerMultiOrigin.export([explorer])
|
|
|
|
const subspacesMulti = sdk.MultiHost.of(effects, 'subspaces-multi')
|
|
const subspacesMultiOrigin = await subspacesMulti.bindPort(SUBSPACES_UI_PORT, {
|
|
protocol: 'http',
|
|
})
|
|
const subspaces = sdk.createInterface(effects, {
|
|
name: i18n('Subspaces Web UI'),
|
|
id: 'subspaces',
|
|
description: i18n(
|
|
'Off-chain Bitcoin handles via the Spaces protocol (spacesops/subs). Talks to the local spaced over loopback RPC. Only useful while Subspaces is enabled.',
|
|
),
|
|
type: 'ui',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const subspacesReceipt = await subspacesMultiOrigin.export([subspaces])
|
|
|
|
const proverMulti = sdk.MultiHost.of(effects, 'subspaces-prover-multi')
|
|
const proverMultiOrigin = await proverMulti.bindPort(SUBSPACES_PROVER_PORT, {
|
|
protocol: 'http',
|
|
})
|
|
const prover = sdk.createInterface(effects, {
|
|
name: i18n('Subspaces Prover'),
|
|
id: 'subspaces-prover',
|
|
description: i18n(
|
|
'RISC Zero prover server for Subspaces (no GPU). Generates the cryptographic proofs the Subspaces UI requests. Only useful while Subspaces is enabled.',
|
|
),
|
|
type: 'api',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const proverReceipt = await proverMultiOrigin.export([prover])
|
|
|
|
const registryMulti = sdk.MultiHost.of(effects, 'subspaces-registry-multi')
|
|
const registryMultiOrigin = await registryMulti.bindPort(
|
|
SUBSPACES_REGISTRY_PORT,
|
|
{ protocol: 'http' },
|
|
)
|
|
const registry = sdk.createInterface(effects, {
|
|
name: i18n('Subspaces Registry'),
|
|
id: 'subspaces-registry',
|
|
description: i18n(
|
|
'Registry server for publishing and resolving Subspaces handles. Only useful while Subspaces is enabled.',
|
|
),
|
|
type: 'api',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const registryReceipt = await registryMultiOrigin.export([registry])
|
|
|
|
const certrelayMulti = sdk.MultiHost.of(effects, 'certrelay-multi')
|
|
const certrelayMultiOrigin = await certrelayMulti.bindPort(CERTRELAY_PORT, {
|
|
protocol: 'http',
|
|
})
|
|
const certrelay = sdk.createInterface(effects, {
|
|
name: i18n('Certrelay'),
|
|
id: 'certrelay',
|
|
description: i18n(
|
|
'Certrelay serves cryptographic proofs binding Bitcoin-anchored handles to owner keys. SETUP NOTE: run the "Configure Certrelay" action and set CERTRELAY_SELF_URL to the publicly visible URL StartOS exposes for this interface (your clearnet domain or .onion address) — peers and clients reach this relay at that URL.',
|
|
),
|
|
type: 'api',
|
|
masked: false,
|
|
schemeOverride: null,
|
|
username: null,
|
|
path: '',
|
|
query: {},
|
|
})
|
|
|
|
const certrelayReceipt = await certrelayMultiOrigin.export([certrelay])
|
|
|
|
return [
|
|
uiReceipt,
|
|
explorerReceipt,
|
|
subspacesReceipt,
|
|
proverReceipt,
|
|
registryReceipt,
|
|
certrelayReceipt,
|
|
]
|
|
})
|