libp2p Message Board & Battleship System
A serverless gossipsub message board and a Battleship game over libp2p, with rendezvous-based opponent finding.
Rust · libp2p · tokio · protobuf · SQLite · ratatui
A COSC473 project exploring peer-to-peer communication with libp2p, in about 1,900 lines of Rust. A serverless message board is built on gossipsub, with peers finding each other through a bootstrap node and a Kademlia DHT, and games advertised through a rendezvous node. Connections run over TCP and QUIC with Noise encryption and yamux multiplexing, messages are encoded with protobuf, and message history and the node's keypair persist in SQLite. Battleship is implemented over libp2p's request-response protocol, covering ship placement, shots, hit, miss and sunk results, and resignation, all handled in an async tokio select loop that multiplexes the protocol streams. Messaging, peer listing and gameplay run through a ratatui terminal UI, and the node was tested against a public bootstrap server.