A read-only SpacetimeDB relay holding a live replica of BitCraft's public state.
Point the stock spacetimedb-sdk or your generated bindings at this
host instead of upstream, change nothing else, and get the same data — without
adding load to the game servers.
Pick a module, subscribe, and the SDK maintains a local cache exactly as it would against upstream. No BitCraft token is needed — the relay issues its own identities; upstream never sees your clients.
import { DbConnection } from './module_bindings'; DbConnection.builder() .withUri('wss://relay.example.com') // ← the only change .withDatabaseName('idc-8') .onConnect((conn) => { // An event table: each row arrives once, as an insert, and is never cached. conn.db.marketTradeEvent.onInsert((_ctx, trade) => console.log(`${trade.quantity} × item ${trade.itemId} at ${trade.unitPrice}`)); conn.subscriptionBuilder() .onApplied(() => console.log('local cache ready')) .subscribe([ 'SELECT * FROM player_state', 'SELECT * FROM market_trade_event', ]); }) .build();
use module_bindings::*; use spacetimedb_sdk::{DbContext, EventTable}; let conn = DbConnection::builder() .with_uri("wss://relay.example.com") // ← the only change .with_database_name("idc-8") .on_connect(|conn, _, _| { conn.subscription_builder().subscribe([ "SELECT * FROM player_state", "SELECT * FROM market_trade_event", ]); }) .build()?; // An event table: each row arrives once, as an insert, and is never cached. conn.db.market_trade_event().on_insert(|_ctx, trade| { println!("{} × item {} at {}", trade.quantity, trade.item_id, trade.unit_price); }); conn.run_threaded();
curl -s 'https://relay.example.com/v1/database/idc-8/schema?version=10' \ | jq '{V10: .}' > bitcraft.json mkdir -p spacetimedb # the CLI wants a module dir, even with --module-def spacetime generate --lang typescript --module-def bitcraft.json \ --out-dir src/module_bindings # --lang rust for the Rust SDK
Already on 1.x bindings, such as the community ones? Point them here unchanged: rows arrive as they do from upstream. Event tables need a 2.x SDK.
curl https://relay.example.com/v1/ping curl 'https://relay.example.com/v1/database/idc-8/schema?version=9' | jq '.tables | length'
BitCraft records what just happened (a trade, a craft, a swing) in event tables: each row reaches subscribers once and is never stored. Below is a protocol-v2 client in plain JavaScript, no SDK, subscribed through this relay to every event table of the module picked above.
The relay speaks SpacetimeDB's HTTP API and its v1, v2 and v3 WebSocket protocols, so existing tooling works unmodified.
?version=9 or 10Subscriptions and SQL over the replicated tables. Reducer calls are refused — this is a window into the world, not a way to act on it.
If upstream drops, connected clients keep a consistent snapshot while the relay reconnects, rather than being cut off mid-session.
Tables excluded from replication error at subscribe time. You will never mistake "not replicated here" for an empty result.