Build a Gacha Machine
Messaging
Message Definition: Same as DeCharge (
XephyDechargeMessage
), but typically only processesRequest
toWorking
andStatus
back toAvailable
.Mention Tag (Machine Pubkey): Identifies the GaCha machine (e.g.,
PublicKey::parse("gacha_machine_pubkey")
).Session Tag: Scopes events (e.g.,
"xephy-gacha-controller"
).Publishing and Subscription
Copy
Sender: User requesting a dispense.
Receiver: Gacha node controller.
Message Handling: Processes a single transaction and reverts state.
Building Controller
Node: Unlike DeCharge, Gacha’s simpler transaction (one payment, one action) doesn’t require a separate server. The node handles both state and payment in a single step using
pay
, making it lightweight.
Solana Interaction
Uses pay
for a one-time transaction:
Copy
Last updated