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 ExtendedPeerstore ¶
type ExtendedPeerstore interface {
TeedDatastore
Datastore() ds.Batching
peerstore.Peerstore
StatusBook
MetadataBook
ENRBook
AllDataGetter
}
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 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 *types.AttnetBits `json:"enr_attnets,omitempty"`
// Metadata with highest sequence number
MetaData *methods.MetaData `json:"metadata,omitempty"`
// Highest claimed seq nr, we may not have the actual corresponding metadata yet.
ClaimedSeq methods.SeqNr `json:"claimed_seq,omitempty"`
// Latest status
Status *methods.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 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)
}
Click to show internal directories.
Click to hide internal directories.