Solana + Anchor backend for GAMESOL, an on-chain space strategy game.
The active backend is centered on two programs:
game_state: owns player profiles, planets, resources, buildings, research, fleets, missions, quests, store purchases, alliances, vault authorization, and ANTIMATTER-powered acceleration.market: handles player-to-player resource and planet listings, settles purchases againstgame_state, and routes ANTIMATTER market fees to the protocol treasury.
Core accounts:
PlayerProfile: per-wallet player profile and planet count.PlanetState: per-planet gameplay source of truth.PlanetCoordinates: public coordinate registry for galaxy/system/position.AuthorizedVault: wallet-approved signer used for routine gameplay actions.VaultBackup: encrypted vault recovery data.QuestStateandQuestProgressState: tutorial and recurring quest state.StoreConfigandStorePurchaseState: USDC store config and period limits.AllianceState,AllianceMembership,AllianceTreasuryState: alliance membership, deposits, buildings, and shared progression.MarketOfferandPlanetListing: resource and planet market listings.
programs/game-state: gameplay programprograms/market: market programdocs/game-state-program.md: gameplay program referencedocs/mainnet-readiness.md: production readiness checklistscripts/init-devnet-configs.cjs: devnet config initialization helperAnchor.toml: Anchor workspace configCargo.toml: Rust workspace config
- Rust toolchain
- Solana CLI
- Anchor CLI
0.30.1
anchor buildBuild only the gameplay program:
anchor build --program-name game_stateBuild only the market program:
anchor build --program-name marketRun the complete backend unit and regression suite:
cargo test --workspace --lib --lockedThis suite covers both on-chain programs and is required by GitHub Actions on
every pull request and every push to master. Add or update a regression test
with each behavioral or security fix.
Example devnet deploy flow:
anchor deploy --program-name game_state
anchor deploy --program-name marketIf Anchor builds the .so but IDL generation fails, the compiled program can
still be upgraded with solana program deploy using the configured upgrade
authority.
After deploying:
- verify on-chain program IDs match
Anchor.toml - verify frontend constants match the deployed program IDs and token mints
- initialize or update game, store, and market config accounts as needed
- run a manual smoke test through the production frontend
- ANTIMATTER is used for acceleration, market payments, alliance costs, and selected economy actions.
- USDC store purchases route to the configured treasury account.
- Market fees and alliance ANTIMATTER deposits route to the protocol ANTIMATTER treasury.
- Player resources are game-state balances, not SPL tokens.
cargo check --workspaceis the quick local verification pass.cargo test --workspace --lib --lockedis the required backend test pass.- The frontend lives in a separate repository:
https://github.com/SrMessiSOL/chained-universe-frontend
- Keep backend, frontend, deployed program binaries, and GitHub branches aligned before production testing.