Skip to main content

Choose your setup

ApproachWhen to use
API onlyYou just want to call endpoints. Use the hosted backend.
Frontend onlyYou want to run the web app locally against the hosted API.
Full stackYou 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-cli -- 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-cli binary supports standalone operations:
# Generate keys
cargo run --bin specter-cli -- generate

# Create a stealth payment
cargo run --bin specter-cli -- create --meta-address <META_ADDRESS>

# Scan for payments
cargo run --bin specter-cli -- scan --viewing-sk <HEX> --spending-pk <HEX> --spending-sk <HEX>

# Run benchmarks
cargo run --bin specter-cli -- bench

# Start API server
cargo run --bin specter-cli -- serve

Environment variables

VariableRequiredDescription
REGISTRY_BACKENDNomemory (default) or turso
TURSO_DATABASE_URLFor tursolibSQL connection string
TURSO_AUTH_TOKENFor tursoAuth token
PINATA_JWTFor IPFSPinata upload credentials
PINATA_GATEWAY_URLFor IPFSYour Pinata gateway
PINATA_GATEWAY_TOKENFor IPFSGateway access token
ETH_RPC_URLFor ENSEthereum RPC endpoint
SUI_RPC_URLFor SuiNSSui RPC endpoint
API_KEYNoEnables auth for write endpoints
ALLOWED_ORIGINSNoCORS origins (default: *)
RATE_LIMIT_RPSNoRequests per second (default: 10)

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.