0
votes

In Corda 3.2, when using the Cordform task, I might define a validating notary as follows:

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
    directory "./build/nodes"
    node {
        name "O=Notary,L=London,C=GB"
        notary = [validating : true]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10043")
        }
        cordapps = [ ]
    }
}

How do I define a validating notary when using the node driver?

1

1 Answers

0
votes

When using the node driver, you use the notarySpecs parameter to define the notaries to create on the network:

fun main(args: Array<String>) {
    val validatingNotarySpec = NotarySpec(CordaX500Name("ValidatingNotary", "London", "GB"), true)
    val nonValidatingNotarySpec = NotarySpec(CordaX500Name("NonValidatingNotary", "London", "GB"), false)

    val notarySpecs = listOf(validatingNotarySpec, nonValidatingNotarySpec)
    driver(DriverParameters(notarySpecs = notarySpecs)) {
        // Driver logic.
    }
}

By default, you will get a single validating notary with the name CordaX500Name("Notary Service", "Zurich", "CH").