tuweni / org.apache.tuweni.stratum.server / Stratum1EthProxyProtocol

Stratum1EthProxyProtocol

class Stratum1EthProxyProtocol : StratumProtocol (source)

Implementation of the stratum1+tcp protocol.

This protocol allows miners to submit EthHash solutions over a persistent TCP connection.

Constructors

<init>

Implementation of the stratum1+tcp protocol.

Stratum1EthProxyProtocol(submitCallback: (PoWSolution) -> Boolean, seedSupplier: () -> Bytes32, hashrateCallback: (Bytes, Long) -> Boolean)

Functions

canHandle

Checks if the protocol can handle a TCP connection, based on the initial message.

fun canHandle(initialMessage: String, conn: StratumConnection): Boolean

handle

Handle a message over an established Stratum connection

fun handle(conn: StratumConnection, message: String): Unit

handleHashrateSubmit

fun handleHashrateSubmit(mapper: JsonMapper, conn: StratumConnection, message: JsonRpcRequest): Unit

onClose

Callback when a stratum connection is closed.

fun onClose(conn: StratumConnection): Unit

setCurrentWorkTask

Sets the current proof-of-work job.

fun setCurrentWorkTask(input: PoWInput): Unit