https://github.com/fmorea/syncthing
EtherMesh is a feature-rich Android application that transforms peer-to-peer file synchronization into a powerful decentralized communication platform. Built upon the robust Syncthing engine, EtherMesh introduces the LinkThing framework, enabling serverless, peer-to-peer applications through a unique “Everything is a File” philosophy.
The “LinkThing” Protocol
EtherMesh turns synchronization into a distributed database and message bus. Inspired by the Unix philosophy, the LinkThing protocol operates on the principle that “Everything is a File.”
Instead of relying on real-time sockets or centralized servers, EtherMesh uses an eventual consistency model to sync application state via carefully structured files in a dedicated synchronization folder.
File-Based Gossip
EtherMesh uses a naming convention for files to manage state without a central database:
-
Messages:
{unix_timestamp}_{device_id}.msg(Text content stored inside). -
Replies:
{unix_timestamp}_{device_id}_{reply_timestamp}_{reply_device_id}.msg. -
Acknowledgments:
{timestamp}_{sender_id}_{receiver_id}.ack(Used for delivery and read receipts). -
Network Topology:
{node_a}_{node_b}.net(Used for “Beacons” to discover and map the decentralized mesh).
Decentralized Chat
A full-featured P2P chat is built directly into EtherMesh:
-
Serverless: Messages are gossiped across the mesh.
-
Rich Media: Supports attachments (images/files) and audio recordings.
-
Reliable: Acknowledgments (
.ackfiles) ensure you know when a peer has received your message. -
Event-Driven: Uses
FileObserverfor near-instant updates as soon as the underlying engine delivers a new file.
Demo: Decentralized Chess
Included in the app is a proof-of-concept Chess game:
-
Global State Sync: Uses a
.chessstate file to maintain board state across peers. -
State-Sync Transport: Optimized with non-blocking I/O to handle concurrent file updates.
-
Offline-First: Make your move while offline; it will automatically sync to your opponent whenever you are both back online.
Technical Details
-
Native Core: Bundles the official Syncthing Go binary (v1.x+) compiled for Android architectures.
-
LinkThing Transport: Implemented via
LinkThingRepositoryandLinkThingChessTransport, which monitor the local filesystem for changes synced from peers. -
Foreground Service: Runs as a reliable Android Foreground Service (
SyncthingService) with support for Android 14+dataSyncservice types. -
Architecture: Clean separation between the Go binary, the REST API communication layer, and the modern UI.
Getting Started
-
Install the APK on two or more Android devices.
-
Setup: Grant the necessary file permissions (All Files Access is recommended for seamless syncing).
-
Pair Devices: Open the “Show My ID” QR code on one device and scan it with the other, or simply tap them together if they have NFC enabled.
-
Chat & Play: Use the built-in Chat to communicate and start a Chess game to see EtherMesh in action.