tuweni / org.apache.tuweni.ethclient / EthereumPeerRepository

EthereumPeerRepository

interface EthereumPeerRepository : PeerRepository (source)

A peer repository of peers implementing the eth subprotocol.

Functions

activeConnections

Provides a stream of active connections.

abstract fun activeConnections(): Stream<EthereumConnection>

addIdentityListener

Adds a listener to be called when a new peer connects

abstract fun addIdentityListener(identityListener: (Identity) -> Unit): String

addStatusListener

Adds a listener to be called when a status message is received

abstract fun addStatusListener(statusListener: (EthereumConnection) -> Unit): String

removeIdentityListener

Removes an identity listener

abstract fun removeIdentityListener(id: String): Unit

removeStatusListener

Removes a status listener

abstract fun removeStatusListener(id: String): Unit

storeStatus

Stores the status message sent for a connection

abstract fun storeStatus(connId: String, status: Status): Unit

Inheritors

MemoryEthereumPeerRepository

Memory-backed Ethereum peer repository.

class MemoryEthereumPeerRepository : EthereumPeerRepository