PeerLink is a next-generation peer-to-peer VPN solution that creates a full-mesh network topology with a blockchain-based control plane powered by the Sui network. Connect all your devices seamlessly across the internet with a single command, enabling secure, decentralized networking without traditional VPN servers.
- 🕸️ Full Mesh P2P VPN: Every device connects directly to every other device for optimal performance
- 🔗 Sui Blockchain Control Plane: Decentralized network management and peer discovery via Sui smart contracts
- 🌐 Exit Node Support: Route internet traffic through designated exit nodes for enhanced privacy
- 🔐 End-to-End Encryption: All traffic is encrypted using modern cryptographic protocols
- 📱 Cross-Platform: Supports Win/MacOS/Linux/FreeBSD/Android and X86/ARM/MIPS architectures
- ⚡ High Performance: Optimized for low latency and high throughput. Zero-copy throughout the entire link (TCP/UDP/WSS/WG protocols)
- 🛡️ NAT Traversal: Automatic NAT and firewall traversal for seamless connectivity supporting UDP and IPv6 traversal
PeerLink consists of two main components:
- peerlink-core: The main VPN daemon that handles peer connections, routing, and traffic forwarding
- peerlink-cli: Command-line interface for network management and configuration
- Gateway Components: TCP/UDP proxies with NAT for internet routing via exit nodes
- Peer Management: OSPF-like routing protocol for optimal path selection
- Sui Move Contracts: Blockchain-based network registry and peer discovery
- Network Management: Decentralized creation and management of VPN networks
- Exit Node Registry: Blockchain-managed exit node discovery and selection
- Rust 1.89.0 or later
- Sui CLI tools (for blockchain features)
- Platform-specific network permissions (root/administrator access)
-
Clone the repository:
git clone https://github.com/siphonelee/peerlink.git cd peerlink -
Build the application:
cd app cargo build --release -
Install binaries:
# Linux/macOS sudo cp target/release/peerlink-core /usr/local/bin/ sudo cp target/release/peerlink-cli /usr/local/bin/ # Or add to PATH export PATH=$PATH:$(pwd)/target/release
-
Configure Sui blockchain credentials:
cd app cp .sui.env.example .sui.env # Edit .sui.env with your Sui credentials
-
Create or join a network:
# Create a new network peerlink-cli network create my-network secret123 -d "My private network" # Or join an existing network peerlink-core --network-name my-network --network-secret secret123
-
Start the VPN daemon:
sudo peerlink-core --config-file config.toml
-
Manage exit nodes:
# List available exit nodes peerlink-cli network exit-nodes my-network
# List all networks
peerlink-cli network list
# Get network information
peerlink-cli network info <network-name>
# Get network secret (for authorized users)
peerlink-cli network secret <network-name>
# Exit node management
peerlink-cli network exit-nodes <network-name>
peerlink-cli network remove-exit-node <network-name> <peer-id>PeerLink uses TOML configuration files. See app/peerlink.toml.example for a complete configuration template.
Key configuration sections:
- Network settings: IP ranges, interface configuration
- Sui blockchain: Contract addresses and credentials
- Security: Encryption settings and access control
- Performance: Connection timeouts and buffer sizes
peerlink/
├── app/ # Main application code
│ ├── src/
│ │ ├── peerlink-core.rs # VPN daemon
│ │ ├── peerlink-cli.rs # CLI tool
│ │ ├── gateway/ # Traffic routing and NAT
│ │ ├── peers/ # Peer management and routing
│ │ ├── tunnel/ # Network tunneling protocols
│ │ └── chain_op/ # Blockchain operations
│ └── Cargo.toml
├── contract/ # Sui smart contracts
│ └── sui_move/
└── README.md
# macOS
cargo build --release --target x86_64-apple-darwin
# Linux
cargo build --release --target x86_64-unknown-linux-gnu
# Windows
cargo build --release --target x86_64-pc-windows-gnucd app
cargo test- Networks are registered on the Sui blockchain
- Peers discover each other through blockchain queries
- Direct P2P connections are established using STUN/TURN protocols
- Direct P2P: Traffic between peers flows directly through encrypted tunnels
- Exit Node Routing: Internet traffic is routed through designated exit nodes
- NAT Traversal: Automatic hole punching for connections behind NAT/firewalls
- All peer communications are end-to-end encrypted
- Blockchain provides tamper-proof network configuration
- No central servers that can be compromised
- Exit nodes provide optional internet access without compromising peer privacy
We welcome contributions!
- Install Rust and Sui CLI tools
- Fork and clone the repository
- Create a feature branch
- Make your changes and add tests
- Submit a pull request