SELF-HOSTING

A deliberate runtime.

A reproducible Worker, configured for the features you enable.

One reproducible artifact

From source.
To a deliberate runtime.

The Worker has no financial signer. Required contract deployments are configured separately.

npm ci

Use the locked dependency set and a supported Node.js runtime.

This explorer shows commands and paths only. It does not install, deploy, generate keys or modify this computer.

Documentation · Self-hosting

Run the Sepolia workspace

Use Node.js 22.12 or newer to install the locked dependencies, validate the release and start the dedicated workspace.

Local Sepolia workspace
npm ci
npm run check:release
npm run dev:sepolia

Open localhost:4318 . Its health response reports sepolia-workspace.

Serve the built release

Use scripts/serve-https-origin.mjs behind HTTPS with NELOSIA_NETWORK=sepolia and NELOSIA_ORIGIN set to your bare app origin. Provide PREVIEW_SIGNING_KEY as a server-only environment variable. The origin hosts the public Sepolia API and the workspace.

Mainnet source configuration

1. Obtain and install the source

The Nelosia source bundle is supplied separately with the project deliverables. Extract that bundle and open its project directory before running these commands.

Use Node.js 22.12 or newer and npm. Run these commands in the Nelosia project directory. Installation needs no wallet secrets. Provider access requirements and verified deployment settings depend on the features you enable.

Install dependencies
node --version
npm ci

2. Configure a server-only review key

Generate at least 32 random bytes, encoded as a canonical base64 string. This command creates a new .env without overwriting an existing file and prints no key.

Create a new server-only .env
node --input-type=module -e "import {randomBytes} from 'node:crypto'; import {writeFileSync} from 'node:fs'; writeFileSync('.env', 'PREVIEW_SIGNING_KEY='+randomBytes(48).toString('base64')+String.fromCharCode(10), {flag:'wx'});"

Keep .env out of Git, deployment archives and the client bundle. Never call this variable VITE_PREVIEW_SIGNING_KEY. If a file already exists, preserve the current key; rotating it invalidates existing authenticated reviews and their receipt tokens.

Runtime configuration
VariableRequirementPurpose
PREVIEW_SIGNING_KEYrequired for reviewsServer runtime secret. Base64 encoding of 32–128 random bytes.
PORTlocal optionalLocal Worker preview port; default 4317.
APP_ORIGINproduction app splitThe owned HTTPS app-subdomain origin. Local /app remains available without it.
APP_MODEapp deploymentSet app for a separate app-only Worker whose root loads the noindex workspace.
SITE_ORIGINproduction websiteOwned HTTPS marketing origin for app backlinks and public metadata.
BALANCE_GUARD_ADDRESSprotected position actionsVerified deployed Nelosia balance-guard contract address; never invent a placeholder deployment.
BALANCE_GUARD_CLASS_HASHprotected position actionsExpected verified guard class; checked against the configured deployment.
LENDING_GUARD_ADDRESSall lending actionsReal reviewed deployed lending-state guard; never use a placeholder address.
LENDING_GUARD_CLASS_HASHall lending actionsExpected class hash for the reviewed lending guard, checked on chain at its deployment address.
NEAR_INTENTS_API_KEYbridge provider optionalServer-only provider credential when required; public access can be rate-limited.
BRIDGE_ENABLEDbridge optionalSet false to disable bridge routing on a deployment.

3. Validate and build

The build renders 18 public routes and bundles local fonts, static assets and the Starknet SDK into one webworker-target fetch module. Run the source checks before building the deployable artifact.

Run checks and build
npm test
npm run build

4. Start the local Worker

Run the local product
npm run dev

Open http://127.0.0.1:4317 . The app is /app and health is /api/health. Rebuild after source edits; the preview reloads the generated Worker artifact.

Read-only health check
curl http://127.0.0.1:4317/api/health
Expected health response
{
  "ok": true,
  "product": "Nelosia",
  "version": "3.0.0",
  "mode": "defi-terminal"
}

5. Deploy the same Worker

The entry point is dist/server/index.js, exporting a fetch handler. Bind PREVIEW_SIGNING_KEY only in the hosting runtime. Preserve the registered .openai/hosting.json identity and the owner's intended audience. Source archives must exclude .env and dependency caches.

The public Sepolia app uses a separate HTTPS origin. This Mainnet source configuration requires its own app origin and configuration. Export local journals before changing origins; they do not automatically share storage.

Verified contract configuration

Protected wallet outcomes need the balance guard. All lending actions additionally require the lending-state guard, with verified pool/oracle class pinning and current post-state health/debt/collateral checks. Both guards passed a native Linux build and local integration tests. Verified mainnet deployments remain outstanding. Configure reviewed addresses and class hashes after deployment. Missing or mismatched settings block signing preparation.

Provider and recovery limits

The product uses fixed PublicNode, Vesu, AVNU, Endur, prod-api.ekubo.org and NEAR Intents origins. Ethereum, Base, Arbitrum, OP Mainnet, Polygon and Avalanche use six fixed PublicNode RPC origins for source checks and destination proofs. Endur’s public request indexer is an address-discovery hint for current queue-NFT holders; ownership and eligibility are checked on chain. Arbitrary RPC endpoints and redirects are unavailable. Network changes, source amounts, quote expiry and fee capacity are rechecked before signing readiness.

Starknet activity and EVM bridge journals are browser-local, not cross-device backup. Export before changing origins. Storage or concurrency errors pause new signing requests; returned hashes remain available in a readable in-memory snapshot when persistence fails. Observe pending or unknown attempts before another signature. Imported EVM records do not authorize a new transfer.