{"id":13629810,"url":"https://github.com/libp2p/cpp-libp2p","last_synced_at":"2025-05-15T14:04:53.986Z","repository":{"id":37823482,"uuid":"209043384","full_name":"libp2p/cpp-libp2p","owner":"libp2p","description":"C++17 implementation of libp2p","archived":false,"fork":false,"pushed_at":"2025-05-09T20:00:49.000Z","size":2358,"stargazers_count":419,"open_issues_count":29,"forks_count":110,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-05-09T21:19:41.725Z","etag":null,"topics":["cpp17","libp2p"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libp2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2019-09-17T12:07:29.000Z","updated_at":"2025-05-09T20:00:52.000Z","dependencies_parsed_at":"2024-05-29T17:54:11.526Z","dependency_job_id":"0a44f142-6767-41a0-ad8c-b5eabde66874","html_url":"https://github.com/libp2p/cpp-libp2p","commit_stats":{"total_commits":204,"total_committers":34,"mean_commits":6.0,"dds":0.7696078431372549,"last_synced_commit":"a52146dd54439661246fe93f701c7820d774b75b"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":"Warchant/cmake-hunter-seed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fcpp-libp2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fcpp-libp2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fcpp-libp2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fcpp-libp2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libp2p","download_url":"https://codeload.github.com/libp2p/cpp-libp2p/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp17","libp2p"],"created_at":"2024-08-01T22:01:20.392Z","updated_at":"2025-05-15T14:04:53.934Z","avatar_url":"https://github.com/libp2p.png","language":"C++","funding_links":[],"categories":["C++","Implementations"],"sub_categories":[],"readme":"# CPP-Libp2p  \n\n\u003e Fully compatible C++20 implementation of libp2p library\n\nLibp2p is a modular networking stack described in [spec](https://github.com/libp2p/specs)\n\n## Dependencies\n\nAll dependencies are managed using [Hunter](https://github.com/qdrvm/hunter). It uses cmake to download required libraries and does not require downloading and installing packages manually.\nTarget C++ compilers are:\n* GCC 7.4\n* Clang 6.0.1\n* AppleClang 11.0\n\n## Supported protocols\n* Transports: TCP\n* Security protocols: [Plaintext 2.0](https://github.com/libp2p/specs/blob/master/plaintext/README.md), [SECIO](https://github.com/libp2p/specs/blob/master/secio/README.md)\n* Multiplexing protocols: [MPlex](https://github.com/libp2p/specs/tree/master/mplex), [Yamux](https://github.com/hashicorp/yamux/blob/master/spec.md)\n* [Kademlia DHT](https://github.com/libp2p/specs/pull/108)\n* [Gossipsub](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub) (WIP)\n* [Identify](https://github.com/libp2p/specs/tree/master/identify)\n\n## Development\n### Clone\n\nTo clone repository execute\n```\ngit clone https://github.com/libp2p/cpp-libp2p.git\n```\n\n### Build cpp-libp2p\n\nFirst build will likely take long time. However, you can cache binaries to [hunter-binary-cache](https://github.com/qdrvm/hunter-binary-cache) or even download binaries from the cache in case someone has already compiled project with the same compiler. To do so you need to set up two environment variables:\n```\nGITHUB_HUNTER_USERNAME=\u003cgithub account name\u003e\nGITHUB_HUNTER_TOKEN=\u003cgithub token\u003e\n```\nTo generate github token follow the [instructions](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Make sure `read:packages` and `write:packages` permissions are granted (step 7 in instructions).\n\nThis project can be built with\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -DCLANG_TIDY=ON ..\nmake -j\n```\n\nIt is suggested to build project with clang-tidy checks, however if you wish to omit clang-tidy step, you can use `cmake ..` instead.\n\nTests can be run with: \n```\ncd build\nctest\n```\n\n### CodeStyle\n\nWe follow [CppCoreGuidelines](https://github.com/isocpp/CppCoreGuidelines).\n\nPlease use provided [.clang-format](.clang-format) file to autoformat the code.\n\n## Examples\n\nPlease explore [example](example) section to read examples of how to use the library\n\n## Adding cpp-libp2p to the project\n\ncpp-libp2p can be integrated using hunter. Adding hunter support to your project is really simple and require you only to add some cmake. Check [hunter example project](https://github.com/forexample/hunter-simple/) for details. \n\nAfter hunter is integrated adding cpp-libp2p can be done by adding these lines to cmake:\n```cmake\nhunter_add_package(libp2p)\nfind_package(libp2p REQUIRED)\n``` \nTo set which version of cpp-libp2p to use it is required to add these lines to Hunter/config.cmake file:\n```cmake\nhunter_config(libp2p\n    URL https://github.com/libp2p/cpp-libp2p/archive/dad84a03a9651c7c2bb8a8f17d0e5ea67bd10b4f.zip\n    SHA1 860742c6e3e9736d68b392513d795e09572780aa\n    )\n``` \nWhere URL is the link to archive of certain commit in cpp-libp2p repo and SHA1 is the checksum of this archive.\nBy simply updating URL and SHA1 it is possible to change the version of cpp-libp2p in another project. \n\nExample of adding cpp-libp2p to other project can be found [here](https://github.com/qdrvm/kagome/blob/3edda60f27d378a21fc57cd8bec7f0f519203318/cmake/dependencies.cmake#L59) and [here](https://github.com/qdrvm/kagome/blob/3edda60f27d378a21fc57cd8bec7f0f519203318/cmake/Hunter/config.cmake#L24)\n\n## Notable users\n\n* https://github.com/qdrvm/kagome\n* https://github.com/filecoin-project/cpp-filecoin  \n\n## Maintenance\n\nMaintainers: [@Warchant], [@kamilsa], [@harrm], [@masterjedy], [@igor-egorov], [@art-gor]\n\n[@Warchant]: https://github.com/Warchant \n[@kamilsa]: https://github.com/kamilsa \n[@harrm]: https://github.com/harrm \n[@masterjedy]: https://github.com/masterjedy \n[@igor-egorov]: https://github.com/igor-egorov \n[@art-gor]: https://github.com/art-gor \n    \nTickets: Can be opened in Github Issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fcpp-libp2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibp2p%2Fcpp-libp2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fcpp-libp2p/lists"}