tuweni / org.apache.tuweni.devp2p.v5 / Scraper

Scraper

class Scraper : CoroutineScope (source)

Discovery scraper that will continue asking peers for peers, and iterate over them, until told to stop.

The scraper sends events of discoveries to listeners.

Constructors

<init>

Discovery scraper that will continue asking peers for peers, and iterate over them, until told to stop.

Scraper(coroutineContext: CoroutineContext = Executors.newFixedThreadPool(100).asCoroutineDispatcher(), vertx: Vertx = Vertx.vertx(), initialENRs: List<EthereumNodeRecord>, bindAddress: InetSocketAddress, listeners: List<(EthereumNodeRecord, List<EthereumNodeRecord>) -> Unit>, maxWaitForNewPeers: Long = 20, waitBetweenScrapes: Long = 5 * 60)

Properties

bindAddress

val bindAddress: InetSocketAddress

coroutineContext

val coroutineContext: CoroutineContext

initialENRs

val initialENRs: List<EthereumNodeRecord>

listeners

val listeners: List<(EthereumNodeRecord, List<EthereumNodeRecord>) -> Unit>

maxWaitForNewPeers

val maxWaitForNewPeers: Long

vertx

val vertx: Vertx

waitBetweenScrapes

val waitBetweenScrapes: Long

Functions

discover

fun discover(maxWaitForNewPeers: Long): Deferred<Unit>

start

fun start(): Deferred<Unit>

stop

fun stop(): Deferred<Unit>