peerstore

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2021 License: MIT, MIT Imports: 7 Imported by: 0

README

go-libp2p-peerstore

GoDoc Coverage Status Build Status Discourse posts

An object to manage peers, their addresses, and other metadata about them.

Install

go get github.com/libp2p/go-libp2p-peerstore

Usage

Check out the GoDocs.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT


The last gx published version of this module was: 2.0.19: QmaCTz9RkrU13bm9kMB54f7atgqM4qkjDZpRwRoJiWXEqs

Documentation

Index

Constants

View Source
const (
	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.PermanentAddrTTL instead.
	PermanentAddrTTL = core.PermanentAddrTTL

	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.ConnectedAddrTTL instead.
	ConnectedAddrTTL = core.ConnectedAddrTTL
)

Variables

View Source
var (
	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.AddressTTL instead.
	AddressTTL = core.AddressTTL

	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.TempAddrTTL instead.
	TempAddrTTL = core.TempAddrTTL

	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.ProviderAddrTTL instead.
	ProviderAddrTTL = core.ProviderAddrTTL

	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.RecentlyConnectedAddrTTL instead.
	RecentlyConnectedAddrTTL = core.RecentlyConnectedAddrTTL

	// Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.OwnObservedAddrTTL instead.
	OwnObservedAddrTTL = core.OwnObservedAddrTTL
)
View Source
var ErrInvalidAddr = core.ErrInvalidAddr

Deprecated: use github.com/libp2p/go-libp2p-core/peer.ErrInvalidAddr instead.

View Source
var ErrNotFound = core.ErrNotFound

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.ErrNotFound instead.

View Source
var LatencyEWMASmoothing = 0.1

LatencyEWMASmooting governs the decay of the EWMA (the speed at which it changes). This must be a normalized (0-1) value. 1 is 100% change, 0 is no change.

Functions

func InfoFromP2pAddr deprecated

func InfoFromP2pAddr(m ma.Multiaddr) (*core.AddrInfo, error)

Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfoFromP2pAddr instead.

func InfoToP2pAddrs deprecated

func InfoToP2pAddrs(pi *core.AddrInfo) ([]ma.Multiaddr, error)

Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfoToP2pAddrs instead.

func NewMetrics

func NewMetrics() *metrics

func NewPeerstore

NewPeerstore creates a data structure that stores peer data, backed by the supplied implementations of KeyBook, AddrBook and PeerMetadata. Deprecated: use pstoreds.NewPeerstore or peerstoremem.NewPeerstore instead.

func PeerInfoIDs

func PeerInfoIDs(pis []peer.AddrInfo) peer.IDSlice

func PeerInfos

func PeerInfos(ps pstore.Peerstore, peers peer.IDSlice) []peer.AddrInfo

Types

type AddrBook deprecated

type AddrBook = core.AddrBook

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.AddrBook instead.

type KeyBook deprecated

type KeyBook = core.KeyBook

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.KeyBook instead.

type Metrics deprecated

type Metrics = core.Metrics

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.Metrics instead.

type PeerInfo deprecated

type PeerInfo = core.AddrInfo

Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfo instead.

type PeerMetadata deprecated

type PeerMetadata = core.PeerMetadata

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.PeerMetadata instead.

type Peerstore deprecated

type Peerstore = core.Peerstore

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.Peerstore instead.

type ProtoBook deprecated

type ProtoBook = core.ProtoBook

Deprecated: use github.com/libp2p/go-libp2p-core/peerstore.ProtoBook instead.

Directories

Path Synopsis
Package addr provides utility functions to handle peer addresses.
Package addr provides utility functions to handle peer addresses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL