Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在CORDA中添加多个公证人_Corda - Fatal编程技术网

在CORDA中添加多个公证人

在CORDA中添加多个公证人,corda,Corda,我正在尝试创建一个包含4个节点和2个公证人的DLT,其中每个公证人负责与2个节点通信 渐变配置示例 task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { directory "./build/nodes" networkMap "O=Controller,L=London,C=GB" node { name "O=Controller,L=London,C=GB" advertisedSe

我正在尝试创建一个包含4个节点和2个公证人的DLT,其中每个公证人负责与2个节点通信

渐变配置示例

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
directory "./build/nodes"
networkMap "O=Controller,L=London,C=GB"
node {
    name "O=Controller,L=London,C=GB"
    advertisedServices = ["corda.notary.validating"]
    p2pPort 10002
    rpcPort 10003
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
}
node {
    name "O=ControllerNY,L=New York,C=US"
    advertisedServices = ["corda.notary.validating"]
    p2pPort 10004
    rpcPort 10005
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
}
node {
    name "O=PartyA,L=London,C=GB"
    advertisedServices = []
    p2pPort 10006
    rpcPort 10007
    webPort 10008
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
    rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
}
node {
    name "O=PartyB,L=London,C=GB"
    advertisedServices = []
    p2pPort 10009
    rpcPort 10010
    webPort 10011
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
    rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
}
node {
    name "O=PartyC,L=New York,C=US"
    advertisedServices = []
    p2pPort 10012
    rpcPort 10013
    webPort 10014
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
    rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
}
node {
    name "O=PartyD,L=New York,C=US"
    advertisedServices = []
    p2pPort 10015
    rpcPort 10016
    webPort 10017
    cordapps = ["net.corda:corda-finance:$corda_release_version"]
    rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
}
}


如何将
controller
controllerNY
添加到网络中,使其作为公证人而不是普通节点

在这种情况下,
controllerNY
controllerNY都将作为公证人添加到您的网络中,因为它们都宣传公证服务

然后,每个节点都可以自由地为给定的交易使用任一公证人。您可以在流程中使用以下方式选择公证人:

serviceHub.networkMapCache.getNotary(notaryToUse)

serviceHub.networkMapCache.notaryIdentities.single { it.name.organisation == notaryToUse }