interface Peer
(source)
An Ethereum P2P network peer.
abstract val endpoint: Endpoint?
The endpoint for communicating with this peer, if known. |
|
abstract val enr: EthereumNodeRecord?
The Ethereum Node Record associated with the peer, if known. |
|
abstract val lastSeen: Long?
The time this peer was last seen at its current endpoint, in milliseconds since the epoch. |
|
abstract val lastVerified: Long?
The last time the current endpoint of this peer was verified, in milliseconds since the epoch. |
|
abstract val nodeId: PublicKey
The nodeId for this peer. |
abstract fun getEndpoint(ifVerifiedOnOrAfter: Long): Endpoint?
Get the endpoint for this peer, if it has been verified on or after a specified time. |
|
abstract fun seenAt(time: Long): Unit
Set the lastSeen time to the current time. |
|
abstract fun updateENR(record: EthereumNodeRecord, time: Long): Unit
Update the peer's ENR. |
|
abstract fun updateEndpoint(endpoint: Endpoint, time: Long, ifVerifiedBefore: Long? = null): Endpoint
Update the peer with a new endpoint. |
|
abstract fun verifyEndpoint(endpoint: Endpoint, time: Long): Boolean
Set the lastVerified and lastSeen time to the provided time, if the endpoint matches. |