Browse documentation
Local setup and operations
Requirements
- Node.js 24 or later and npm.
- A shared PostgreSQL or Turso/libSQL database on Vercel, or persistent local disk for development.
- A browser wallet funded with the relevant network gas asset.
- Working mainnet RPC access for each supported chain.
- A funded OpenRouter account and server-side API key for inference.
- Operator-controlled public receiving addresses on each chain.
- Optional Reown project ID for WalletConnect QR. Existing-token registration does not require Pinata.
Start locally
npm ci
cp .env.example .env.local
npm run dev
Open http://localhost:3000. The model catalogue is public. Wallet signatures and real funds are required for holder checks and contributions. This package contains no fabricated launches, market statistics, funded balances, or fake successful payments.
Set APP_ORIGIN to the exact browser origin. For a public host, use HTTPS and configure its actual origin. Never put server keys into variables beginning NEXT_PUBLIC_.
Enable the payment service
For the optional legacy personal-balance service only, set OPENROUTER_API_KEY, COMPUTE_ENABLED=true, SOLANA_TREASURY_ADDRESS, and PONS_TREASURY_ADDRESS. These are receiving addresses, not signing keys. Fund OpenRouter independently. The server never signs treasury transactions.
Set conservative MAX_PAYMENT_USD, MAX_REQUEST_USD, DAILY_COMPUTE_USD, PAYMENT_FX_BUFFER_BPS, and COMPUTE_MARKUP_BPS. Monitor outstanding service balances against actual provider capacity. The app does not automatically liquidate native proceeds or replenish the provider account.
Deployment model
npm run build
npm start
For Vercel, follow the deployment guide and configure the shared PostgreSQL or Turso database. Never store the ledger in a function filesystem. All production instances must share one database; preview environments should use separate credentials. For local operation, retain the data directory.
Checks
npm run typecheck
npm test
npm run build
Unit tests cover replay protection, double settlement, reservations, fee arithmetic, and signed authentication. Network and wallet smoke checks remain separate: load the real catalogue, register an existing token, verify a holder and non-holder, make a small community contribution, run a short request, and reconcile the charge. Perform this on both networks before wider use.
Reconcile uncertain inference
The database retains provider generation IDs when available. Inspect requests marked review or long-running pending. Compare with OpenRouter generation records and actual billing before returning funds.
npm run reconcile -- REQUEST_ID GENERATION_ID
If the provider confirms no charge occurred, an operator can issue a reviewed refund:
npm run reconcile -- REQUEST_ID --refund-reviewed
These are local administrative commands. Do not expose them as unauthenticated HTTP endpoints. Preserve the reconciliation ledger entry and supporting evidence.
Backups and maintenance
Use your remote database backup and restore facility. For local SQLite use a consistent database backup, not an uncoordinated copy of a live file. Encrypt backups and restrict access. Test restoration. Prune expired sessions, challenges, and rate-limit records. Apply your published retention schedule to inference response text.
Before accepting public users
Publish the operator identity, support/privacy contacts, and effective legal date. Review terms and regulatory obligations for the actual service. Confirm provider commercial terms for the intended paid gateway. Independently validate supported token contracts, RPC networks, treasury addresses and mainnet funding flows. Set monitoring for low provider balance, outstanding service credit, failed confirmations, held reservations, and unexpected cost overruns.
Community service configuration
Set OPENROUTER_API_KEY for the dedicated funded provider account. Credit checks use that key when accepted. If /api/v1/credits returns 403, provide OPENROUTER_MANAGEMENT_KEY for the same account. Never replace verified account credits with a key spending limit. Keep credentials server-side.
Set COMMUNITY_COMPUTE_ENABLED=true only when provider funding and the service policy are ready. Set COMMUNITY_FUNDING_ENABLED=true and the relevant treasury receiving address to enable contribution preparation. Community creation and public browsing do not fabricate funding when these flags are off.
For a confirmed deposit, top up the provider account externally, then allocate its actual intended credit:
npm run community:admin -- allocate FUNDING_ID 5.00 PROVIDER_TOPUP_REFERENCE
npm run community:admin -- review
npm run community:admin -- reconcile REQUEST_ID
npm run community:admin -- pause COMMUNITY_ID "Provider investigation"
npm run community:admin -- resume COMMUNITY_ID "Funding reconciled"
A manual reviewed refund requires a meaningful reason:
npm run community:admin -- refund-reviewed REQUEST_ID "Provider confirmed no charge after investigation"
Allocation cannot exceed the conservative deposit valuation or unallocated provider capacity. Keep the provider reference in private operational records. Commands must run against the same persistent database as the app.
Swap out the public test CA
FEATURED_TOKEN_ADDRESS=YOUR_PONS_CONTRACT_ADDRESS
FEATURED_TOKEN_IMAGE_URL=https://YOUR_AUTHENTIC_TOKEN_IMAGE
FEATURED_TOKEN_IS_TEST=false
FEATURED_DATA_SOURCE=rpc
ROBINHOOD_RPC_URL=https://YOUR_DEDICATED_ROBINHOOD_RPC
Restart the server. The observatory reads the new address and separates its chart history. The address must belong to the supported Pons factory for the onchain Pons reader. An unrelated direct Uniswap token needs a different observatory adapter; it can still be registered for community access using the generic ERC20 holder reader.
If the public RPC is unavailable, FEATURED_DATA_SOURCE=pons-indexed explicitly selects the public indexed display. It has no authority over financial or holder verification. The UI shows source, retrieval time and any publisher degradation notice; it does not call that data finalized.
Run npm run test:live for direct RPC verification. npm run test:indexed checks the default UBIK indexed sample; update that test's expected identity when deliberately replacing its fixture. Tests perform no trades and sign no mainnet transactions.
Project privacy
The distributed app contains no personal founder details. Use a project support alias if support is offered. Public-wallet activity remains pseudonymous and can be correlated. Assess any mandatory business disclosures separately; a no-biography design does not create an exemption.