com.r3corda.protocols / ValidatingNotaryProtocol

ValidatingNotaryProtocol

class ValidatingNotaryProtocol : Service

A notary commit protocol that makes sure a given transaction is valid before committing it. This does mean that the calling party has to reveal the whole transaction history; however, we avoid complex conflict resolution logic where a party has its input states "blocked" by a transaction from another party, and needs to establish whether that transaction was indeed valid.



Constructors

<init> ValidatingNotaryProtocol(otherSide: Party, sessionIdForSend: Long, sessionIdForReceive: Long, timestampChecker: TimestampChecker, uniquenessProvider: UniquenessProvider)

A notary commit protocol that makes sure a given transaction is valid before committing it. This does mean that the calling party has to reveal the whole transaction history; however, we avoid complex conflict resolution logic where a party has its input states "blocked" by a transaction from another party, and needs to establish whether that transaction was indeed valid.

Inherited Properties

otherSide val otherSide: Party
receiveSessionID val receiveSessionID: Long
sendSessionID val sendSessionID: Long
timestampChecker val timestampChecker: TimestampChecker
topic open val topic: String

The topic to use when communicating with other parties. If more than one topic is required then use sub-protocols. Note that this is temporary until protocol sessions are properly implemented.

uniquenessProvider val uniquenessProvider: UniquenessProvider

Functions

beforeCommit fun beforeCommit(stx: SignedTransaction, reqIdentity: Party): Unit

No pre-commit processing is done. Transaction is not checked for contract-validity, as that would require fully resolving it into a TransactionForVerification, for which the caller would have to reveal the whole transaction history chain. As a result, the Notary will commit invalid transactions as well, but as it also records the identity of the caller, it is possible to raise a dispute and verify the validity of the transaction and subsequently undo the commit of the input states (the exact mechanism still needs to be worked out).

Inherited Functions

call open fun call(): Unit

This is where you fill out your business logic.