core.node.services / NodeTimestamperService

NodeTimestamperService

class NodeTimestamperService : AbstractNodeService

This class implements the server side of the timestamping protocol, using the local clock. A future version might add features like checking against other NTP servers to make sure the clock hasnt drifted by too much.

See the doc site to learn more about timestamping authorities (nodes) and the role they play in the data model.





Constructors

<init> NodeTimestamperService(net: MessagingService, identity: Party, signingKey: KeyPair, clock: Clock = Clock.systemDefaultZone(), tolerance: Duration = 30.seconds)

This class implements the server side of the timestamping protocol, using the local clock. A future version might add features like checking against other NTP servers to make sure the clock hasnt drifted by too much.

Properties

clock val clock: Clock
identity val identity: Party
signingKey val signingKey: KeyPair
tolerance val tolerance: Duration

Inherited Properties

net val net: MessagingService

Functions

processRequest fun processRequest(req: Request): LegallyIdentifiable

Inherited Functions

addMessageHandler fun <Q : AbstractRequestMessage, R : Any> addMessageHandler(topic: String, handler: (Q) -> R, exceptionConsumer: (Message, Exception) -> Unit): Unit

Register a handler for a message topic. In comparison to using net.addMessageHandler() this manages a lot of common boilerplate code. Exceptions are caught and passed to the provided consumer.

fun <Q : AbstractRequestMessage, R : Any> addMessageHandler(topic: String, handler: (Q) -> R): Unit

Register a handler for a message topic. In comparison to using net.addMessageHandler() this manages a lot of common boilerplate code. Exceptions are propagated to the messaging layer.

Companion Object Properties

TIMESTAMPING_PROTOCOL_TOPIC val TIMESTAMPING_PROTOCOL_TOPIC: String