如何向现有的 corda 网络添加新节点?

How to add a new node to an existing corda network?

我有一个用例,我需要向现有的 Corda 网络添加一个新节点(假设在现有的 Corda 网络中,2 个节点当前 运行ning(A、B 节点)现在需要将节点 C 添加到此网络。

我也浏览了以下链接,但没有成功:
Adding new node to existing corda network
Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable
Deploy and run nodes dynamically in CORDA

我尝试了以下方法:
我在 build.gradle 内的 deployNodes 任务中添加了 A 和 B 节点配置,然后在 运行 deployNodes 任务中添加了 A 和 B 节点现在启动成功 我创建了新文件夹 PartyC 并在其中为节点 C 添加了 corda.jarnode.conf 然后运行宁命令:
java -jar corda.jar
但是在 运行 执行此命令时出现以下异常:

Exception during node startup: Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable. [errorCode=1917kd6, moreInformationAt=https://errors.corda.net/OS/4.3/1917kd6]

node.conf 新节点(节点 C)的文件如下:

devMode=true
h2Settings {
  address="localhost:12348"
}
myLegalName="O=PartyC,L=London,C=GB"
p2pAddress="partyc:10011"
rpcSettings {
  address="partyc:10012"
  adminAddress="partyc:10013"
}
security {
  authService {
    dataSource {
      type=INMEMORY
      users=[
        {
          password=test
          permissions=[
            ALL
          ]
          user=user1
        }
      ]
    }
  }
}
sshd {
  port=2227
}

我不知道我应该如何在此 node.conf 文件中添加网络参数或兼容区域。

要在 cordapp 中添加新节点,您需要在 build.gradle 文件的这一部分代码中添加 partyC 代码

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
 directory "./build/nodes"
    node {

作为

node {
        name "O=PartyC,L=Paris,C=FR"
        p2pPort 10013
        rpcSettings {
            address("localhost:10014")
            adminAddress("localhost:10054")
        }


        rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
    }

要向现有网络添加新节点,有 2 个可能的选项。

使用网络bootstrapper (and docs手动创建所需的文件以允许节点相互交互。这更适用于测试网络。

或者使用网络地图服务,可以找到 OS 实现 here。这更适用于真实网络。如果您使用的是 Corda Enterprise,还有 Corda Enterprise Network Manager。