package
0.20.1
Repository: https://github.com/libp2p/go-libp2p-core.git
Documentation: pkg.go.dev

# Functions

AddrInfoFromP2pAddr converts a Multiaddr to an AddrInfo.
AddrInfoFromString builds an AddrInfo from the string representation of a Multiaddr Deprecated: use github.com/libp2p/go-libp2p/core/peer.AddrInfoFromString instead.
AddrInfosFromP2pAddrs converts a set of Multiaddrs to a set of AddrInfos.
AddrInfosToIDs extracts the peer IDs from the passed AddrInfos and returns them in-order.
AddrInfoToP2pAddrs converts an AddrInfo to a list of Multiaddrs.
Decode accepts an encoded peer ID and returns the decoded ID if the input is valid.
Encode encodes a peer ID as a string.
FromCid converts a CID to a peer ID, if possible.
IDFromBytes casts a byte slice to the ID type, and validates the value to make sure it is a multihash.
IDFromPrivateKey returns the Peer ID corresponding to the secret key sk.
IDFromPublicKey returns the Peer ID corresponding to the public key pk.
NewPeerRecord returns a PeerRecord with a timestamp-based sequence number.
PeerRecordFromAddrInfo creates a PeerRecord from an AddrInfo struct.
PeerRecordFromProtobuf creates a PeerRecord from a protobuf PeerRecord struct.
SplitAddr splits a p2p Multiaddr into a transport multiaddr and a peer ID.
TimestampSeq is a helper to generate a timestamp-based sequence number for a PeerRecord.
ToCid encodes a peer ID as a CID of the public key.

# Constants

PeerRecordEnvelopeDomain is the domain string used for peer records contained in a Envelope.

# Variables

AdvancedEnableInlining enables automatically inlining keys shorter than 42 bytes into the peer ID (using the "identity" multihash function).
ErrEmptyPeerID is an error for empty peer ID.
Deprecated: use github.com/libp2p/go-libp2p/core/peer.ErrInvalidAddr instead.
ErrNoPublicKey is an error for peer IDs that don't embed public keys Deprecated: use github.com/libp2p/go-libp2p/core/peer.ErrNoPublicKey instead.
PeerRecordEnvelopePayloadType is the type hint used to identify peer records in a Envelope.

# Type aliases

AddrInfo is a small struct used to pass around a peer with a set of addresses (and later, keys?).
ID is a libp2p peer identity.
IDSlice for sorting peers.
PeerRecord contains information that is broadly useful to share with other peers, either through a direct exchange (as in the libp2p identify protocol), or through a Peer Routing provider, such as a DHT.