ChainTipTracker class

Tracks blockchain tips across multiple peers for SPV clients

Constructors

ChainTipTracker({ChainTipTrackerConfig? config, Logger? logger})

Properties

activePeerCount int
Number of active peers providing tips
no setter
bestTip ChainTip?
Current best chain tip across all peers
no setter
config ChainTipTrackerConfig
final
hashCode int
The hash code for this object.
no setterinherited
isLikelySynced bool
Check if we're likely synced with the network
no setter
isPotentialReorg bool
Check if there's a potential reorganization happening
no setter
logger → Logger
final
networkHeight int
Current network height (best tip height)
no setter
potentialReorgs List<Map<String, dynamic>>
Get details about potential reorganizations
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statistics Map<String, dynamic>
Statistics about tracker performance
no setter
tipEvents Stream<ChainTipEvent>
Events when chain tip changes
no setter

Methods

getBestPeers() List<String>
Get peers sorted by chain height (best first)
handleBlockAnnouncement(String peerId, Hash blockHash) → void
Handle block announcement from inv message
handleHeaders(String peerId, MsgHeaders headers) → void
Handle headers response
handleVersion(String peerId, MsgVersion version) → void
Handle version message (contains startHeight)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerPeer(String peerId) → void
Register a peer connection
shutdown() Future<void>
Shutdown the tracker
toString() String
A string representation of this object.
inherited
unregisterPeer(String peerId) → void
Unregister a peer and clean up its data
updatePeerTip(String peerId, Hash blockHash, int height, ChainTipSource source) → void
Update peer's chain tip from any source

Operators

operator ==(Object other) bool
The equality operator.
inherited