Skip to content

Local Development

This guide covers running the SDK server locally and deploying with Docker — for Rollerz internal developers and contributors.

Local development

bash
pnpm install
pnpm build
pnpm dev:sdk-server    # starts the SDK server on port 3001

The server reads .env from the repo root. Key variables:

VariableDefaultDescription
PORT3001SDK server listen port
CORS_ORIGIN*Allowed CORS origins
GO3_SERVER_URLhttp://localhost:8080/mockGO3 RGS endpoint
GO3_BOOSTED_MULTIPLE2Boosted bet multiplier for GO3
RIPPINRUMBLE_SERVER_URLhttp://localhost:8080/mockRippin Rumble RGS endpoint
RIPPINRUMBLE_BOOSTED_MULTIPLE2Boosted bet multiplier for Rippin Rumble
RIPPINRUMBLE_BASE_BUNDLE_MULTIPLE10Base-bundle bet multiplier for Rippin Rumble
STEPPER_SERVER_URLhttp://localhost:3000Stepper RGS endpoint
BRIDGE_URLhttp://localhost/bridge.htmlBridge URL baked into the SDK bundle at build time
BRIDGE_ALLOWED_ORIGINS(empty = allow all)Comma-separated origins allowed to postMessage to the bridge
MATH_SERVER_ALLOWED_HOSTS(empty = no enforcement)Comma-separated hosts (host[:port]) allowed for body-driven ?server= overrides. Must be set in production to prevent SSRF.

To point the local SDK server at a staging RGS, change GO3_SERVER_URL (or the relevant provider URL) in .env:

GO3_SERVER_URL=https://math-prod.example.com/rockandsmash-v102/mock

Env vars are fallback defaults

The *_SERVER_URL variables are fallbacks. When the game is launched with ?server=… in the URL (the GammaStack handshake pattern), that value overrides the env default for that launch. To exercise a different math server without touching .env, just append ?server=https://… to the game URL. See Launch URL parameters.

SSRF guard for ?server= overrides

Because ?server= travels in the request body, the SDK server gates outbound POSTs on MATH_SERVER_ALLOWED_HOSTS. When the var is unset (local dev default) any host is accepted; set it in production to an exact-match list of trusted math-server hosts, e.g. math-test-nl.reelsoft.net.

Docker deployment

bash
cp .env.example .env   # edit as needed
docker compose build
docker compose up -d    # SDK server on port 80

The Docker container serves the SDK bundle, bridge, and API behind nginx. See the project README for full Docker commands.