diff --git a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt index 60979b02cb..9fddfead5d 100644 --- a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt +++ b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt @@ -256,6 +256,14 @@ interface CordaRPCOps : RPCOps { /** Returns the [Party] with the X.500 principal as it's [Party.name]. */ fun wellKnownPartyFromX500Name(x500Name: CordaX500Name): Party? + /** + * Get a notary identity by name. + * + * @return the notary identity, or null if there is no notary by that name. Note that this will return null if there + * is a peer with that name but they are not a recognised notary service. + */ + fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party? + /** * Returns a list of candidate matches for a given string, with optional fuzzy(ish) matching. Fuzzy matching may * get smarter with time e.g. to correct spelling errors, so you should not hard-code indexes into the results diff --git a/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt b/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt index c902e8964a..08045171c5 100644 --- a/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt +++ b/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt @@ -200,6 +200,8 @@ class CordaRPCOpsImpl( } } + override fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party? = services.networkMapCache.getNotary(x500Name) + override fun partiesFromName(query: String, exactMatch: Boolean): Set { return database.transaction { services.identityService.partiesFromName(query, exactMatch)