Raymond Mogg
Raymond Mogg

Reputation: 192

Common name notary issue

I am running into an issue when launching a notary using the node driver. The issue I am encountering is that when I define the notary without a common name (val NOTARY = CordaX500Name("Notary Service","Zurich","CH")), the node fails on startup with the error

java.lang.IllegalArgumentException: Common name in 'C=CH,L=Zurich,O=Notary Service' must not be null for notary service, use service type id as common name.
    at net.corda.node.internal.AbstractNode.getNotaryIdentity(AbstractNode.kt:437) ~[corda-node-1.0.0.jar:?]
    at net.corda.node.internal.AbstractNode.makeInfo(AbstractNode.kt:422) ~[corda-node-1.0.0.jar:?]
    at net.corda.node.internal.AbstractNode.makeServices(AbstractNode.kt:388) ~[corda-node-1.0.0.jar:?]
    at net.corda.node.internal.AbstractNode.access$makeServices(AbstractNode.kt:98) ~[corda-node-1.0.0.jar:?]
    at net.corda.node.internal.AbstractNode$start$startedImpl$1.invoke(AbstractNode.kt:184) ~[corda-node-1.0.0.jar:?]

If I then go ahead and define the notary with its common name as the service type id (val NOTARY = CordaX500Name("Corda.notary.validating","Notary Service","Zurich","CH")), I get the following error which causes the node to be unable to startup.

Caused by: java.lang.IllegalArgumentException: Common name must be null: C=CH,L=Zurich,O=Notary Service,CN=Corda.notary.validating
    at net.corda.node.services.config.FullNodeConfiguration.<init>(NodeConfiguration.kt:82) ~[corda-node-1.0.0.jar:?]
    at net.corda.node.services.config.FullNodeConfiguration.<init>(NodeConfiguration.kt:71) ~[corda-node-1.0.0.jar:?]
    ... 19 more

I believe this could be related to v1.0 - commonName in a legalName to create node which said that a backport was made for V1 that throws an error when a node uses a common name. Is there any way around this, or is there a better way for me to define a notary?

Upvotes: 0

Views: 89

Answers (1)

Joel
Joel

Reputation: 23210

You start a notary node using the driver as follows:

startNode(
    providedName = CordaX500Name("Controller", "London", "GB"), 
    advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type))
)

Upvotes: 0

Related Questions