Files
spaces-startos/startos/utils.ts
T
spacesops b308d0ceaa
Build Service / BuildPackage (push) Has been cancelled
v0.0.9:2
2026-05-23 02:37:38 -04:00

99 lines
4.2 KiB
TypeScript

import { utils } from '@start9labs/start-sdk'
export const uiPort = 8080
export const spacedRpcPort = 7225
export const dataDir = '/data'
export const APP_USER = 'admin'
export const BITCOIN_RPC_USER = 'spaces'
export const BITCOIND_PACKAGE_ID = 'bitcoind'
export const BITCOIND_RPC_HOSTNAME = 'bitcoind.startos'
export const BITCOIND_RPC_PORT = 8332
export const SPACED_CHAIN = 'mainnet'
export const POSTGRES_PORT = 5432
export const POSTGRES_USER = 'postgres'
export const POSTGRES_DB = 'spacesprotocol_explorer'
export const pgDataDir = '/data/postgres'
export const INDEXER_REPO = 'spacesprotocol/explorer-indexer'
export const INDEXER_GIT_SHA = '00ae1e548734d93f1a8bb9f48d2290f459e12b35'
// Bump the suffix to force a full re-fetch + rebuild of /data/explorer-indexer.
export const INDEXER_BUILD_ID = `${INDEXER_GIT_SHA}-g3`
export const INDEXER_TARBALL_URL = `https://github.com/${INDEXER_REPO}/archive/${INDEXER_GIT_SHA}.tar.gz`
export const INDEXER_DIR = '/data/explorer-indexer'
export const INDEXER_BIN_DIR = '/data/explorer-indexer/bin'
export const INDEXER_SYNC_BIN = '/data/explorer-indexer/bin/sync'
export const INDEXER_GOOSE_BIN = '/data/explorer-indexer/bin/goose'
export const INDEXER_SCHEMA_DIR = '/data/explorer-indexer/sql/schema'
export const INDEXER_MARKER = '/data/explorer-indexer/.installed-sha'
// Spaces protocol mainnet activation block (per spacesprotocol/explorer-indexer
// env.example). Indexer skips fast-sync below FAST_SYNC and starts indexing
// spaces data at ACTIVATION.
export const INDEXER_ACTIVATION_HEIGHT = '871222'
export const INDEXER_FAST_SYNC_HEIGHT = '864000'
export const INDEXER_UPDATE_INTERVAL = '5'
export const INDEXER_MEMPOOL_CHUNK_SIZE = '200'
export const EXPLORER_REPO = 'randomlogin/explorer'
export const EXPLORER_GIT_SHA = 'c827da1754c3cba5c5507d2c29f21b8fa231344d'
// Bump suffix to force re-fetch + rebuild of /data/explorer-ui.
export const EXPLORER_BUILD_ID = `${EXPLORER_GIT_SHA}-e1`
export const EXPLORER_TARBALL_URL = `https://github.com/${EXPLORER_REPO}/archive/${EXPLORER_GIT_SHA}.tar.gz`
export const EXPLORER_DIR = '/data/explorer-ui'
export const EXPLORER_BUILD_DIR = '/data/explorer-ui/build'
export const EXPLORER_MARKER = '/data/explorer-ui/.installed-sha'
export const EXPLORER_PORT = 3000
export const EXPLORER_NETWORK = 'mainnet'
// Subspaces ships as the prebuilt horologger/subs image; binaries live at
// these paths inside it. No build-from-source step.
export const SUBSPACES_SUBS_BIN = '/usr/local/bin/subs'
export const SUBSPACES_PROVER_BIN = '/usr/local/bin/subs-prover'
export const SUBSPACES_REGISTRY_BIN = '/usr/local/bin/registry-server'
export const SUBSPACES_DIR = '/data/subspaces'
export const SUBSPACES_DATA_DIR = '/data/subspaces/data'
export const SUBSPACES_PROVER_DIR = '/data/subspaces/prover'
export const SUBSPACES_REGISTRY_DIR = '/data/subspaces/registry'
export const SUBSPACES_UI_PORT = 7777
export const SUBSPACES_PROVER_PORT = 8888
// 8081 (not the upstream default 8080) to avoid colliding with the gotty
// Space-CLI Web UI on 8080.
export const SUBSPACES_REGISTRY_PORT = 8081
export const SUBSPACES_WALLET = 'default'
// Certrelay ships as the prebuilt horologger/certrelay image; both binaries
// are static musl, so `fabric` runs anywhere once copied onto the volume.
export const CERTRELAY_BIN = '/usr/local/bin/certrelay'
export const CERTRELAY_FABRIC_BIN = '/usr/local/bin/fabric'
// Copied here so the gotty terminal (which has /data/bin on PATH) can run it.
export const CERTRELAY_FABRIC_DEST = '/data/bin/fabric'
export const CERTRELAY_DIR = '/data/certrelay'
export const CERTRELAY_DATA_DIR = '/data/certrelay/data'
export const CERTRELAY_PORT = 7778
export const CERTRELAY_CHAIN = 'mainnet'
export const CERTRELAY_BIND = '0.0.0.0'
export const CERTRELAY_REMOTE_IP_HEADER = 'x-forwarded-for'
export const CERTRELAY_ANCHOR_REFRESH = '300'
export const CERTRELAY_DEFAULT_SELF_URL = 'https://certrelay.spacesops.com'
export const CERTRELAY_DEFAULT_HEALTHCHECK_HANDLE =
'account-digital-useful.genesis@key'
export const CERTRELAY_DEFAULT_BOOTSTRAP = false
export function randomPassword() {
// bitcoind's generate-rpc-dependent action validates the password against
// /^[A-Za-z0-9_-]+$/, so the charset must stay in that set.
return utils.getDefaultString({
charset: 'a-z,A-Z,1-9',
len: 32,
})
}