We are facing following issues in bringing up Corda code while using our own generated certificates (not the ones generated by Corda node in devMode=true
).
Following are the steps we did:
cordadevcakeys.jks
and cordatruststore.jks
in the resources directoryStarted the node. We got the following error:
Exception during node startup {} java.lang.IllegalArgumentException: Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable at net.corda.node.internal.NetworkParametersReader.retrieveNetworkParameters(NetworkParametersReader.kt:53) ~[corda-node-corda-4.0-SNAPSHOT.jar:?] at net.corda.node.internal.NetworkParametersReader.access$retrieveNetworkParameters(NetworkParametersReader.kt:17) ~[corda-node-corda-4.0-SNAPSHOT.jar:?] at net.corda.node.internal.NetworkParametersReader$networkParameters$2.invoke(NetworkParametersReader.kt:26) ~[corda-node-corda-4.0-SNAPSHOT.jar:?] at
Now if we keep cordadevcakeys.jks
and cordatruststore.jks
in the resources directory, the node comes up.
Queries:
cordadevcakeys.jks
and cordatruststore.jks
in the resources directory for the node bringup, devmode=false
& the compatibility zoneCould you please specify the end point to which nodes send certificate requests? I saw the following: https://github.com/corda/corda/blob/a3d88f752d964d3768e153be189f196c600c8d7d/docs/source/example-code/src/main/resources/example-node-with-networkservices.conf:
networkServices : {
doormanURL = "https://registration.corda.net"
networkMapURL = "https://cz.corda.net"
}
Could you please explain the rest endpoints served by the doorman URL?
Is it /certificate
?
Since the network map has the following structure:
data class NetworkMap(
val nodeInfoHashes: List<SecureHash>,
val networkParameterHash: SecureHash,
val parametersUpdate: ParametersUpdate?
)
And it does not contain a nodeinfo
. Is the following the right
procedure?
nodeinfo
s from the
network mapnodeInfo
s one by oneCould you please explain when the nodeInfo
is uploaded? Also, if a
given node is the first node, the network map may be empty. Will the
node fail to boot up because there is nothing in the network map (since
there are no nodeinfo
s)?
NB: As well as looking at these answers, you should refer to:
The test network map server implementation here: https://github.com/corda/corda/blob/24fa695ca0ef72fa851abc5b1630d722f32577ec/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/network/NetworkMapServer.kt
The test doorman-request handler here: https://github.com/corda/corda/blob/a3d88f752d964d3768e153be189f196c600c8d7d/node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt
Answers below:
Yes. This error message is thrown either because you haven't provided a compatibility zone URL, or because the server at the URL you provided cannot be reached
You need to provide a network map server that listens on the address listed in the node's configuration file as the compatibility zone URL and implements the following protocol: https://docs.corda.net/network-map.html#http-network-map-protocol
The doorman sends the network map parameters and node information using HTTP, in response to HTTP GET requests that obey this protocol: https://docs.corda.net/network-map.html#http-network-map-protocol. HTTPS is not used, but because the network parameters and node information objects are signed, they cannot be tampered with
These .jks
files are development keystores that are only used when running the nodes in dev mode (i.e. when devMode=true
)
The need for the network parameters is documented here: https://docs.corda.net/network-map.html#network-parameters. The structure of the network parameters is a serialised instance of the following class: https://github.com/corda/corda/blob/8504b65e7b14a95fc4486c82d1e3e77d1c4e3562/core/src/main/kotlin/net/corda/core/node/NetworkParameters.kt#L27
The network parameters are documented here: https://docs.corda.net/network-map.html#network-parameters
No. They are the same thing
Yes, they are different entities. The doorman provides node CA certificates, while the network map is used to allow nodes to discover other nodes on the network. The root network CA certificate is circulated out-of-band. Nodes then use the --initial-registration
flag (see https://docs.corda.net/permissioning.html#connecting-to-a-compatibility-zone) to perform a certificate signing request and create their node CA certificate. The node will then create its identity certificates and TLS certificates when it first starts up, and send its NodeInfo
to the network map
The network map is a single file. It's a serialised instance of the SignedDataWithCert<NetworkMap>
class. The hash
in the URL is the SecureHash
of a SerialisedBytes<NodeInfo>
The node will handle sending the acknowledgment automatically if you use the acceptNewNetworkParameters
RPC operation, documented here: https://docs.corda.net/network-map.html#network-parameters-update-process
Using HTTPS is fine, but optional
The network-parameters file is a serialised instance of the SignedDataWithCert<NetworkParameters>
class. It must be signed by the same certificate that signed the network map object (i.e. the entity with the doorman CA role). Yes, the node needs to accept the new network parameters - see the docs here: https://docs.corda.net/network-map.html#network-parameters-update-process. You get the hash by requesting the network map object itself. This object has a networkParameterHash
field, which is the hash you need.
The diagram is slightly wrong. You need to make the GET /network-map
request as the first step, not the last. This will provide the required network-parameters hash
That's correct. You need to hit the /certificate
endpoint
The procedure you describe is correct. The node uploads its nodeInfo
at node startup. It checks if its nodeInfo
has changed and if it has, it submits the new one to the network map. If the network map is currently empty when a node boots up, the node will always add its own nodeInfo
to its local cache, even if the network map it downloads doesn’t contain it. However, it will still boot up even if the network map is initially empty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With