track

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllDataGetter

type AllDataGetter interface {
	GetAllData(id peer.ID) *PeerAllData
}

type DynamicPeerstore

type DynamicPeerstore interface {
	ExtendedPeerstore
	// Initialized if the peerstore is ready for use
	Initialized() bool
	// The current ID of the store, may be empty
	PeerstoreID() PeerstoreID
	// Replace the store.
	// If a previous store is available, the local peer details (incl priv key)
	// for the "retainPeer" are copied to the new store.
	// The "retainPeer" is optional.
	Switch(retainPeer peer.ID, id PeerstoreID, newInner ExtendedPeerstore)
}

func NewDynamicPeerstore

func NewDynamicPeerstore() DynamicPeerstore

type ENRBook

type ENRBook interface {
	// Updates the ENR, if it is has a higher sequence number
	UpdateENRMaybe(id peer.ID, n *enode.Node) (updated bool, err error)

	// find the latest enr for the given peer.
	LatestENR(id peer.ID) (n *enode.Node)
}

type IdentifyBook

type IdentifyBook interface {
	ProtocolVersion(id peer.ID) (string, error)
	UserAgent(id peer.ID) (string, error)
}

IdentifyBook exposes the peer libp2p-identify info. Libp2p stores this data in the misc-data book

type MetadataBook

type MetadataBook interface {
	Metadata(peer.ID) *beacon.MetaData
	ClaimedSeq(peer.ID) (seq beacon.SeqNr, ok bool)
	RegisterSeqClaim(id peer.ID, seq beacon.SeqNr) (newer bool)
	RegisterMetaFetch(peer.ID) uint64
	RegisterMetadata(id peer.ID, md beacon.MetaData) (newer bool)
}

type PeerAllData

type PeerAllData struct {
	PeerID peer.ID  `json:"peer_id"`
	NodeID enode.ID `json:"node_id"`
	Pubkey string   `json:"pubkey"`

	Addrs     []string `json:"addrs,omitempty"`
	Protocols []string `json:"protocols,omitempty"`

	Latency time.Duration `json:"latency,omitempty"`

	UserAgent       string `json:"user_agent,omitempty"`
	ProtocolVersion string `json:"protocol_version,omitempty"`

	ForkDigest      *beacon.ForkDigest `json:"enr_fork_digest,omitempty"`
	NextForkVersion *beacon.Version    `json:"enr_next_fork_version,omitempty"`
	NextForkEpoch   *beacon.Epoch      `json:"enr_next_fork_epoch,omitempty"`

	Attnets *beacon.AttnetBits `json:"enr_attnets,omitempty"`

	// Metadata with highest sequence number
	MetaData *beacon.MetaData `json:"metadata,omitempty"`
	// Highest claimed seq nr, we may not have the actual corresponding metadata yet.
	ClaimedSeq beacon.SeqNr `json:"claimed_seq,omitempty"`
	// Latest status
	Status *beacon.Status `json:"status,omitempty"`
	// Latest ENR
	ENR *enode.Node `json:"enr,omitempty"`
}

func (*PeerAllData) String added in v0.2.1

func (p *PeerAllData) String() string

type PeerstoreID

type PeerstoreID string

type Peerstores

type Peerstores interface {
	List() (out []PeerstoreID)
	Find(id PeerstoreID) (pi ExtendedPeerstore, ok bool)
	Create(id PeerstoreID, store ExtendedPeerstore) error
	Remove(id PeerstoreID) (existed bool)
}

type PeerstoresMap

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

func (*PeerstoresMap) Create

func (cs *PeerstoresMap) Create(id PeerstoreID, store ExtendedPeerstore) error

func (*PeerstoresMap) Find

func (cs *PeerstoresMap) Find(id PeerstoreID) (pi ExtendedPeerstore, ok bool)

func (*PeerstoresMap) List

func (cs *PeerstoresMap) List() (out []PeerstoreID)

func (*PeerstoresMap) Remove

func (cs *PeerstoresMap) Remove(id PeerstoreID) (existed bool)

type StatusBook

type StatusBook interface {
	// Status retrieves the peer status, and may be nil if there is no status
	Status(peer.ID) *beacon.Status
	// RegisterStatus updates the status of the peer
	RegisterStatus(peer.ID, beacon.Status)
}

type TeedDatastore added in v0.2.3

type TeedDatastore interface {
	// AddTee registers a tee, and returns true if it was already registered
	AddTee(tee dstee.Tee) (exists bool)
	// RmTee registers a tee, and returns true if it was registered before unregistering it
	RmTee(tee dstee.Tee) (exists bool)
	// ListTees lists all the tees
	ListTees() (out []dstee.Tee)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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