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

open

@JvmStatic @JvmOverloads 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 (source)

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

Parameters

keyPair - the key pair identifying the node running the service.

bindAddress - the address to bind the node to.

enrSeq - the sequence of the ENR of the node

bootstrapENRList - the list of other nodes to connect to on bootstrap.

enrStorage - the permanent storage of ENRs. Defaults to an in-memory store.

coroutineContext - the coroutine context associated with the store.

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

Creates a new discovery service with the UDP service provided.

Parameters

bootstrapENRList - the list of other nodes to connect to on bootstrap.

enrStorage - the permanent storage of ENRs. Defaults to an in-memory store.

connector - the UDP service providing network access.

coroutineContext - the coroutine context associated with the store.