在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 = [ ]
}
}
使用节点驱动程序时如何定义验证公证?
答案 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")
的验证公证。