Skip to content

Deployment Modes

HyperToken can run as a local Node process, a browser client, a relay-assisted peer network, or an application with a server-side authority. The state model remains the same: each Engine uses a Chronicle, and networked peers exchange Automerge sync data.

Mode Use Boundary
Local CLI Develop or play an example without a network. State is in one process unless persisted.
Browser client Run a bundled game in the browser. Browser shims and hosting must support the generated bundle.
Relay-assisted peers Connect clients through npm run relay or Compose. The relay forwards traffic and is unauthenticated.
Authoritative service Use the server classes in network/ when an application needs a trusted room/server process. Authority and validation are application deployment choices.

Run the relay or Blackjack demo

npm run relay starts the WebSocket relay on port 3000. With Docker Engine 20.10+ and Compose V2, you can also run the services in docker-compose.yml:

docker build -t hypertoken:latest .
docker compose up relay

The optional example profile uses port 9090 for its Blackjack relay. Run docker compose --profile examples up to start the profile, or run docker compose up blackjack-server first, then docker compose run blackjack-alice and docker compose run blackjack-bob in separate shells.

Authentication, TLS termination, persistence policy, resource limits, and monitoring must be supplied by the deployment environment.