Installation
Choose your setup
| Approach | When to use |
|---|---|
| API only | You just want to call endpoints. Use the hosted backend. |
| Frontend only | You want to run the web app locally against the hosted API. |
| Full stack | You want everything running on your machine. |
Prerequisites
- Rust 1.88+ (for backend)
- Node.js 18+ (for frontend)
- Docker (optional, for containerized backend)
Backend setup
# Clone the repo
git clone https://github.com/pranshurastogi/SPECTER.git
cd SPECTER/specter
# Copy environment config
cp .env.example .env
# Edit .env with your values (Pinata, Turso, etc.)
# Build and run
cargo build --release
cargo run --release --bin specter -- serve
The API server starts on http://localhost:3001.
Using Docker
cd SPECTER/specter
docker build -t specter .
docker run -p 3001:8080 --env-file .env specter
Frontend setup
cd SPECTER/SPECTER-web
npm install
npm run dev
The frontend starts on http://localhost:5173 and connects to the configured backend URL.
CLI usage
The specter binary supports standalone operations:
# Generate keys
cargo run --bin specter -- generate
# Create a stealth payment
cargo run --bin specter -- create --meta-address <META_ADDRESS>
# Scan for payments
cargo run --bin specter -- scan --viewing-sk <HEX> --spending-pk <HEX> --spending-sk <HEX>
# Run benchmarks
cargo run --bin specter -- bench
# Start API server
cargo run --bin specter -- serve
Environment variables
| Variable | Required | Description |
|---|---|---|
REGISTRY_BACKEND | No | memory (default) or turso |
TURSO_DATABASE_URL | For turso | libSQL connection string |
TURSO_AUTH_TOKEN | For turso | Auth token |
SPECTER_DB_ENC_KEY | For hardened turso | Base64 32-byte DB master key for pending-secret wrapping, dedup MACs, and telemetry hashing |
RELAYER_PRIVATE_KEY | For relayer | Enables server-side Monad announcement relay |
MONAD_RPC_URL | For relayer/chain | Monad RPC endpoint |
SPECTER_ANNOUNCER_ADDRESS | For relayer/chain | SPECTERAnnouncer contract address |
SPECTER_ANNOUNCER_DEPLOY_BLOCK | For chain indexing | Deployment block when ANNOUNCEMENT_SOURCE=chain |
ANNOUNCEMENT_SOURCE | No | Set chain to enable chain indexer config |
PINATA_JWT | For IPFS upload | Pinata upload credentials |
PINATA_GATEWAY_URL | For IPFS retrieve | Dedicated Pinata gateway |
PINATA_GATEWAY_TOKEN | For IPFS retrieve | Gateway access token |
ENS_RPC_URL | No | Ethereum mainnet RPC endpoint for ENS (default: https://ethereum.publicnode.com) |
SUI_RPC_URL | No | Sui RPC endpoint (defaults by USE_SUI_TESTNET) |
USE_TESTNET | No | General EVM/Monad testnet flag (default: false) |
USE_SUI_TESTNET | No | SuiNS testnet flag; defaults to USE_TESTNET |
ENABLE_CACHE | No | IPFS cache toggle (default: enabled; set false or 0 to disable) |
CHAIN_RPC_ETHEREUM | For payment verification | Source-chain RPC for chain: "ethereum" |
CHAIN_RPC_ARBITRUM | For payment verification | Source-chain RPC for chain: "arbitrum" |
CHAIN_RPC_BASE | For payment verification | Source-chain RPC for chain: "base" |
CHAIN_RPC_OPTIMISM | For payment verification | Source-chain RPC for chain: "optimism" |
CHAIN_RPC_POLYGON | For payment verification | Source-chain RPC for chain: "polygon" |
CHAIN_RPC_MONAD_TESTNET | For payment verification | Source-chain RPC for chain: "monad-testnet" |
CHAIN_RPC_SEPOLIA | For payment verification | Source-chain RPC for chain: "sepolia" |
API_KEY | No | Enables auth for write endpoints |
ALLOWED_ORIGINS | No | CORS origins (default: *) |
RATE_LIMIT_RPS | No | Requests per second (default: 10) |
RATE_LIMIT_BURST | No | Burst size (default: 30) |
MAX_BODY_SIZE | No | Request body limit in bytes (default: 1048576) |
Verify it's working
curl -s http://localhost:3001/health | jq .
# Should return: {"status":"ok","version":"..."}
Then run the quickstart flow against http://localhost:3001 instead of the hosted backend.