What is @libp2p/perf?
main@libp2p/perf service implements the perf protocol. It is used to measure transfer performance within and across different libp2p implementations, allowing developers to benchmark network throughput and latency.repository·main·Indexed 25 days ago
https://github.com/libp2p/js-libp2pA JavaScript implementation of libp2p, a modular peer-to-peer network stack. It provides Prometheus-compatible metrics for monitoring and supports various transports for browser nodes, including WebSockets, WebRTC, and WebTransport. The library includes a suite of packages such as @libp2p/crypto, @libp2p/tls, @libp2p/config, and @libp2p/floodsub, and utilizes Circuit Relays and Delegate Nodes to overcome connectivity limitations in constrained environments.
@libp2p/perf service implements the perf protocol. It is used to measure transfer performance within and across different libp2p implementations, allowing developers to benchmark network throughput and latency.@libp2p/record package provides an implementation of the routing record format used by libp2p to store data in the datastore passed to the libp2p constructor.@libp2p/interface-internal module provides the core internal interfaces and classes that define the fundamental behaviors of libp2p components. It acts as an entry point for internal logic, exporting key management and orchestration components.The @libp2p/webtransport package is a libp2p transport implementation based on the WebTransport API. It implements the interface-transport specification.
Current Capability: It is restricted to dialing-only functionality. Listening for incoming connections is not yet supported due to pending QUIC support in Node.js.
libp2p is a modular networking stack designed to be customized to specific project needs. Configuration allows you to include only the modules required for your application (e.g., specific transports, peer discovery mechanisms, or pubsub implementations).
Important Note: While the top-level API remains consistent regardless of your configuration, attempting to call methods for modules that have not been configured (such as Content Routing) will result in errors.
The AutoNATv2 service implements the AutoNAT v2 protocol. Its purpose is to confirm whether the addresses a node is listening on are dialable by remote peers.
Note: This service does not implement NAT hole punching; it is strictly for reachability confirmation.
@libp2p/gossipsub package implements version v1.1 of the Gossipsub specification.@libp2p/floodsub (also known as pubsub-flood or dumbsub) is a naive implementation of the Publish/Subscribe pattern. It works by broadcasting all messages to all network peers (flooding the network) without forming a CastTree.
Warning: Do not use this in production.
This module is intended for academic purposes only because:
For production use cases, use gossipsub instead, which is a more complete implementation and is compatible with floodsub.
The AutoNAT service implements the AutoNAT protocol to help a node determine if the addresses it is listening on are dialable by remote peers.
Note: This service does not implement NAT hole punching.
Important: @libp2p/autonat-v2 is now available and should be preferred over this module (@libp2p/autonat).
The Identify protocol allows network peers to discover the multiaddrs the current node listens on and the protocols it supports.
Additionally, the identify/push extension allows the node to proactively send updates to all connected peers when its multiaddrs or protocols change. For maximum network compatibility, you should configure both protocols.