interface DiscoveryService
(source)
An Ethereum ÐΞVp2p discovery service.
This service supports devp2p discovery v4, alongside support for EIP-868. http://eips.ethereum.org/EIPS/eip-868
expiredPackets |
abstract val expiredPackets: Long |
filteredPackets |
abstract val filteredPackets: Long |
invalidPackets |
abstract val invalidPackets: Long |
isShutdown |
abstract val isShutdown: Boolean |
isTerminated |
abstract val isTerminated: Boolean |
localPort |
the UDP port that the service is listening on abstract val localPort: Int |
nodeId |
the node id for this node (i.e. it's public key) abstract val nodeId: PublicKey |
selfPackets |
abstract val selfPackets: Long |
unexpectedENRResponses |
abstract val unexpectedENRResponses: Long |
unexpectedNeighbors |
abstract val unexpectedNeighbors: Long |
unexpectedPongs |
abstract val unexpectedPongs: Long |
unvalidatedPeerPackets |
abstract val unvalidatedPeerPackets: Long |
awaitBootstrap |
Suspend until the bootstrap peers have been reached, or failed. abstract suspend fun awaitBootstrap(): Int |
awaitTermination |
Suspend until this service has terminated. abstract suspend fun awaitTermination(): Unit |
awaitTerminationAsync |
Provide a completion that will complete when the service has terminated. abstract fun awaitTerminationAsync(): AsyncCompletion |
lookup |
Attempt to find a specific peer, or peers close to it. abstract suspend fun lookup(target: PublicKey): List<Peer> |
lookupAsync |
Attempt to find a specific peer, or peers close to it asynchronously. abstract fun lookupAsync(target: PublicKey): AsyncResult<List<Peer>> |
shutdown |
Request shutdown of this service. The service will terminate at a later time (see DiscoveryService.awaitTermination). abstract fun shutdown(): Unit |
shutdownNow |
Shutdown this service immediately. abstract fun shutdownNow(): Unit |
open |
Start the discovery service. fun open(keyPair: KeyPair, port: Int = 0, host: String? = null, seq: Long = Instant.now().toEpochMilli(), enrData: Map<String, Bytes> = emptyMap(), bootstrapURIs: List<URI> = emptyList(), peerRepository: PeerRepository = EphemeralPeerRepository(), advertiseAddress: InetAddress? = null, advertiseUdpPort: Int? = null, advertiseTcpPort: Int? = null, routingTable: PeerRoutingTable = DevP2PPeerRoutingTable(keyPair.publicKey()), packetFilter: ((PublicKey, InetSocketAddress) -> Boolean)? = null, channelGroup: CoroutineChannelGroup = CommonCoroutineGroup, bufferAllocator: () -> ByteBuffer = DEFAULT_BUFFER_ALLOCATOR, timeSupplier: () -> Long = CURRENT_TIME_SUPPLIER): DiscoveryService fun open(keyPair: KeyPair, bindAddress: InetSocketAddress, seq: Long = Instant.now().toEpochMilli(), enrData: Map<String, Bytes> = emptyMap(), bootstrapURIs: List<URI> = emptyList(), peerRepository: PeerRepository = EphemeralPeerRepository(), advertiseAddress: InetAddress? = null, advertiseUdpPort: Int? = null, advertiseTcpPort: Int? = null, routingTable: PeerRoutingTable = DevP2PPeerRoutingTable(keyPair.publicKey()), packetFilter: ((PublicKey, InetSocketAddress) -> Boolean)? = null, channelGroup: CoroutineChannelGroup = CommonCoroutineGroup, bufferAllocator: () -> ByteBuffer = DEFAULT_BUFFER_ALLOCATOR, timeSupplier: () -> Long = CURRENT_TIME_SUPPLIER): DiscoveryService |