• Stars
    star
    2,283
  • Rank 20,175 (Top 0.4 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The JavaScript Implementation of libp2p networking stack.

js-libp2p-monorepo

libp2p.io Discuss codecov CI

JavaScript implementation of libp2p, a modular peer to peer network stack

Table of contents

Structure

libp2p hex logo

The JavaScript implementation of the libp2p Networking Stack.



Project status

We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons 🐉..

The documentation in the master branch may contain changes from a pre-release. If you are looking for the documentation of the latest release, you can view the latest release on npm, or select the tag in github that matches the version you are looking for.

Want to get started? Check our GETTING_STARTED.md guide and examples folder.

Want to update libp2p in your project? Check our migrations folder.

Background

libp2p is the product of a long and arduous quest to understand the evolution of the Internet networking stack. In order to build P2P applications, devs have long had to make custom ad-hoc solutions to fit their needs, sometimes making some hard assumptions about their runtimes and the state of the network at the time of their development. Today, looking back more than 20 years, we see a clear pattern in the types of mechanisms built around the Internet Protocol, IP, which can be found throughout many layers of the OSI layer system, libp2p distils these mechanisms into flat categories and defines clear interfaces that once exposed, enable other protocols and applications to use and swap them, enabling upgradability and adaptability for the runtime, without breaking the API.

We are in the process of writing better documentation, blog posts, tutorials and a formal specification. Today you can find:

To sum up, libp2p is a "network stack" -- a protocol suite -- that cleanly separates concerns, and enables sophisticated applications to only use the protocols they absolutely need, without giving up interoperability and upgradeability. libp2p grew out of IPFS, but it is built so that lots of people can use it, for lots of different projects.

Roadmap

The js-libp2p roadmap can be found here: https://github.com/libp2p/js-libp2p/blob/master/ROADMAP.md

It represents current projects the js-libp2p maintainers are focused on and provides an estimation of completion targets.

It is complementary to the overarching libp2p project roadmap: https://github.com/libp2p/specs/blob/master/ROADMAP.md

Install

npm install libp2p

Usage

Configuration

For all the information on how you can configure libp2p see CONFIGURATION.md.

Limits

For help configuring your node to resist malicious network peers, see LIMITS.md

Getting started

If you are starting your journey with js-libp2p, read the GETTING_STARTED.md guide.

Tutorials and Examples

You can find multiple examples on the examples folder that will guide you through using libp2p for several scenarios.

Development

Clone and install dependencies:

> git clone https://github.com/libp2p/js-libp2p.git
> cd js-libp2p
> npm install
> npm run build

Tests

Run unit tests

# run all the unit tsts
> npm test

# run just Node.js tests
> npm run test:node

# run just Browser tests (Chrome)
> npm run test:chrome

Packages

List of packages currently in existence for libp2p

This table is generated using the module package-table with package-table --data=package-list.json.

Package Version Deps CI Coverage
libp2p
libp2p npm Deps GitHub CI codecov
@libp2p/interface-libp2p npm Deps GitHub CI codecov
transports
@libp2p/tcp npm Deps GitHub CI codecov
@libp2p/webrtc npm Deps GitHub CI codecov
@libp2p/websockets npm Deps GitHub CI codecov
@libp2p/webtransport npm Deps GitHub CI codecov
secure channels
@chainsafe/libp2p-noise npm Deps GitHub CI codecov
stream multiplexers
@libp2p/mplex npm Deps GitHub CI codecov
@chainsafe/libp2p-yamux npm Deps GitHub CI codecov
peer discovery
@libp2p/bootstrap npm Deps GitHub CI codecov
@libp2p/kad-dht npm Deps GitHub CI codecov
@libp2p/mdns npm Deps GitHub CI codecov
@chainsafe/discv5 npm Deps GitHub CI codecov
content routing
@libp2p/http-v1-content-routing npm Deps GitHub CI codecov
@libp2p/ipni-content-routing npm Deps GitHub CI codecov
@libp2p/delegated-content-routing npm Deps GitHub CI codecov
@libp2p/kad-dht npm Deps GitHub CI codecov
peer routing
@libp2p/delegated-peer-routing npm Deps GitHub CI codecov
@libp2p/kad-dht npm Deps GitHub CI codecov
utilities
@libp2p/crypto npm Deps GitHub CI codecov
data types
@libp2p/peer-id npm Deps GitHub CI codecov
@libp2p/record npm Deps GitHub CI codecov
@libp2p/peer-record npm Deps GitHub CI codecov
pubsub
@ChainSafe/libp2p-gossipsub npm Deps GitHub CI codecov
@libp2p/floodsub npm Deps GitHub CI codecov

Used by

And many others...

Contribute

The libp2p implementation in JavaScript is a work in progress. As such, there are a few things you can do right now to help out:

  • Go through the modules and check out existing issues. This would be especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
  • Perform code reviews. Most of this has been developed by @diasdavid, which means that more eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
  • Add tests. There can never be enough tests.

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

go-libp2p

libp2p implementation in Go
Go
6,012
star
2

rust-libp2p

The Rust Implementation of the libp2p networking stack.
Rust
3,768
star
3

libp2p

A modular and extensible networking stack which solves many challenges of peer-to-peer applications.
2,357
star
4

specs

Technical specifications for the libp2p networking stack
1,409
star
5

go-reuseport

reuse tcp/udp ports in golang
Go
681
star
6

go-libp2p-kad-dht

A Kademlia DHT implementation on go-libp2p
Go
485
star
7

py-libp2p

The Python implementation of the libp2p networking stack 🐍 [under development]
Python
460
star
8

cpp-libp2p

C++17 implementation of libp2p
C++
355
star
9

go-libp2p-examples

Example libp2p applications
339
star
10

js-libp2p-webrtc-star

libp2p WebRTC transport that includes a discovery mechanism provided by the signalling-star
TypeScript
320
star
11

go-libp2p-pubsub

The PubSub implementation for go-libp2p
Go
291
star
12

jvm-libp2p

a libp2p implementation for the JVM, written in Kotlin 🔥
Kotlin
257
star
13

rust-yamux

Multiplexer over reliable, ordered connections.
Rust
171
star
14

go-libp2p-core

Interfaces and abstractions that make up go-libp2p
Go
145
star
15

js-libp2p-kad-dht

JavaScript implementation of the DHT for libp2p
TypeScript
138
star
16

go-libp2p-swarm

The libp2p swarm manages groups of connections to peers, and handles incoming and outgoing streams
Go
114
star
17

go-libp2p-quic-transport

An implementation of a libp2p transport using QUIC
Go
113
star
18

js-libp2p-websockets

WebSockets module that libp2p uses and that implements the interface-transport spec
TypeScript
96
star
19

go-libp2p-daemon

a libp2p-backed daemon wrapping the functionalities of go-libp2p for use in other languages
Go
90
star
20

go-libp2p-peerstore

an object to manage sets of peers, their addresses and other metadata
Go
90
star
21

hydra-booster

A DHT Indexer node & Peer Router
Go
87
star
22

universal-connectivity

Realtime decentralised chat with libp2p showing ubiquitous peer-to-peer connectivity between multiple programming languages (Go, Rust, TypeScript) and runtimes (Web, native binary) using QUIC, WebRTC and WebTransport
TypeScript
85
star
23

go-libp2p-webrtc-direct

A libp2p transport that enables browser-to-server, and server-to-server, direct communication over WebRTC without requiring signalling servers
Go
82
star
24

js-libp2p-crypto

The libp2p crypto primitives, for Node.js and the Browser!
TypeScript
80
star
25

js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
JavaScript
80
star
26

js-libp2p-webrtc-direct

Dial using WebRTC without the need to set up any Signalling Rendezvous Point!
TypeScript
78
star
27

research-pubsub

Research on PubSub algorithms for libp2p
76
star
28

js-libp2p-tcp

JavaScript implementation of the TCP module that libp2p uses that implements the interface-transport spec
TypeScript
76
star
29

js-libp2p-interfaces

Contains test suites and interfaces you can use to implement the various components of js libp2p.
TypeScript
75
star
30

go-buffer-pool

Go
71
star
31

js-libp2p-examples

Examples for the JS implementation of libp2p
70
star
32

go-libp2p-raft

A LibP2P wrapper for hashicorp/raft implementation.
Go
64
star
33

go-libp2p-nat

NAT port mapping library for go-libp2p
Go
63
star
34

go-libp2p-http

HTTP on top of libp2p
Go
62
star
35

go-ws-transport

a websocket implementation of a go-libp2p transport
Go
60
star
36

go-tcp-transport

An implementation of a libp2p transport using tcp
Go
59
star
37

docs

Documentation site for the libp2p project.
HTML
59
star
38

go-libp2p-gorpc

A simple RPC library for libp2p.
Go
57
star
39

go-libp2p-discovery

Active Peer Discovery
Go
53
star
40

go-libp2p-autonat

DEPRECATED: NAT Autodiscovery
Go
53
star
41

js-libp2p-mplex

JavaScript implementation of https://github.com/libp2p/mplex
TypeScript
52
star
42

js-libp2p-mdns

libp2p MulticastDNS Peer Discovery
TypeScript
51
star
43

punchr

🥊 Components to measure Direct Connection Upgrade through Relay (DCUtR) performance.
Jupyter Notebook
49
star
44

go-netroute

Routing table abstraction library
Go
48
star
45

test-plans

Interoperability tests for libp2p
TypeScript
48
star
46

go-libp2p-kbucket

A kbucket implementation for use as a routing table
Go
47
star
47

js-libp2p-switch

[DEPRECATED]: now part of the https://github.com/libp2p/js-libp2p repo
JavaScript
47
star
48

go-libp2p-circuit

Circuit Switching for libp2p
Go
47
star
49

js-libp2p-floodsub

Also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).
TypeScript
47
star
50

go-libp2p-secio

a minimal secure channel for libp2p
Go
44
star
51

go-libp2p-peer

[DEPRECATED] PKI based identities for use in go-libp2p; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
41
star
52

go-libp2p-crypto

[DEPRECATED] Various cryptographic utilities used by libp2p; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
40
star
53

devgrants

want to hack on libp2p? this repo tracks libp2p endeavors eligible for incentivization.
40
star
54

js-libp2p-websocket-star

libp2p-webrtc-star without webrtc. Just plain socket.io.
JavaScript
39
star
55

go-mplex

A port of maxogden's multiplex to go
Go
38
star
56

js-libp2p-webrtc

TypeScript
38
star
57

js-peer-info

libp2p Peer abstraction Node.js implementation
JavaScript
37
star
58

notes

libp2p Collaborative Notebook for Research
37
star
59

interface-transport

⛔️ DEPRECATED: interface-transport is now included in https://github.com/libp2p/js-interfaces
JavaScript
35
star
60

repl

[toy project 🎈] a libp2p interactive shell
Go
34
star
61

website

Webpage of the libp2p project. A multi protocol approach for a interoperable network stack that follows the 'self description' in favor of assumptions
Less
34
star
62

go-stream-muxer

[DEPRECATED] stream multiplexer interface; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
33
star
63

xtp

XTP - eXternal Transports Protocol
33
star
64

go-libp2p-noise

a secure channel for go-libp2p based on the Noise protocol framework
Go
33
star
65

go-libp2p-net

[DEPRECATED] Network interfaces for go-libp2p; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
32
star
66

js-libp2p-secio

libp2p SECIO
JavaScript
30
star
67

js-libp2p-bootstrap

Rail a libp2p node through a bootstrap peer list
TypeScript
30
star
68

go-libp2p-transport

[DEPRECATED] libp2p transport code; moved to https://github.com/libp2p/go-libp2p-core/ and https://github.com/libp2p/go-libp2p-testing/
Go
30
star
69

interface-stream-muxer

⛔️ DEPRECATED: interface-stream-muxer is now included in https://github.com/libp2p/js-interfaces
JavaScript
29
star
70

go-yamux

Go
27
star
71

go-libp2p-relay-daemon

A standalone libp2p circuit relay daemon providing relay service for version v2 of the protocol.
Go
25
star
72

go-libp2p-routing

[DEPRECATED] a collection of routing interfaces for go-libp2p; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
24
star
73

js-libp2p-websocket-star-rendezvous

The rendezvous service for libp2p-websocket-star enabled nodes meet and talk with each other
JavaScript
24
star
74

go-libp2p-gostream

Go "net" wrappers for libp2p
Go
23
star
75

go-libp2p-record

signed records for use with routing systems
Go
22
star
76

go-libp2p-pubsub-router

Go
22
star
77

testlab

A testlab built with Nomad and Consul to analyze the behavior of p2p networks at scale
Go
22
star
78

workspace-go-libp2p

workspace for go-libp2p contributors
Shell
21
star
79

research-dht

Moved discussion notes to https://github.com/libp2p/notes
21
star
80

go-libp2p-connmgr

a resource sentinel that keeps connection count under reasonable bounds
Go
20
star
81

demo-multi-lang

Simple libp2p demos implemented in Go, JS and Rust
Go
20
star
82

js-libp2p-pubsub

Pubsub base protocol for libp2p pubsub routers
TypeScript
19
star
83

js-libp2p-keychain

Key management and cryptographically protected messages
TypeScript
19
star
84

go-libp2p-host

[DEPRECATED] The host interface for go-libp2p; use https://github.com/libp2p/go-libp2p-core/ instead.
Go
19
star
85

go-libp2p-consensus

A consensus interface for LibP2P
Go
19
star
86

go-sockaddr

DEPRECATED - Go Sockaddr -> RawSockaddr conversions
Go
19
star
87

js-libp2p-circuit

[DEPRECATED]: now part of the https://github.com/libp2p/js-libp2p repo
JavaScript
19
star
88

interface-connection

⛔️ DEPRECATED: interface-connection is now included in https://github.com/libp2p/js-interfaces
JavaScript
18
star
89

go-libp2p-transport-upgrader

Go
17
star
90

js-libp2p-record

Implementation of go-libp2p-record in JavaScript
TypeScript
17
star
91

js-libp2p-delegated-peer-routing

Leverage other peers in the network to perform Peer Routing calls.
TypeScript
16
star
92

interop

Interoperability tests for libp2p Implementations
TypeScript
16
star
93

js-peer-book

[DEPRECATED]: peer-book is now at https://github.com/libp2p/js-libp2p/tree/master/src/peer-store as PeerStore
JavaScript
16
star
94

go-libp2p-tls

go-libp2p's TLS encrypted transport
Go
16
star
95

js-libp2p-daemon

A js-libp2p backed daemon
TypeScript
15
star
96

go-libp2p-coral-dht

golang implementation of the CoralDHT protocol
Go
15
star
97

js-libp2p-webtransport

WebTranport module that libp2p uses and that implements the interface-transport spec
TypeScript
15
star
98

go-eventbus

a simple and fast eventbus for type-based local event delivery.
Go
15
star
99

js-libp2p-connection-manager

[DEPRECATED]: now part of the https://github.com/libp2p/js-libp2p repo
JavaScript
14
star
100

cs-libp2p-peer

LibP2P Peer
C#
14
star