A Pong implementation with betting capabilities, built on top of Bison Relay's privacy-preserving network platform.
- 🏓 Real-time Pong gameplay with terminal-based and flutter UI
- 💰 Betting system with DCR transactions
- 🚦 Matchmaking system with waiting rooms
- 🔔 In-game notifications system
- gRPC API handles game state synchronization
- Bison Relay RPC Client handles payment transactions
- Two UI options
- Terminal UI (BubbleTea)
- Flutter UI
Prerequisites
Go 1.22+
Bison Relay client (with RPC configured)
Flutter for UI
# Navigate to the Flutter UI directory
cd pongui
For detailed information about building the Flutter UI, please see the Flutter UI Documentation.
go build -o pongbot ./cmd/pongbot
go build -o pongclient ./cmd/pongclient
Ensure your Bison Relay client configuration (brclient.conf or bruig.conf) contains:
[clientrpc]
jsonrpclisten = 127.0.0.1:7676
rpccertpath = /home/{user}/.brclient/rpc.cert
rpckeypath = /home/{user}/.brclient/rpc.key
rpcuser = whatever_username_you_want
rpcpass = some_strong_password
rpcauthmode = basic
rpcclientcapath = /home/{user}/.brclient/rpc-ca.cert
rpcissueclientcert = 1
When running the client (Flutter app or pongclient) for the first time, it will create a new configuration file with default values. These default values should match the RPC configuration of your bruig/brclient setup.
The client config is located at: {appdata}/.pongui/pongui.conf
serveraddr={server_ip_address}:50051
rpcurl=wss://127.0.0.1:7676/ws
servercertpath=/home/{user}/.brclient/rpc.cert
clientcertpath=/home/{user}/.brclient/rpc-client.cert
clientkeypath=/home/{user}/.brclient/rpc-client.key
grpcservercert=/home/{user}/server.cert
rpcuser=whatever_username_you_want
rpcpass=some_strong_password
When running the bot for the first time it will create a conf file with default values, which might need to be adjusted.
The bot config is located at: {appdata}/.pongbot/pongbot.conf
datadir=/home/{user}/.pongbot
isf2p=false
minbetamt=0.00000001
rpcurl=wss://127.0.0.1:7676/ws
grpchost=localhost
grpcport=50051
httpport=8888
servercertpath=/home/{user}/.brclient/rpc.cert
clientcertpath=/home/{user}/.brclient/rpc-client.cert
clientkeypath=/home/{user}/.brclient/rpc-client.key
rpcuser=whatever_username_you_want
rpcpass=some_strong_password
debug=debug
Same for the client: {appdata}/.pongclient/pongclient.conf
serveraddr=localhost:50051
rpcurl=wss://127.0.0.1:7676/ws
servercertpath=/home/{user}/.brclient/rpc.cert
clientcertpath=/home/{user}/.brclient/rpc-client.cert
clientkeypath=/home/{user}/.brclient/rpc-client.key
grpcservercert=/home/{user}/server.cert
rpcuser=whatever_username_you_want
rpcpass=some_strong_password
Start the pongbot server or connect to an existing one.
./pongbot
Start a client instance (terminal UI)
./pongclient
Start the Flutter UI client
# Navigate to the Flutter UI directory
cd pongui
- First, you must send a tip to the bot to establish your bet amount (in DCR)
- After tipping, you can create or join a waiting room
- You can only join waiting rooms with the same bet amount as your tip
- In the waiting room, you can:
- Get ready/unready
- Leave the waiting room
- When both players are ready, the game starts automatically
- Play using W/S or arrow keys (Up/Down)
- First player to score 3 points wins the match
- Winner takes all bets
- Ensure Channel Liquidity: Make sure your client has enough liquidity to receive the bet amount if you win
- Check Channel Status: You can verify your channel liquidity in the Bison Relay application under the Network tab, in the Channels section
- Minimum Bet: The minimum bet is determined by the bot configuration (default: 0.00000001 DCR | 1 atom)
- Connection Issues: Ensure your Bison Relay client is properly connected before starting a game
-
Configurable Minimum Bet
-minbetamt
flag sets minimum wager (default: 0.00000001 DCR) -
Free-to-Play Mode
-isf2p=true
enables simulated bets without real funds (disabled by default) -
Secure Payment Handling
Bot processes transactions through Bison Relay's RPC client
For detailed information about the gRPC API, please see the gRPC API Documentation.