Documentation ¶
Overview ¶
Package mop exposes the data structure and operations necessary on the mop.Address type which used in the handshake protocol, address-book and hive protocol.
Package address provides persisted mapping between overlay (topology) address and mop.Address address, which contains underlay (physical) address. The underlay address contains both physical and p2p addresses.
It is single point of truth about known peers and relations of their overlay and underlay addresses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAddress = errors.New("invalid address")
var ErrNotFound = errors.New("address: not found")
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Underlay ma.Multiaddr Overlay cluster.Address Signature []byte Transaction []byte BSCAddress []byte }
Address represents the mop address in cluster. It consists of a peers underlay (physical) address, overlay (topology) address and signature. Signature is used to verify the `Overlay/Underlay` pair, as it is based on `underlay|networkID`, signed with the public key of Overlay address
func NewAddress ¶
func ParseAddress ¶
func (*Address) MarshalJSON ¶
func (*Address) ShortString ¶
ShortString returns shortened versions of mop address in a format: [Overlay, Underlay] It can be used for logging
func (*Address) UnmarshalJSON ¶
type Interface ¶
type Interface interface { GetPutter Remover // Overlays returns a list of all overlay addresses saved in address. Overlays() ([]cluster.Address, error) // IterateOverlays exposes overlays in a form of an iterator. IterateOverlays(func(cluster.Address) (bool, error)) error // Addresses returns a list of all Address-es saved in address. Addresses() ([]Address, error) }
Interface is the AddressBook interface.