A High-Performance Decentralized Mesh Node for the Loom Protocol
Loom Node is a production-grade decentralized node implementation designed for high-availability mesh networks. It features cryptographically self-verifying messages, a collaborative state machine with conflict resolution, and deep operational observability.
The Loom Node is built on a modular, event-driven architecture designed for zero-trust environments and high resilience.
graph TD
subgraph Client Interface
API[HTTP REST API /metrics]
RPC[JSON-RPC Interface]
end
subgraph Core Engine
Bridge[Async Result Bridge]
Engine[P2P Engine / Swarm]
State[LWW State Machine]
end
subgraph Data Layer
Persistence[SQLite Storage]
DHT[Kademlia DHT Store]
end
API <--> Bridge
RPC <--> Bridge
Bridge <--> Engine
Engine <--> State
Engine <--> Persistence
Engine <--> DHT
subgraph Resilience ["Network Resilience"]
Relay[Relay v2 Client]
DCUTR[Direct Hole Punching]
AutoNAT[NAT Detection]
end
Engine --- Resilience
Every message in the Loom mesh is a cryptographically signed envelope. The protocol embeds public keys within messages, allowing any node to validate the integrity and origin of data without external identity lookups or centralized authorities.
Implements a distributed state machine using Last-Writer-Wins (LWW) conflict resolution. This ensures all nodes eventually converge on the same state even in highly partitioned or high-latency networks.
- Multi-Transport Support: TCP/IP with Noise encryption and Yamux multiplexing.
- NAT Traversal: Built-in support for AutoNAT, UPnP, and DCUTR for reliable connectivity behind symmetric NATs.
- Active Peer Reputation: Malicious or low-performing peers are automatically penalized and quarantined.
Native Prometheus integration provides real-time insights into:
- Peer density and discovery latency.
- Message propagation speeds.
- DHT health and record persistence.
- SQLite I/O performance.
Launch a 3-node cluster complete with a full observability stack (Prometheus & Grafana) using Docker Compose:
docker-compose up -d| Service | URL | Description |
|---|---|---|
| Grafana | http://localhost:3000 | Visual health & mesh metrics (Admin/Admin) |
| Prometheus | http://localhost:9090 | Raw metric scraping & alerting |
| Node-A API | http://localhost:8081 | Control interface for the first node |
Verify end-to-end P2P synchronization across the cluster:
python3 scripts/demonstrate_sync.py --wait// Cryptographic validation is performed at the engine level before propagation
let public_key = libp2p::identity::PublicKey::try_decode_protobuf(&envelope.public_key)?;
envelope.verify(&public_key)?; engine.rs: Swarm management, behavior composition, and event loop.state_machine.rs: Conflict-free replicated state logic.storage.rs: Thread-safe, asynchronous SQLite persistence.protocol.rs: Protobuf-based message schemas and signing logic.
Distributed under the MIT License. See LICENSE for more information.
Built for the next generation of decentralized infrastructure.