tuweni / org.apache.tuweni.ethstats / EthStatsReporter

EthStatsReporter

class EthStatsReporter : CoroutineScope (source)

ETHNetStats reporting service.

Parameters

vertx - a Vert.x instance, externally managed.

id - the id of the ethstats reporter for communications

ethstatsServerURIs - the URIs to connect to eth-netstats, such as ws://www.ethnetstats.org:3000/api. URIs are tried in sequence, and the first one to work is used.

secret - the secret to use when we connect to eth-netstats

name - the name of the node to be reported in the UI

node - the node name to be reported in the UI

port - the devp2p port exposed by this node

network - the network id

protocol - the version of the devp2p eth subprotocol, such as eth/63

os - the operating system on which the node runs

osVer - the version of the OS on which the node runs

historyRequester - a hook for ethstats to request block information by number.

timeSupplier - a function supplying time in milliseconds since epoch.

coroutineContext - the coroutine context of the reporter.

Constructors

<init>

ETHNetStats reporting service.

EthStatsReporter(vertx: Vertx, id: String, ethstatsServerURIs: List<URI>, secret: String, name: String, node: String, port: Int, network: String, protocol: String, os: String, osVer: String, historyRequester: (List<UInt256>) -> Unit, timeSupplier: () -> Instant, coroutineContext: CoroutineContext = Dispatchers.Default)

Properties

coroutineContext

the coroutine context of the reporter.

val coroutineContext: CoroutineContext

nodeInfo

val nodeInfo: NodeInfo

Functions

sendHistoryResponse

fun sendHistoryResponse(blocks: List<BlockStats>): Unit

sendNewHead

fun sendNewHead(newBlockStats: BlockStats): Unit

sendNewNodeStats

fun sendNewNodeStats(nodeStats: NodeStats): Unit

sendNewPendingTransactionCount

fun sendNewPendingTransactionCount(txCount: Int): Unit

start

suspend fun start(): Unit

stop

suspend fun stop(): Unit

Companion Object Properties

DELAY

const val DELAY: Long

logger

val logger: Logger!

mapper

val mapper: ObjectMapper

PING_PERIOD

const val PING_PERIOD: Long

REPORTING_PERIOD

const val REPORTING_PERIOD: Long