com.r3corda.node.services.transactions / NotaryService

NotaryService

abstract class NotaryService : AbstractNodeService

A Notary service acts as the final signer of a transaction ensuring two things:

This is the base implementation that can be customised with specific Notary transaction commit protocol.





Types

Type object Type : ServiceType

Constructors

<init> NotaryService(services: ServiceHubInternal, timestampChecker: TimestampChecker, uniquenessProvider: UniquenessProvider)

A Notary service acts as the final signer of a transaction ensuring two things:

Properties

logger abstract val logger: <ERROR CLASS>
protocolFactory abstract val protocolFactory: Factory

Implement a factory that specifies the transaction commit protocol for the notary service to use

timestampChecker val timestampChecker: TimestampChecker
uniquenessProvider val uniquenessProvider: UniquenessProvider

Inherited Properties

net val net: MessagingServiceInternal
services val services: ServiceHubInternal

Inherited Functions

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

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. If you just want a simple acknowledgement response with no content, use com.r3corda.core.messaging.Ack.

fun <Q : ServiceRequestMessage, R : Any> addMessageHandler(topic: String, handler: (Q) -> R): MessageHandlerRegistration

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. If you just want a simple acknowledgement response with no content, use com.r3corda.core.messaging.Ack.

addProtocolHandler fun <H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, protocolFactory: (H) -> ProtocolLogic<R>, onResultFuture: (<ERROR CLASS><R>, H) -> Unit): Unit

Register a handler to kick-off a protocol when a HandshakeMessage is received by the node. This performs the necessary steps to enable communication between the two protocols, including calling ProtocolLogic.registerSession.

fun <H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, protocolFactory: (H) -> ProtocolLogic<R>): Unit

Inheritors

SimpleNotaryService class SimpleNotaryService : NotaryService

A simple Notary service that does not perform transaction validation

ValidatingNotaryService class ValidatingNotaryService : NotaryService

A Notary service that validates the transaction chain of he submitted transaction before committing it