Skip to main content

Stake Engine

Alongside XGENIA RGS, XGENIA ships nodes for Stake Engine — Stake's own remote game server. A Stake Engine game is built like any XGENIA project, but the wallet, round lifecycle and bet levels come from Stake's RGS.

The nodes are Pro Nodes, under Stake Engine in the node picker.

info

The protocol is Stake's — stake-engine.com/docs/rgs is the authority on it. This page covers the XGENIA side.

The round lifecycle

A round runs through four calls, one node each:

NodeRole
RGS AuthenticateOpens the session. Returns the balance, game config, jurisdiction flags — and any round left unfinished last time.
RGS PlayPlaces a bet. Returns the bet id, payout, multiplier and round state.
RGS End RoundCloses and settles the round.
RGS EventSends a named event mid-round, for game-specific steps.

Start with Authenticate, and check its Round Active output first: if the player closed the tab mid-spin, an unfinished round is waiting, and you must finish it before starting a new one. The Round object says where it got to.

RGS Authenticateopens the sessionunfinished round?noRGS Playplace the betoptional: RGS EventRGS End Roundsettle and closenext roundyes — finish it firstfinish that roundRGS End Round on it

Two nodes watch the session rather than drive it — prefer them over polling, since they also fire on changes your own graph didn't cause:

NodeRole
RGS Balance UpdatePulses whenever the balance changes, for any reason.
RGS Round ActivePulses when a round opens or closes.

(RGS Balance re-reads the wallet on demand, when you do need to poll.)

Amounts

Stake Engine sends money as integers scaled by 1,000,000 — an API amount of 2500000 is 2.50. Four nodes handle the conversion so you never hard-code it:

NodeConverts
RGS Parse AmountAPI integer → decimal.
RGS To API AmountDecimal → API integer.
RGS Display AmountBalance object → formatted string for the UI.
RGS API MultiplierThe multiplier itself, for your own arithmetic.

Ports named (API) — like Amount (API) and Payout (API) — are in the integer scale. Mixing the two conventions is the easiest mistake here: a bet of 1 is not one unit of currency but one millionth of one.

Configuration

Every call node has the same three config ports:

PortPurpose
URL (optional)Override the RGS endpoint. Empty = the session's own.
ProtocolProtocol version.
Enforce Bet LevelsReject a stake the operator doesn't permit before sending it. Leave on — a local failure you can show the player beats a round that dies at the server.

Every call node reports Success, Failure and Error. Wire Failure. Refused bets and dropped sessions are normal events on a real network; a game that only handles Success will silently hang on them.

Publishing

Stake hosts the frontend, so publishing is an export: DEPLOY → Deploy to Stake → Pick folder. XGENIA writes the static frontend files there for you to upload to Stake.

This is unrelated to the XGENIA tab's RGS path — no game is created and no maths components are deployed. A Stake Engine game's maths runs on Stake's servers, and these nodes are how the frontend talks to it.