AddressBook class final
The peers a node knows: self signed records saying where each validator is reached and which keys authenticate it. add is the trusted local path; merge is the peer exchange boundary, which verifies every record and never overwrites a known id. Encoded books are canonical, so two nodes that learned the same peers hold byte identical books.
- Implemented types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isReleased → bool
-
Whether the native handle has already been released.
no setterinherited
- length → int
-
How many peers are known.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
Uint8List record) → void - Trusted insert of an encoded record (AviaryPeering.signPeerRecord). Throws with AviaryStatus.badInput on a malformed record.
-
contains(
int id) → bool -
Whether
idis known. -
encode(
) → Uint8List - The canonical encoding, to send to a peer or persist.
-
free(
) → void - Releases the native book.
-
merge(
Uint8List encodedBook) → int - Learns the verified records of an encoded book that are not yet known and returns how many were added. Throws when the book does not decode.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
record(
int id) → Uint8List? -
The encoded record for
id, or null when the id is unknown. -
records(
) → List< Uint8List> - Every encoded record in ascending id order.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited