$ show mudler/edgevpn
EdgeVPN is a decentralized peer-to-peer VPN and overlay networking tool built on libp2p. It provides a VPN tunnel (TUN interface), TCP service tunneling (ngrok-like), HTTP egress proxy, DNS resolution, file transfer, and a distributed ledger for network state coordination. The architecture is a single Go binary with an embedded React SPA dashboard, exposing a REST API (Echo framework) and CLI (urfave/cli v2). The core innovation is a blockchain-style ledger that stores machine, service, DNS, and health records, with optional signed ownership enforcement and liveness-based reaping. The system uses libp2p for peer discovery (DHT, mDNS), pubsub (gossipsub), relays, and circuit v2. It is designed for decentralized networks without central coordination, and is used in production by Kairos (Kubernetes) and LocalAI (P2P distribution). The codebase demonstrates strong engineering with functional options patterns, comprehensive test suites, documentation generation from CLI code, and a design system for the React UI. However, it carries technical debt from experimental features (PeerGuard, DHCP, IPv6), a forked libp2p-pubsub dependency, and documentation drift that requires manual regeneration.
The LLM identified 5 files worth highlighting for reuse:
Core ledger implementation providing a distributed key-value store with hash-chain blocks, signed entries, ownership enforcement (off/observe/enforce), tombstone-based deletion, and configurable merge strategies. It is self-contained, uses a clock interface for testability, and can be embedded as a state machine in other projects (e.g., LocalAI). Demonstrates non-obvious skill in gossip-based convergence without consensus.
A port of go-libp2p-connmgr adapted for streams, providing connection pruning with high/low watermarks, decaying tags, and resource limits. It is a generic, reusable component that can be extracted for any libp2p-based project needing stream-level resource management.
A custom React hook for polling API endpoints with visibility-aware, non-overlapping requests. It uses a ref for the latest fetcher to avoid stale closures, respects document visibility to pause polling, and surfaces errors. Can be reused in any React project needing reliable polling.
A reusable, generic data table component with client-side search, column sorting, and pagination. Built on CSS custom properties from the design system, it handles empty state and is fully typed. Can be extracted for any React project needing a sortable table.
A simple bounded ring buffer for deduplication of recently seen peers or messages. It is a small, self-contained data structure with O(1) operations, reusable in any Go project needing a fixed-size deduplication cache.