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

杀马特。学长 韩版系。学妹 提交于 2020-03-04 20:33:29

问题


I have a use case where I need to add a new node to an existing Corda network (let's say in existing Corda network 2 nodes are running currently (A, B node) and now need to add node C to this network.

I went through following links as well but no luck:
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

I tried the following approach:
I Added A and B nodes configurations in deployNodes task inside build.gradle and then run deployNodes tasks so A and B nodes start-up successfully now I create new folder PartyC and inside that added corda.jar and node.conf for node C and then running the command:
java -jar corda.jar
but I am getting the following exception while running this command:

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 file for new node (node C) is following:

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
}

I am not able to get how should I need to add network parameters or compatibility zone inside this node.conf file.


回答1:


To add a new node to an existing network, there are 2 possible options.

Use the network bootstrapper (and docs to manually create the required files to allow nodes to interact with each other. This is more for test networks.

Or use a network map service, an OS implementation can be found here. This is more for real networks. There is also the Corda Enterprise Network Manager if you are using Corda Enterprise.




回答2:


For adding new nodes in a cordapp you need add the partyC code in build.gradle file inside this section of the code

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

as

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


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


来源:https://stackoverflow.com/questions/59497006/how-to-add-a-new-node-to-an-existing-corda-network

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!