@libp2p/interface
Version:
The interface implemented by a libp2p node
21 lines (18 loc) • 486 B
text/typescript
import type { PeerId } from './peer-id.ts'
import type { Multiaddr } from '@multiformats/multiaddr'
/**
* A `PeerInfo` is a lightweight object that represents a remote peer, it can be
* obtained from peer discovery mechanisms, HTTP RPC endpoints, etc.
*
* @see https://libp2p.io/docs/peers/#peer-info
*/
export interface PeerInfo {
/**
* The identifier of the remote peer
*/
id: PeerId
/**
* The multiaddrs a peer is listening on
*/
multiaddrs: Multiaddr[]
}