Oxford Cambridge
Oxford Cambridge

Reputation: 11

Getting a notary from an unconsumed input state

If input states are consumed in a transaction then a notary is required. As per the documentation, the same notary that signed the original unconsumed inputs should sign the transaction which will consume these states to create an output state.

If there is a pool of notaries then how to search for the original notary to sign the new transaction?

Available docs/api explain how to get a new notary which is usually getFirstNotary/getAvailableNotary. Cheers

Upvotes: 1

Views: 66

Answers (1)

Austin Moothart
Austin Moothart

Reputation: 378

There are two aspects for notaries to keep in mind:

  1. High Availability: the notary pool provides replicated instances of the notary to ensure that its notary services are consistently available.
  2. Notary Identity: the X500 identity of the notary that is registered onto the Corda Network.

When speaking about a notary on a Corda Network we generally refer to its identity. The way in which a notary is deployed (aka the notary pool) is an implementation detail. Each notary identity that can be used on the Corda Network generally represents a different consensus protocol and/or a different business organization which operates the notary.

When you're using the notary selection API you're selecting which notary identity to use (aka consensus/organization) as opposed to any implementation detail of how the notary is deployed.

Notary selection comes from the network map and you can choose from the list of whitelisted notaries that exist on the Corda Network. Here's a primitive selection that simply gets the first notary: final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0) You can customize this as you see fit to choose a notary on a transaction by transaction basis.

Upvotes: 0

Related Questions