问题
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
flagIf 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>
(seeNodeStartup.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 correspondingnodeInfo
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