Registry / networking / libp2p-core

libp2p-core

JSON →
library0.43.2rscratesunverified

Core traits and structs of libp2p

# Cargo.toml [dependencies] libp2p-core = "0.43.2"
INSTALL
IMPORT
SIG · LIBP2P-CORE
L
libp2p-core
networkingrustv0.43.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PeerId
use libp2p_core::PeerId;

Creates a random PeerId.

use libp2p_core::PeerId; fn main() { let peer_id = PeerId::random(); println!("{}", peer_id); }
Debug
Known issues
gotchaRequires async runtime (e.g., tokio) for full functionality.
fix
Add tokio as a dependency and use #[tokio::main] for async tasks.
affects: >=0.40.0
Upgrade
Version history
0.43.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
libp2p-core — cargo add libp2p-core · libregistry