libp2p/js-libp2p là dự án mã nguồn mở trên GitHub với 2.6k sao, viết chủ yếu bằng TypeScript. A JavaScript Implementation of libp2p networking stack.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
The JavaScript implementation of the libp2p Networking Stack
[!NOTE]
Are you trying to upgrade libp2p to the latest version? Check out the migration guides for any changes you need to make.
Project status
This project has been used in production for years in Ethereum, IPFS, and more. It is actively maintained by multiple organizations and continues to be improved! The API might change, but we strictly follow semver.
The documentation in the main 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.
[!TIP]
Just trying to figure out what this is all about? Check our GETTING_STARTED.md guide and examples.
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:
libp2p.io
libp2p.io/docs
Specification (WIP)
Discussion Forums
ProtoSchool: Introduction to libp2p
libp2p Connectivity Matrix
Universal Connectivity Demo
Talks
libp2p <3 ethereum at DEVCON2
Articles
The overview of libp2p
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 upgradability. 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/main/ROADMAP.md
It represents current projects the js-libp2p maintainers are focused on and provides an estimation of completion targets.
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 repo that will guide you through using libp2p for several scenarios.
Structure
/doc Docs for libp2p
/interop Multidimensional Interop Test
/packages/connection-encrypter-noise Noise libp2p handshake for js-libp2p
/packages/crypto Crypto primitives for libp2p
/packages/interface The interface implemented by a libp2p node
/packages/interface-compliance-tests Compliance tests for JS libp2p interfaces
/packages/interface-internal Interfaces implemented by internal libp2p components
/packages/kad-dht JavaScript implementation of the Kad-DHT for libp2p
/packages/keychain Key management and cryptographically protected messages
/packages/libp2p JavaScript implementation of libp2p, a modular peer to peer network stack
/packages/logger A logging component for use in js-libp2p modules
/packages/metrics-prometheus Collect libp2p metrics for scraping by Prometheus or Graphana
/packages/multistream-select JavaScript implementation of multistream-select
/packages/peer-collections Stores values against a peer id
/packages/peer-discovery-bootstrap Peer discovery via a list of bootstrap peers
/packages/peer-discovery-mdns Node.js libp2p mDNS discovery implementation for peer discovery
/packages/peer-id Implementation of @libp2p/interface-peer-id
/packages/peer-record Used to transfer signed peer data across the network
/packages/peer-store Stores information about peers libp2p knows on the network
/packages/protocol-echo Implementation of an Echo protocol
/packages/protocol-perf Implementation of the Perf protocol
/packages/floodsub 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).
/packages/record libp2p record implementation
/packages/stream-multiplexer-mplex JavaScript implementation of https://github.com/libp2p/mplex
/packages/stream-multiplexer-yamux Yamux stream multiplexer for libp2p
/packages/transport-tcp A TCP transport for libp2p
/packages/transport-webrtc A libp2p transport using WebRTC connections
/packages/transport-websockets JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec
/packages/transport-webtransport JavaScript implementation of the WebTransport module that libp2p uses and that implements the interface-transport spec
/packages/utils Package to aggregate shared logic and dependencies for the libp2p ecosystem
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 tests
> 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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/libp2p/js-libp2p là nguồn chính thức.
libp2p/js-libp2p có bao nhiêu sao?
libp2p/js-libp2p có 2.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/libp2p/js-libp2p. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
libp2p/js-libp2p có những chủ đề gì?
GitHub topics của libp2p/js-libp2p: "ipfs", "js-ipfs", "libp2p", "networking-stack", "p2p". TopGit xếp repo vào nhóm mã nguồn mở.
libp2p/js-libp2p có phải mã nguồn mở không?
Có — libp2p/js-libp2p phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/libp2p/js-libp2p.
libp2p/js-libp2p có trang demo không?
Dự án có trang chủ ở https://libp2p.github.io/js-libp2p/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
libp2p/js-libp2p còn đang phát triển không?
Commit gần nhất trên libp2p/js-libp2p là 1 ngày trước (theo timestamp GitHub). Repo có 560 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
js-libp2p có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về js-libp2p.