Documentation ¶
Index ¶
- type ByName
- type HistoryRequester
- type Peer
- type Registry
- func (r *Registry) Addresses() ([]net.Addr, error)
- func (r *Registry) AppendAddresses(addresses []*net.TCPAddr) int
- func (r *Registry) Broadcast(msg proto.Message)
- func (r *Registry) Close() error
- func (r *Registry) Connections() ([]Peer, error)
- func (r *Registry) FriendlyPeers() ([]Peer, error)
- func (r *Registry) MarkAsHostile(addr net.Addr) error
- func (r *Registry) Peer(addr netip.Addr) (Peer, error)
- func (r *Registry) Peers() ([]Peer, error)
- func (r *Registry) RegisterPeer(addr netip.Addr, np peer.Peer, handshake proto.Handshake) error
- func (r *Registry) SuggestVersion(addr netip.Addr) (proto.Version, error)
- func (r *Registry) TakeAvailableAddresses() ([]netip.AddrPort, error)
- func (r *Registry) UnregisterPeer(addr netip.Addr) error
- func (r *Registry) UpdatePeerScore(addr netip.Addr, score *big.Int) error
- type State
- type VersionProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HistoryRequester ¶
type Peer ¶
type Peer struct { AddressPort netip.AddrPort `json:"address"` Nonce uint64 `json:"nonce"` Name string `json:"name"` Version proto.Version `json:"version"` State State `json:"state"` NextAttempt time.Time `json:"next_attempt"` Score *big.Int `json:"score"` // contains filtered or unexported fields }
func (*Peer) RequestBlock ¶
func (*Peer) RequestBlockIDs ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) AppendAddresses ¶
AppendAddresses adds new addresses to the storage filtering out already known addresses. Function returns the number of newly added addresses.
func (*Registry) Connections ¶
Connections returns the list of active connections.
func (*Registry) FriendlyPeers ¶
func (*Registry) RegisterPeer ¶
func (*Registry) SuggestVersion ¶
SuggestVersion returns the best version possible for the peer on given address.
func (*Registry) TakeAvailableAddresses ¶
TakeAvailableAddresses returns the list of known non-hostile addresses that are not in the list of active connections and not in the list of pending connections.
Click to show internal directories.
Click to hide internal directories.