The verus_test branch is a migration branch that transitions Pangea-Bet from a hybrid architecture to a pure Verus-based architecture. This branch implements Verus ID (VDXF) communication to replace socket-based communication and removes Lightning Network dependencies.
-
Verus ID Communication System
- Core VDXF functions implemented in
poker/src/vdxf.c - Functions for reading/writing game state to Verus IDs
- Key-value storage system using Verus contentmultimap (CMM)
- ID creation and management (
sg777z.chips.vrsc@,dealer.sg777z.chips.vrsc@,cashier.sg777z.chips.vrsc@)
- Core VDXF functions implemented in
-
Code Refactoring & Cleanup
- Removed unused directories (basilisk, datachain, gecko, logos, assets, ccan)
- Renamed
crypto777→cryptodirectory - Renamed
cards777→cardsfiles - Fixed buffer overflows, memory leaks, and code safety issues
- Improved error handling throughout
-
Documentation
- Comprehensive GUI message format documentation (
docs/protocol/GUI_MESSAGE_FORMATS.md) - Verus migration documentation (
docs/verus_migration/) - Refactoring samples showing before/after code improvements
- Comprehensive GUI message format documentation (
-
CHIPS-Only Payments
- Payment system refactored to use CHIPS transactions
- Lightning Network functions stubbed out (return errors)
-
Legacy Code Removal
- Pub-Sub/NaNomsg: Mostly removed, but stub functions remain
- Functions like
bet_msg_dealer_with_response_id()are stubs - Ports 7797, 7798, 7901, 7902 defined but not actively used
- Functions like
- Lightning Network: Functions deprecated but still in codebase
- Functions return
ERR_LNerrors - Configuration variables may still exist
- Functions return
- Pub-Sub/NaNomsg: Mostly removed, but stub functions remain
-
Verus ID Integration
- Core functions exist but may not be fully integrated everywhere
- Some communication paths may still reference old socket-based methods
-
Complete Legacy Code Removal (See
.cursor/VERUS_MIGRATION_PLAN.md)- Phase 1: Move legacy functions to
poker/src/legacy/directory - Phase 2: Remove Lightning Network code completely
- Phase 3: Remove all pub-sub/nanomsg code
- Phase 1: Move legacy functions to
-
TODOs Found in Code
vdxf.c:59: More sophisticated key type determination systemvdxf.c:336: Multi-table support (currently single table only)vdxf.c:458: Handle case where TX succeeds but verus_pid not added to tableplayer.c:104,143,195: Error handling and rejoin logicdealer.c:276,283: Automated dealer registration, multi-table supportgame.c:140: Block wait time for dealer actions
-
Testing & Verification
- Verify all game flows work with Verus IDs only
- Test player reconnection scenarios
- Test dealer/cashier communication via Verus IDs
- Performance testing of Verus ID polling
poker/src/vdxf.c- Verus ID communication (1498 lines)poker/include/vdxf.h- VDXF function declarations and key definitionspoker/src/payment.c- Payment functions (CHIPS-only, LN stubbed)poker/src/network.c- Network functions (pub-sub stubbed)
poker/config/verus_dealer.ini- Verus dealer configurationpoker/config/verus_player.ini- Verus player configurationpoker/config/blockchain_config.ini- Blockchain settings
docs/verus_migration/- Verus migration documentationdocs/protocol/GUI_MESSAGE_FORMATS.md- GUI WebSocket API docs.cursor/VERUS_MIGRATION_PLAN.md- Detailed migration plan
sg777z.chips.vrsc@ (root)
├── dealer.sg777z.chips.vrsc@
│ └── <dealer_name>.sg777z.chips.vrsc@
│ └── Keys: t_table_info, t_player_info, t_game_info, etc.
├── cashier.sg777z.chips.vrsc@
│ └── Keys: chips.vrsc::poker.cashiers
└── <player_name>.sg777z.chips.vrsc@
└── Keys: player_deck, etc.
- Format:
chips.vrsc::poker.<key_name> - Examples:
chips.vrsc::poker.cashiers- Cashier listchips.vrsc::poker.dealers- Dealer listchips.vrsc::poker.t_table_info- Table informationchips.vrsc::poker.t_player_info- Player informationchips.vrsc::poker.t_game_info- Game state
- Dealer updates table ID with game state
- Players poll table ID to get updates
- Cashiers read/write to cashiers ID for coordination
- All updates are blockchain transactions (cost: tx_fee per update)
- GUI improvements: Independent threads, config path fixes, WebSocket fixes
- Code safety: Fixed buffer overflows, memory leaks
- Cleanup: Removed unused directories and files
- Refactoring: Improved JSON parsing, config loading, error handling
- Verus fixes: Fixed segmentation faults in Verus RPC commands
- Chain name: Replaced
chips777withchips
According to .cursor/VERUS_MIGRATION_PLAN.md:
- ✅ Verus ID communication implemented
⚠️ Legacy code still present (stubs)- ❌ Legacy code not yet moved to separate directory
- ❌ Lightning Network code not fully removed
- ❌ Pub-sub code not fully removed
- Immediate: Review and understand current Verus ID implementation
- Short-term: Complete Phase 1 - Move legacy code to
poker/src/legacy/ - Medium-term: Complete Phase 2 - Remove Lightning Network
- Long-term: Complete Phase 3 - Remove pub-sub, full Verus ID migration
- WebSocket Variables: Variables used by UI via WebSockets should NOT be removed even if they appear unused
- Error Codes:
ERR_LN_*(49-64) are deprecated but still defined - Ports: Old pub-sub ports (7797, 7798, 7901, 7902) are defined but not actively used
- Chain: Uses
chips10secchain (10-second block time) - Costs: Each Verus ID update costs a transaction fee (~0.0001 CHIPS)
Before considering this branch production-ready:
- Full game flow test (join → play → payout)
- Player reconnection test
- Multi-player game test
- Dealer disconnection/recovery test
- Cashier coordination test
- Performance test (Verus ID polling frequency)
- Error handling test (failed transactions, network issues)
- Migration Plan:
.cursor/VERUS_MIGRATION_PLAN.md - Architecture Docs:
.cursor/ARCHITECTURE.md - Code Locations:
.cursor/KEY_LOCATIONS.md - Verus Migration:
docs/verus_migration/verus_migration.md - GUI API:
docs/protocol/GUI_MESSAGE_FORMATS.md