How mudler/edgevpn works
EdgeVPN is a Go application and embeddable library for forming decentralized private networks over libp2p, with VPN, DNS, service tunneling, file transfer, and a shared ledger. The main workflow is: a user supplies a shared network configuration or token, starts a node, and the node discovers peers and exchanges ledger-backed state; configured services then provide VPN connectivity or other peer-to-peer features. The optional local API and React dashboard expose network status and ledger data. CLI startup wiring is sampled; feature-level links beyond those shown are limited to documented capabilities and repository structure.
Main entry points: cmd CLI commands · node.go Peer node · ledger.go Distributed ledger · api.go Local status API
Components 21
CLI and API
- EdgeVPN binary
main.go - CLI commands
cmd - Network config
pkg/config/config.go - Local status API
api/api.go
Peer Network
- Peer node
pkg/node/node.go - Peer discovery
pkg/discovery - P2P protocols
pkg/protocol/protocol.go
Ledger and Trust
- Distributed ledger
pkg/blockchain/ledger.go - Ledger storage
pkg/blockchain/store_disk.go - Trust zones
pkg/trustzone
Network Features
- VPN interface
pkg/vpn/vpn.go - DNS service
pkg/services/dns.go - Peer liveness
pkg/services/alive.go - Egress and DHCP
pkg/services/egress.go - TCP service tunnel
pkg/services/services.go - P2P file transfer
pkg/services/files.go - Reverse proxy
cmd/proxy.go
Dashboard
- Web dashboard
api/react-ui/src/router.tsx - API client
api/react-ui/src/lib/api.ts
Other components
- Network operator
- Dashboard user
Connections 26
- Network operator → EdgeVPN binary: runs
- EdgeVPN binary → CLI commands: starts
- CLI commands → Network config: loads or generates
- CLI commands → Peer node: starts
- CLI commands → VPN interface: registers interface
- CLI commands → Peer liveness: adds service
- CLI commands → DNS service: adds when enabled
- CLI commands → Egress and DHCP: adds when enabled
- Peer node → Peer discovery: discovers peers
- Peer node → P2P protocols: uses protocols
- Peer node → Distributed ledger: shares network state
- Distributed ledger → Ledger storage: persists data
- Peer node → Trust zones: applies peer gating
- Peer node → VPN interface: configures
- Peer node → DNS service: hosts service
- Peer node → Peer liveness: runs service
- Peer node → Egress and DHCP: runs service
- Distributed ledger → TCP service tunnel: provides service records
- CLI commands → TCP service tunnel: configures TCP tunnel
- CLI commands → P2P file transfer: dispatches file commands
- CLI commands → Reverse proxy: dispatches proxy command
- CLI commands → Local status API: starts optionally
- Local status API → Distributed ledger: reads network state
- Dashboard user → Web dashboard: views status
- Web dashboard → API client: requests data
- API client → Local status API: calls local API