peers

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWakuPeerstore

func NewWakuPeerstore(p peerstore.Peerstore) peerstore.Peerstore

Types

type ConnectionFailures

type ConnectionFailures struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Origin

type Origin int64
const (
	Unknown Origin = iota
	Discv5
	Static
	PeerExchange
	DnsDiscovery
	Rendezvous
)

type WakuPeerstore

type WakuPeerstore interface {
	SetOrigin(p peer.ID, origin Origin) error
	Origin(p peer.ID, origin Origin) (Origin, error)
	PeersByOrigin(origin Origin) peer.IDSlice
	SetENR(p peer.ID, enr *enode.Node) error
	ENR(p peer.ID, origin Origin) (*enode.Node, error)
	AddConnFailure(p peer.AddrInfo)
	ResetConnFailures(p peer.AddrInfo)
	ConnFailures(p peer.AddrInfo) int
}

type WakuPeerstoreImpl

type WakuPeerstoreImpl struct {
	// contains filtered or unexported fields
}

func (*WakuPeerstoreImpl) AddAddr

func (ps *WakuPeerstoreImpl) AddAddr(p peer.ID, addr ma.Multiaddr, ttl time.Duration)

func (*WakuPeerstoreImpl) AddAddrs

func (ps *WakuPeerstoreImpl) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duration)

func (*WakuPeerstoreImpl) AddConnFailure

func (ps *WakuPeerstoreImpl) AddConnFailure(p peer.AddrInfo)

func (*WakuPeerstoreImpl) AddPrivKey

func (ps *WakuPeerstoreImpl) AddPrivKey(p peer.ID, privk ic.PrivKey) error

func (*WakuPeerstoreImpl) AddProtocols

func (ps *WakuPeerstoreImpl) AddProtocols(p peer.ID, proto ...protocol.ID) error

func (*WakuPeerstoreImpl) AddPubKey

func (ps *WakuPeerstoreImpl) AddPubKey(p peer.ID, pubk ic.PubKey) error

func (*WakuPeerstoreImpl) AddrStream

func (ps *WakuPeerstoreImpl) AddrStream(ctx context.Context, p peer.ID) <-chan ma.Multiaddr

func (*WakuPeerstoreImpl) Addrs

func (ps *WakuPeerstoreImpl) Addrs(p peer.ID) []ma.Multiaddr

func (*WakuPeerstoreImpl) ClearAddrs

func (ps *WakuPeerstoreImpl) ClearAddrs(p peer.ID)

func (*WakuPeerstoreImpl) Close

func (ps *WakuPeerstoreImpl) Close() error

func (*WakuPeerstoreImpl) ConnFailures

func (ps *WakuPeerstoreImpl) ConnFailures(p peer.AddrInfo) int

func (*WakuPeerstoreImpl) ConsumePeerRecord

func (ps *WakuPeerstoreImpl) ConsumePeerRecord(s *record.Envelope, ttl time.Duration) (accepted bool, err error)

func (*WakuPeerstoreImpl) ENR

func (ps *WakuPeerstoreImpl) ENR(p peer.ID, origin Origin) (*enode.Node, error)

func (*WakuPeerstoreImpl) FirstSupportedProtocol

func (ps *WakuPeerstoreImpl) FirstSupportedProtocol(p peer.ID, proto ...protocol.ID) (protocol.ID, error)

func (*WakuPeerstoreImpl) Get

func (ps *WakuPeerstoreImpl) Get(p peer.ID, key string) (interface{}, error)

func (*WakuPeerstoreImpl) GetPeerRecord

func (ps *WakuPeerstoreImpl) GetPeerRecord(p peer.ID) *record.Envelope

GetPeerRecord returns a Envelope containing a PeerRecord for the given peer id, if one exists. Returns nil if no signed PeerRecord exists for the peer.

func (*WakuPeerstoreImpl) GetProtocols

func (ps *WakuPeerstoreImpl) GetProtocols(p peer.ID) ([]protocol.ID, error)

func (*WakuPeerstoreImpl) LatencyEWMA

func (ps *WakuPeerstoreImpl) LatencyEWMA(p peer.ID) time.Duration

func (*WakuPeerstoreImpl) Origin

func (ps *WakuPeerstoreImpl) Origin(p peer.ID, origin Origin) (Origin, error)

func (*WakuPeerstoreImpl) PeerInfo

func (ps *WakuPeerstoreImpl) PeerInfo(peerID peer.ID) peer.AddrInfo

func (*WakuPeerstoreImpl) Peers

func (ps *WakuPeerstoreImpl) Peers() peer.IDSlice

func (*WakuPeerstoreImpl) PeersByOrigin

func (ps *WakuPeerstoreImpl) PeersByOrigin(origin Origin) peer.IDSlice

func (*WakuPeerstoreImpl) PeersWithAddrs

func (ps *WakuPeerstoreImpl) PeersWithAddrs() peer.IDSlice

func (*WakuPeerstoreImpl) PeersWithKeys

func (ps *WakuPeerstoreImpl) PeersWithKeys() peer.IDSlice

func (*WakuPeerstoreImpl) PrivKey

func (ps *WakuPeerstoreImpl) PrivKey(p peer.ID) ic.PrivKey

func (*WakuPeerstoreImpl) PubKey

func (ps *WakuPeerstoreImpl) PubKey(p peer.ID) ic.PubKey

func (*WakuPeerstoreImpl) Put

func (ps *WakuPeerstoreImpl) Put(p peer.ID, key string, val interface{}) error

func (*WakuPeerstoreImpl) RecordLatency

func (ps *WakuPeerstoreImpl) RecordLatency(p peer.ID, t time.Duration)

func (*WakuPeerstoreImpl) RemovePeer

func (ps *WakuPeerstoreImpl) RemovePeer(p peer.ID)

func (*WakuPeerstoreImpl) RemoveProtocols

func (ps *WakuPeerstoreImpl) RemoveProtocols(p peer.ID, proto ...protocol.ID) error

func (*WakuPeerstoreImpl) ResetConnFailures

func (ps *WakuPeerstoreImpl) ResetConnFailures(p peer.AddrInfo)

func (*WakuPeerstoreImpl) SetAddr

func (ps *WakuPeerstoreImpl) SetAddr(p peer.ID, addr ma.Multiaddr, ttl time.Duration)

func (*WakuPeerstoreImpl) SetAddrs

func (ps *WakuPeerstoreImpl) SetAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duration)

func (*WakuPeerstoreImpl) SetENR

func (ps *WakuPeerstoreImpl) SetENR(p peer.ID, enr *enode.Node) error

func (*WakuPeerstoreImpl) SetOrigin

func (ps *WakuPeerstoreImpl) SetOrigin(p peer.ID, origin Origin) error

func (*WakuPeerstoreImpl) SetProtocols

func (ps *WakuPeerstoreImpl) SetProtocols(p peer.ID, proto ...protocol.ID) error

func (*WakuPeerstoreImpl) SupportsProtocols

func (ps *WakuPeerstoreImpl) SupportsProtocols(p peer.ID, proto ...protocol.ID) ([]protocol.ID, error)

func (*WakuPeerstoreImpl) UpdateAddrs

func (ps *WakuPeerstoreImpl) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration)

Jump to

Keyboard shortcuts

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