Skip to content

Latest commit

 

History

History
84 lines (60 loc) · 2.05 KB

File metadata and controls

84 lines (60 loc) · 2.05 KB

Deployment Guide

Prerequisites

Step-by-step

1. Configure environment

cp .env.example .env
# Fill in DEPLOYER_SECRET, ADMIN_ADDRESS, XLM_TOKEN_ADDRESS

2. Deploy all contracts

chmod +x scripts/deploy.sh
./scripts/deploy.sh testnet
# Contract IDs written to .env.contracts

3. Initialize and wire contracts

chmod +x scripts/initialize.sh
./scripts/initialize.sh testnet
# Sets admin, fee config, and wires verification → progress cross-contract link

4. Generate TypeScript bindings

chmod +x scripts/generate-bindings.sh
./scripts/generate-bindings.sh testnet
# Bindings written to bindings/{contract}/

5. Seed testnet with demo data (optional)

chmod +x testnet/seed.sh
./testnet/seed.sh

6. Run the database migration

Copy migrations/001_initial_schema.sql to your backend repo and run it against PostgreSQL:

psql $DATABASE_URL -f migrations/001_initial_schema.sql

Mainnet checklist

  • Audit all four contracts
  • Replace testnet XLM token address with mainnet address in .env
  • Set STELLAR_NETWORK=mainnet and update RPC/Horizon URLs
  • Run ./scripts/deploy.sh mainnet
  • Run ./scripts/initialize.sh mainnet
  • Verify all contract IDs in .env.contracts
  • Regenerate bindings: ./scripts/generate-bindings.sh mainnet

Common Mistakes

Milestones approved but player levels don't advance You skipped the cross-contract wiring step. approve_milestone calls advance_level on the progress contract, but only if the link has been set. Fix it by running:

./scripts/initialize.sh testnet

Or manually:

stellar contract invoke --id $VERIFICATION_CONTRACT_ID \
  -- set_progress_contract \
  --progress_contract $PROGRESS_CONTRACT_ID

This must be done once after every fresh deployment.