{"id":35863513,"url":"https://github.com/vixcpp/p2p","last_synced_at":"2026-01-29T22:11:40.625Z","repository":{"id":331089738,"uuid":"1125211706","full_name":"vixcpp/p2p","owner":"vixcpp","description":"Vix.cpp P2P is a secure, offline-first peer-to-peer networking layer for high-performance C++ systems.","archived":false,"fork":false,"pushed_at":"2026-01-27T16:51:15.000Z","size":151,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T03:16:47.617Z","etag":null,"topics":["p2p","p2p-network","p2p-offline-first","vix","vixcpp"],"latest_commit_sha":null,"homepage":"https://vixcpp.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vixcpp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-30T10:29:37.000Z","updated_at":"2026-01-27T16:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vixcpp/p2p","commit_stats":null,"previous_names":["vixcpp/p2p"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/vixcpp/p2p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fp2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fp2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fp2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fp2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vixcpp","download_url":"https://codeload.github.com/vixcpp/p2p/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fp2p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28887095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["p2p","p2p-network","p2p-offline-first","vix","vixcpp"],"created_at":"2026-01-08T13:16:23.685Z","updated_at":"2026-01-29T22:11:40.620Z","avatar_url":"https://github.com/vixcpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ Vix.cpp — P2P Module\n\nHigh-performance **peer-to-peer \u0026 edge networking module** for **Vix.cpp**.  \nDesigned for **offline-first systems**, **unstable networks**, and **secure distributed runtimes**.\n\nThis module powers Vix’s **sync engine (WAL / outbox)** and forms the **transport backbone** of the ecosystem.\n\n---\n\n## ✨ What this module provides\n\n✅ TCP peer connections  \n✅ Secure handshake lifecycle  \n✅ Per-peer session state  \n✅ Peer discovery (UDP broadcast / multicast)  \n✅ HTTP bootstrap (registry pull / announce)  \n✅ Runtime peer \u0026 handshake statistics  \n✅ Clean shutdown \u0026 signal handling  \n✅ Modular, production-shaped architecture  \n\nThis is **not** a toy P2P example.\n\n---\n\n## 📂 Repository layout\n\n```\nmodules/p2p/\n├── include/            # Public P2P API (Node, Peer, Protocol, Crypto, …)\n├── src/                # Implementation\n├── tests/\n│   ├── manual/         # Manual integration tests\n│   │   ├── main.cpp    # p2p_demo (real runtime demo)\n│   │   └── registry.py # HTTP bootstrap registry (test server)\n│   └── CMakeLists.txt\n├── build/              # Build output\n│   └── tests/\n│       └── p2p_demo    # Compiled demo binary\n├── CMakeLists.txt\n├── README.md\n├── CHANGELOG.md\n└── LICENSE\n```\n\n---\n\n## 🧪 Demo: `p2p_demo`\n\nThe **real executable demo** lives here after build:\n\n```bash\ncmake -S . -B build -DVIX_P2P_BUILD_TESTS=ON\ncmake --build build -j\nbuild/tests/p2p_demo\n```\n\nIt spins up a full P2P node with:\n- listening socket\n- optional outbound connections\n- discovery\n- bootstrap\n- live stats\n\n---\n\n## 🚀 Run the demo\n\n### Terminal A\n```bash\n./build/tests/p2p_demo --id A --listen 9001\n```\n\n### Terminal B\n```bash\n./build/tests/p2p_demo --id B --listen 9002 --connect 127.0.0.1:9001\n```\n\n### Delayed connect (handshake timeout test)\n```bash\n./build/tests/p2p_demo \\\n  --id B \\\n  --listen 9002 \\\n  --connect 127.0.0.1:9001 \\\n  --connect-delay 8000\n```\n\n### Auto stop after 20 seconds\n```bash\n./build/tests/p2p_demo --id A --listen 9001 --run 20\n```\n\n---\n\n## 📊 Runtime statistics\n\nPrinted periodically while running:\n\n```\npeers_total=2\npeers_connected=1\nhandshakes_started=1\nhandshakes_completed=1\n```\n\nFinal stats are always printed on exit.\n\n---\n\n## 🌐 Discovery \u0026 Bootstrap (optional)\n\n### UDP discovery\n```bash\n--discovery on\n--disc-mode broadcast | multicast\n--disc-port 37020\n```\n\n### HTTP bootstrap registry\n```bash\n--bootstrap on\n--registry http://127.0.0.1:8080/p2p/v1\n--announce on\n```\n\nA minimal test registry is provided in:\n\n```\ntests/manual/registry.py\n```\n\n---\n\n## 🔐 Security model (high-level)\n\n- Explicit handshake state machine  \n- Per-peer session lifecycle  \n- Control messages remain plaintext (safe bootstrapping)  \n- Designed for AEAD encrypted payloads  \n- Ready for secure WAL / sync traffic  \n\n---\n\n## 🎯 Who this is for\n\n- C++ backend engineers  \n- Distributed systems developers  \n- Offline-first / local-first builders  \n- Edge \u0026 P2P networking enthusiasts  \n- Anyone who wants **real** P2P, not fake examples  \n\n---\n\n## ⭐ Why star this module?\n\n- Clean **production-oriented P2P design**\n- Minimal but **realistic**\n- Built for **unstable networks**\n- Reusable as a base for:\n  - sync engines\n  - mesh networks\n  - decentralized runtimes\n- Actively used inside **Vix.cpp**\n\n---\n\n## 🧭 Status\n\n✔️ Actively developed  \n✔️ Manually tested  \n✔️ Used internally  \n🚧 Continuously evolving  \n\n---\n\nIf this module helped you understand **how real P2P in C++ should look**,  \n**leave a ⭐ it genuinely helps the project grow.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fp2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvixcpp%2Fp2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fp2p/lists"}