Git Product home page Git Product logo

cpp-libp2p's Introduction

CPP-Libp2p

Fully compatible C++17 implementation of libp2p library

Libp2p is a modular networking stack described in spec

Dependencies

All dependencies are managed using Hunter. It uses cmake to download required libraries and does not require downloading and installing packages manually. Target C++ compilers are:

  • GCC 7.4
  • Clang 6.0.1
  • AppleClang 11.0

Supported protocols

Development

Clone

To clone repository execute

git clone https://github.com/soramitsu/libp2p.git

Build cpp-libp2p

First build will likely take long time. However, you can cache binaries to 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:

GITHUB_HUNTER_USERNAME=<github account name>
GITHUB_HUNTER_TOKEN=<github token>

To generate github token follow the instructions. Make sure read:packages and write:packages permissions are granted (step 7 in instructions).

This project can be built with

mkdir build && cd build
cmake -DCLANG_TIDY=ON ..
make -j

It is suggested to build project with clang-tidy checks, however if you wish to omit clang-tidy step, you can use cmake .. instead.

Tests can be run with:

cd build
ctest

CodeStyle

We follow CppCoreGuidelines.

Please use provided .clang-format file to autoformat the code.

Examples

Please explore example section to read examples of how to use the library

Adding cpp-libp2p to the project

cpp-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 for details.

After hunter is integrated adding cpp-libp2p can be done by adding these lines to cmake:

hunter_add_package(libp2p)
find_package(libp2p REQUIRED)

To set which version of cpp-libp2p to use it is required to add these lines to Hunter/config.cmake file:

hunter_config(libp2p
    URL https://github.com/soramitsu/libp2p/archive/dad84a03a9651c7c2bb8a8f17d0e5ea67bd10b4f.zip
    SHA1 860742c6e3e9736d68b392513d795e09572780aa
    )

Where URL is the link to archive of certain commit in cpp-libp2p repo and SHA1 is the checksum of this archive. By simply updating URL and SHA1 it is possible to change the version of cpp-libp2p in another project.

Example of adding cpp-libp2p to other project can be found here and here

Notable users

Maintenance

Maintainers: @Warchant, @kamilsa, @harrm, @masterjedy, @igor-egorov, @art-gor

Tickets: Can be opened in Github Issues.

cpp-libp2p's People

Contributors

akvinikym avatar alexey-n-chernyshov avatar art-gor avatar bulatsaif avatar eigendude avatar harrm avatar iceseer avatar kamilsa avatar masterjedy avatar ortyomka avatar sergkaprovich avatar turuslan avatar warchant avatar woodsmc avatar xdimon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.