No description
  • Go 78.8%
  • HTML 11.9%
  • Shell 6.6%
  • Python 1%
  • CSS 0.9%
  • Other 0.8%
Find a file
ryuko b82862d244
All checks were successful
Deploy API / deploy (push) Successful in 1m39s
Update .forgejo/workflows/deploy-dev.yml
fixing build path
2026-06-04 22:20:17 +00:00
.forgejo/workflows Update .forgejo/workflows/deploy-dev.yml 2026-06-04 22:20:17 +00:00
cmd Merge pull request 'Cors are .env driven now' (#30) from feature/bettercors into dev 2026-06-01 17:58:43 +00:00
domino.gg-database fix(payments/evm): wire monitors, fix wallet model, backfill recovery (#25) 2026-05-28 03:00:32 +00:00
e2e docs(e2e): live testnet validation recipe (Sepolia + BSC testnet) (#29) 2026-05-28 04:22:15 +00:00
internal Merge pull request 'Cors are .env driven now' (#30) from feature/bettercors into dev 2026-06-01 17:58:43 +00:00
test-cors Added crash engine 2026-05-18 00:48:15 -03:00
utils Updated ALL README.md for future documentation 2026-05-12 21:54:38 -03:00
.gitignore Added crash engine 2026-05-18 00:48:15 -03:00
env.example Cors are .env driven now 2026-06-01 14:57:24 -03:00
go.mod feat(payments/evm): add primitives — keys, address, ABI, tx build/sign 2026-05-09 14:56:58 -03:00
go.sum feat(payments/evm): add primitives — keys, address, ABI, tx build/sign 2026-05-09 14:56:58 -03:00
readme.md Added blackgame engine 2026-05-13 04:19:52 -03:00
server actually fixed now. 2026-02-03 04:17:17 -03:00

domino.gg backend

Go backend for the domino.gg crypto-betting platform: provably-fair games (Plinko, Mines, Dice, Blackjack), multi-chain payment infrastructure (BTC, LTC, ETH, BSC + ERC20/BEP20 stables), JWT auth with refresh rotation, a Postgres-backed job queue, and WebSocket transport for live bets.

Repository layout

domino.gg/
├── cmd/                       # process entrypoints (main packages)
│   ├── server/                # HTTP + WS API server
│   ├── payments/              # background worker: deposit monitor, withdrawal broadcast
│   ├── games/                 # offline simulation/RTP CLI
│   └── test/                  # manual integration smoke tests
├── internal/                  # application packages
│   ├── auth/                  # JWT + refresh token rotation
│   ├── dbm/                   # Postgres access (queries, row types, helpers)
│   ├── games/                 # game orchestration facade
│   │   ├── plinko/            # Plinko engine + RTP math
│   │   ├── mines/             # Mines engine + payout tables
│   │   ├── dice/              # Dice over/under engine
│   │   ├── blackjack/         # Blackjack engine (seeded shoe + hit/stand/double/split)
│   │   └── fariness/          # provably-fair seed/HMAC primitives (pkg name: fairness)
│   ├── http/                  # router, middleware (pkg name: http; alias as httpapi)
│   │   ├── handlers/          # REST endpoint handlers
│   │   └── ws/                # WebSocket hub + bet handlers
│   ├── network/               # low-level TLS-aware transport (Electrum, RPC)
│   ├── payments/              # payment domain contracts + driver registry
│   │   ├── utxo/              # BTC/LTC driver (Electrum-backed)
│   │   ├── evm/               # ETH/BSC driver (native + ERC20/BEP20)
│   │   ├── deposits/          # detected/confirmed callbacks + recovery
│   │   └── withdrawals/       # withdrawal handler + broadcaster + recovery
│   └── queue/                 # Postgres job queue (FOR UPDATE SKIP LOCKED + LISTEN/NOTIFY)
├── utils/                     # cross-package helpers (bcrypt, hCaptcha, misc)
├── domino.gg-database/        # Postgres docker-compose, init SQL, migrations
├── go.mod                     # module: domino.gg (Go 1.25)
└── env.example                # required environment variables

Running

# 1. start Postgres
cd domino.gg-database && docker compose up -d

# 2. populate .env (see env.example for the full list)
cp env.example .env && $EDITOR .env

# 3. run API + WS server
go run ./cmd/server

# 4. run background workers (deposit monitor, withdrawal broadcast)
go run ./cmd/payments

Required env vars: DATABASE_URL, JWT_SECRET, SITE_KEY, HCAPTCHA_SECRET, MODE (DEV/PROD). Chain-specific vars (BTC_*, LTC_*, ETH_*, BSC_*) are listed in env.example and default to mainnet/public defaults when unset.

Where to look

Subpackage docs

Each package has a README explaining types, key functions, and usage. Start with the package you are touching:

Conventions