devp2p / org.apache.tuweni.devp2p.v5 / DefaultNodeDiscoveryService

DefaultNodeDiscoveryService

class DefaultNodeDiscoveryService : NodeDiscoveryService (source)

Constructors

<init>

DefaultNodeDiscoveryService(bootstrapENRList: List<String>, enrStorage: ENRStorage, connector: UdpConnector, coroutineContext: CoroutineContext = Dispatchers.Default)

Properties

coroutineContext

val coroutineContext: CoroutineContext

Functions

addPeer

suspend fun addPeer(rlpENR: Bytes): Unit

start

Starts the node discovery service.

suspend fun start(): Unit

terminate

Stops the node discovery service.

suspend fun terminate(): Unit

Companion Object Functions

open

Creates a new discovery service, generating the node ENR and configuring the UDP connector.

fun open(keyPair: KeyPair, localPort: Int, bindAddress: InetSocketAddress = InetSocketAddress(localPort), enrSeq: Long = Instant.now().toEpochMilli(), bootstrapENRList: List<String> = emptyList(), enrStorage: ENRStorage = DefaultENRStorage(), coroutineContext: CoroutineContext = Dispatchers.Default): NodeDiscoveryService

Creates a new discovery service with the UDP service provided.

fun open(bootstrapENRList: List<String> = emptyList(), enrStorage: ENRStorage = DefaultENRStorage(), connector: UdpConnector, coroutineContext: CoroutineContext = Dispatchers.Default): NodeDiscoveryService