What sequence of steps does a Corda node perform when it starts up and joins a network for the first time?

女生的网名这么多〃 提交于 2019-12-20 15:38:10

问题


What is the sequence of steps that a Corda node performs when it starts up for the first time?


回答1:


As of Corda 3, upon first starting up, the node goes through four steps:

1. Obtains the network root certificate out-of-band and stores it in the node's folder under certificates/network-root-truststore.jks

  • This location can be overidden using the --network-root-truststore flag

  • If using a doorman, this root certificate will be used to validate the certificates they provide to prevent man-in-the-middle attacks

2. Sets up the nodes certificates

You have two options here:

  • 2a: Run the node against a doorman by starting the node with the flags --initial-registration --network-root-truststore-password <trust store password> (see NodeStartup.registerWithNetwork):

    • Create a new node keystore
    • Make a certificate request to the certificate signing service
    • Poll and download its certificate and associated certificate chain from the certificate signing service
    • Check the certificate chain against the root CA cert obtained out-of-band
    • Store the certificate chain and private key in its node keystore
    • Create a truststore
    • Save the root certificate in its truststore
    • Create an SSL keystore
    • Generate an SSL keypair and certificate
    • Store its SSL private key and certificate in its SSL keystore
  • 2b: Provision the certificates yourself

In either case, your certificates will have to meet the requirements set out in the permissioning docs. You can use X509Utilities to create the certs. See X509UtilitiesTest.kt for an example.

3. Uploads its info to the network map (see AbstractNode.updateNodeInfo)

  • The node generates its own signed node info file
  • The node uploads its own nodeInfo to the network map

4. Polls the network for the network's parameters and other nodes (see NetworkMapUpdater.subscribeToNetworkMap):

  • The node downloads the network parameters
  • The node downloads the network map
  • For each nodeInfo hash in the network map, the node downloads the corresponding nodeInfo and add it to the node's local cache


来源:https://stackoverflow.com/questions/50832752/what-sequence-of-steps-does-a-corda-node-perform-when-it-starts-up-and-joins-a-n

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