core/certified_addr_book library

CertifiedAddrBook manages signed peer records and "self-certified" addresses contained within them. Use this interface with an AddrBook.

To test whether a given AddrBook / Peerstore implementation supports certified addresses, callers should use the GetCertifiedAddrBook helper or type-assert on the CertifiedAddrBook interface:

if (addrBook is CertifiedAddrBook) { (addrBook as CertifiedAddrBook).consumePeerRecord(signedPeerRecord, ttl); }

Classes

CertifiedAddrBook
Envelope contains a signed payload produced by a peer. This is a placeholder for the actual Envelope class that would be defined in the record module. When the record module is implemented, this should be replaced with the actual Envelope class.

Functions

getCertifiedAddrBook(dynamic ab) → (bool, CertifiedAddrBook?)
GetCertifiedAddrBook is a helper to "upcast" an AddrBook to a CertifiedAddrBook by using type assertion. If the given AddrBook is also a CertifiedAddrBook, it will be returned, and the ok return value will be true. Returns (null, false) if the AddrBook is not a CertifiedAddrBook.