tuweni / org.apache.tuweni.eth.crawler / RelationalPeerRepository

RelationalPeerRepository

open class RelationalPeerRepository : CoroutineScope, PeerRepository (source)

Constructors

<init>

RelationalPeerRepository(dataSource: DataSource, expiration: Long = 5 * 60 * 1000, clientIdsInterval: Long = 24 * 60 * 60 * 1000 * 2, clientsStatsDelay: Long = 30 * 1000, meter: Meter, coroutineContext: CoroutineContext = Dispatchers.Default)

Properties

coroutineContext

open val coroutineContext: CoroutineContext

Functions

addListener

Adds a listener to the repository, which will consume peer entries whenever they are added to the repository.

open fun addListener(listener: (Peer) -> Unit): Unit

get

Get a Peer based on a URI components.

open suspend fun get(host: String, port: Int, nodeId: PublicKey): Peerfun get(nodeId: PublicKey, endpoint: Endpoint): Peer

Get a Peer based on a URI.

open suspend fun get(uri: URI): Peer

getAsync

Get a Peer based on a URI.

open fun getAsync(uri: URI): AsyncResult<Peer>

Get a Peer based on a URI string.

open fun getAsync(uri: String): AsyncResult<Peer>

recordInfo

fun recordInfo(wireConnection: WireConnection, status: Status?): Unit

start

fun start(): Unit

stop

suspend fun stop(): Unit

Companion Object Properties

londonClientVersions

val londonClientVersions: MutableMap<String, String>