【问题标题】:Creating validating notaries when using the Corda node driver使用 Corda 节点驱动程序时创建验证公证人
【发布时间】:2018-10-08 15:29:40
【问题描述】:

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

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

【问题讨论】:

    标签: corda


    【解决方案1】:

    使用节点驱动程序时,您使用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") 的验证公证人。

    【讨论】:

      猜你喜欢
      • 2018-09-13
      • 1970-01-01
      • 2019-10-02
      • 1970-01-01
      • 2018-11-17
      • 2021-05-29
      • 2019-01-14
      • 1970-01-01
      • 2021-01-12
      相关资源
      最近更新 更多