Peer class

Interface for PeerNetwork element providing Peer API.



Peer(PeerPreference spec)
Create Peer fully specified by PeerPreference.


address String
URI for Peer.
connectTimer Timer
Timer to reconnection this Peer. Unused with PeerNetwork reconnect.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
maxOutstanding int
read / write
minAmount num
The minimum Transaction.amount that the network allows.
minFee num
The minimum Transaction.fee that the network allows.
numOutstanding int
Number of in-flight queries.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
spec PeerPreference
The persisted record defining this Peer.
read / write
state PeerState
The connection state of this Peer.
read / write
stateChanged PeerStateChangedCallback
Sends subscriber updates on state change.
read / write
throttleQueue Queue<Completer<void>>
Queue of subscribers waiting for numOutstanding to decrease.
read / write
tipChanged VoidCallback
Notifies that a new Block was mined.
read / write
tipHeight int
BlockHeader.height of the most recently mined Block.
tipId BlockId
BlockId of the most recently mined Block.


close() → void
Disconnect and reset. Idempotent.
connect() → void
Connect the Peer. e.g. with WebSocket.connect.
connectAfter(int seconds) → void
Restart connectTimer that eventually will connect.
disconnect(String reason) → void
Disconnect the Peer. e.g. with WebSocket.close.
dispatchFromThrottleQueue() → void
Dequeue as much of throttleQueue as we can.
failThrottleQueue() → void
Complete throttleQueue with null and discard it.
filterAdd(PublicAddress address, TransactionCallback transactionCb) Future<bool>
Subscribes transactionCb to updates on Transaction involving address.
filterTransactionQueue() Future<bool>
Filters uncomfirmed transactions for the fitlerAdd() set.
getBalance(PublicAddress address) Future<num>
Retrieves address' spendable balance.
getBlock({BlockId id, int height}) Future<BlockMessage>
Returns the Block with id or height.
getBlockHeader({BlockId id, int height}) Future<BlockHeaderMessage>
Returns the BlockHeader with id or height.
getTransaction(TransactionId id) Future<TransactionMessage>
Returns the Transaction with id.
getTransactions(PublicAddress address, TransactionIterator iterator, {int limit}) Future<TransactionIteratorResults>
Iterates address' transactions by height.
handleProtocol(VoidCallback cb) → void
Context for handling received messages.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
putTransaction(Transaction transaction) Future<TransactionId>
Adds transaction to the network.
setState(PeerState x) → void
The StateSetter for PeerState.
throttle() Future<Peer>
Keep a Queue after maxOutstanding in-flight queries.
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]