{"id":51101048,"url":"https://github.com/Pier-Two/c-libp2p","last_synced_at":"2026-06-26T08:00:12.710Z","repository":{"id":285689934,"uuid":"944310400","full_name":"Pier-Two/c-libp2p","owner":"Pier-Two","description":"C implementation of Libp2p","archived":false,"fork":false,"pushed_at":"2026-05-09T02:54:05.000Z","size":7223,"stargazers_count":36,"open_issues_count":4,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-09T03:38:55.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://piertwo.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/Pier-Two.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT.md","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-03-07T06:04:20.000Z","updated_at":"2026-05-09T02:54:08.000Z","dependencies_parsed_at":"2025-07-06T13:22:56.795Z","dependency_job_id":"f9fb3b50-7f23-47e3-b34b-4cb12da70f2a","html_url":"https://github.com/Pier-Two/c-libp2p","commit_stats":null,"previous_names":["pier-two/libp2p-c","pier-two/c-libp2p"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pier-Two/c-libp2p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pier-Two%2Fc-libp2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pier-Two%2Fc-libp2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pier-Two%2Fc-libp2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pier-Two%2Fc-libp2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pier-Two","download_url":"https://codeload.github.com/Pier-Two/c-libp2p/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pier-Two%2Fc-libp2p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34808043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-24T11:00:13.605Z","updated_at":"2026-06-26T08:00:12.679Z","avatar_url":"https://github.com/Pier-Two.png","language":"C","funding_links":[],"categories":["Implementations"],"sub_categories":[],"readme":"# c-libp2p\n\n**c-libp2p** is an implementation of the [libp2p specification](https://github.com/libp2p/specs) written in C.  The project is still in active development but already provides the building blocks needed for peer-to-peer networking applications.\n\n## Building\n\nc-libp2p uses CMake and should build on Linux, macOS and Windows.  A C compiler that supports the C11 standard is required.\n\n### Clone the repository\n\n```sh\ngit clone --recursive https://github.com/Pier-Two/c-libp2p.git\ncd c-libp2p\n```\n\nThe `--recursive` flag ensures that all third-party submodules are fetched.\n\n### Linux / macOS\n\n```sh\nmkdir build\ncmake -S . -B build\ncmake --build build\nctest --test-dir build\n```\n\nSanitizers can be enabled with `-DENABLE_SANITIZERS=ON` and additional flags in `SANITIZERS`.  Stress tests for the TCP module are built when `-DENABLE_STRESS_TESTS=ON` is passed.\n\n### Windows\n\nA recent Visual Studio with CMake support is recommended.  From the *x64 Native Tools* command prompt run:\n\n```bat\nmkdir build\ncmake -S . -B build -G \"Visual Studio 16 2019\" -A x64\ncmake --build build --config Release\nctest --test-dir build -C Release\n```\n\nWhen building shared libraries on Windows the produced DLLs are copied next to the test executables automatically.\n\n## CI lanes\n\nValidation is split into two lanes:\n\n- Fast lane (`.github/workflows/ci-fast.yml`, required for PRs):\n  - `macos-smoke`\n  - `linux-smoke`\n  - `windows-smoke`\n- Full lane (`.github/workflows/ci-full.yml`, runs on `main`, nightly, and manual dispatch):\n  - `macos-full`\n  - `linux-gcc-full`\n  - `linux-clang-full`\n  - `linux-sanitizers` (ASan/UBSan)\n  - `windows-full`\n\nThe lane presets are versioned in `CMakePresets.json` and can be run locally:\n\n```sh\n# fast lane (macOS example)\ncmake --preset macos-smoke\ncmake --build --preset macos-smoke\nctest --preset macos-smoke\n\n# full lane (macOS example)\ncmake --preset macos-full\ncmake --build --preset macos-full\nctest --preset macos-full\n```\n\nFor Windows validation from non-Windows development machines, trigger and monitor the full lane with GitHub CLI:\n\n```sh\ngh workflow run ci-full.yml --ref \u003cbranch\u003e\ngh run list --workflow ci-full.yml\ngh run watch \u003crun-id\u003e\ngh run view \u003crun-id\u003e --log\n```\n\n## Local pre-push fast-lane hook (macOS/Linux)\n\nInstall the repository-managed git hooks:\n\n```sh\nscripts/dev/install-hooks.sh\n```\n\nThis configures `core.hooksPath` to `.githooks` and enables a `pre-push` hook that runs the same macOS/Linux fast-lane checks used by CI.\n\nOn Linux, fast-lane checks include:\n- clang-format diff check for changed `src/`, `include/`, and `tests` C files.\n- a targeted Doxygen documentation gate for changed headers in `include/multiformats/unsigned_varint/` and `include/multiformats/multicodec/` (`WARN_IF_UNDOCUMENTED=YES`, `WARN_AS_ERROR=YES`).\n- a targeted MISRA add-on check for rewritten multiformats scope (`unsigned_varint` + `multicodec`) with documented Rule 8.7 advisory suppressions for exported API symbols.\n- a targeted `clang-tidy` CERT gate (`-checks=-*,cert-*`, warnings-as-errors) for changed C sources in `src/multiformats/{unsigned_varint,multicodec}`.\n- `cppcheck` smoke static analysis for core scope.\n\nManual local run:\n\n```sh\n# Auto-detect host platform (macOS or Linux)\nscripts/dev/run-fast-lane-local.sh\n\n# Force a specific platform script\nscripts/dev/run-fast-lane-local.sh --platform macos\nscripts/dev/run-fast-lane-local.sh --platform linux\n```\n\nTo bypass the hook for one push:\n\n```sh\nLIBP2P_SKIP_FAST_HOOK=1 git push\n```\n\n## Project Structure\n\n- `src/` – library source code\n- `include/` – public headers\n- `tests/` – unit tests\n- `benchmarks/` – optional benchmarks\n- `docs/` – user guides and examples\n\nDetailed documentation is available under [docs/](docs/README.md).\n\n## Third-party libraries\n\nc-libp2p bundles several third-party projects under `external/`:\n\n- [libtomcrypt](https://github.com/libtom/libtomcrypt) and [libtommath](https://github.com/libtom/libtommath) – [LibTom License](http://unlicense.org/)\n- [secp256k1](https://github.com/bitcoin-core/secp256k1) – [MIT License](https://opensource.org/licenses/MIT)\n- [sha3](https://github.com/pablotron/sha3) – [MIT-0 License](https://opensource.org/license/mit-0/)\n- [WjCryptLib](https://github.com/WaterJuice/WjCryptLib) – [Unlicense](http://unlicense.org/)\n- [c20p1305](https://github.com/wg/c20p1305) – [MIT License](https://opensource.org/licenses/MIT)\n- [libeddsa](https://github.com/phlay/libeddsa) – [Unlicense](http://unlicense.org/)\n- [noise-c](https://github.com/uink45/noise-c) – [MIT License](https://opensource.org/licenses/MIT)\n\nPlease refer to each submodule for license details.\n\n## License\n\nThe code in this repository is licensed under the [MIT License](LICENSE-MIT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPier-Two%2Fc-libp2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPier-Two%2Fc-libp2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPier-Two%2Fc-libp2p/lists"}