Git Product home page Git Product logo

libp2p-rs's Introduction

Alternative repository for work on libp2p

Continuous integration

This repository is an alternative implementation in Rust of the libp2p spec. Not like rust-libp2p, libp2p-rs is written with async/await syntax, and driven by async runtime. Even though, many codes are borrowed from rust-libp2p and some from go-libp2p. We are trying to keep compatible with the two implementations, but it is unfortunately not guaranteed.

Documentations

How to use the library?

As mentioned above, the API is completely different from rust-libp2p. There is no such thing as 'NetworkBehaviour' in libp2p-rs at all. Instead, you should build the Swarm with the transports you like to use, then you have to create a Swarm::Control from it. The Swarm::Control is exposing all Swarm APIs which can be used to manipulate the Swarm - open/read/write/close streams and even more. This is quite similar as the BasicHost in go-libp2p. As for Kad-DHT, similarly you should get the Kad::Control for the same reason. Furthermore, you can combine the Swarm with Kad, after that you have the RoutedHost, which has a routing functionality over the BasicHost.

It is strongly recommended to check the docs and sample code in details:

Code examples:

  • Details about how to write your code can be found in examples
    • swarm_simple demonstrates how to build transport and create sub-stream for communication
    • kad_simple demonstrates how to run a Kad-DHT server. In this example, the interactive shell is integrated for debugging/observing Kad-DHT internal data structures
    • ...

Releases

NOTE: The master branch is now an active development branch (starting with v0.1.0), which means breaking changes could be made at any time.

libp2p-rs's People

Contributors

0xflotus avatar chenguzhen87 avatar diandianl avatar genedna avatar itling avatar kingwel-xie avatar macrocan avatar restoreall 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.