使用Corda节点驱动程序时创建验证公证人

时间:2018-10-08 15:29:40

标签: corda

在Corda 3.2中,当使用Cordform任务时,我可以按以下方式定义验证公证人:

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 = [ ]
    }
}

使用节点驱动程序时如何定义验证公证?

1 个答案:

答案 0 :(得分:0)

使用节点驱动程序时,可以使用notarySpecs参数来定义要在网络上创建的公证人:

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.
    }
}

默认情况下,您将获得一个名为CordaX500Name("Notary Service", "Zurich", "CH")的验证公证。