<h1>Node configuration<aclass="headerlink"href="#node-configuration"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="file-location">
<h2>File location<aclass="headerlink"href="#file-location"title="Permalink to this headline">¶</a></h2>
<p>The Corda all-in-one <codeclass="docutils literal"><spanclass="pre">corda.jar</span></code> file is generated by the <codeclass="docutils literal"><spanclass="pre">gradle</span><spanclass="pre">buildCordaJAR</span></code> task and defaults to reading configuration from a <codeclass="docutils literal"><spanclass="pre">node.conf</span></code> file in the present working directory.
This behaviour can be overidden using the <codeclass="docutils literal"><spanclass="pre">--config-file</span></code> command line option to target configuration files with different names, or different file location (relative paths are relative to the current working directory).
Also, the <codeclass="docutils literal"><spanclass="pre">--base-directory</span></code> command line option alters the Corda node workspace location and if specified a <codeclass="docutils literal"><spanclass="pre">node.conf</span></code> configuration file is then expected in the root of the workspace.</p>
<p>The configuration file templates used for the <codeclass="docutils literal"><spanclass="pre">gradle</span><spanclass="pre">deployNodes</span></code> task are to be found in the <codeclass="docutils literal"><spanclass="pre">/config/dev</span></code> folder. Also note that there is a basic set of defaults loaded from
the built in resource file <codeclass="docutils literal"><spanclass="pre">/node/src/main/resources/reference.conf</span></code> of the <codeclass="docutils literal"><spanclass="pre">:node</span></code> gradle module. All properties in this can be overidden in the file configuration
and for rarely changed properties this defaulting allows the property to be excluded from the configuration file.</p>
</div>
<divclass="section"id="format">
<h2>Format<aclass="headerlink"href="#format"title="Permalink to this headline">¶</a></h2>
<p>The Corda configuration file uses the HOCON format which is superset of JSON. It has several features which makes it
very useful as a configuration format. Please visit their <aclass="reference external"href="https://github.com/typesafehub/config/blob/master/HOCON.md">page</a>
<trclass="field-odd field"><thclass="field-name">basedir:</th><tdclass="field-body"><pclass="first">This specifies the node workspace folder either as an absolute path, or relative to the current working directory.
It can be overridden by the <codeclass="docutils literal"><spanclass="pre">--base-directory</span></code> command line option, in which case the value in the file is ignored
and a <codeclass="docutils literal"><spanclass="pre">node.conf</span></code> file is expected in that workspace directory as the configuration source.</p>
<trclass="field-even field"><thclass="field-name">myLegalName:</th><tdclass="field-body"><pclass="first">The legal identity of the node acts as a human readable alias to the node’s public key and several demos use
<trclass="field-odd field"><thclass="field-name">nearestCity:</th><tdclass="field-body"><pclass="first">The location of the node as used to locate coordinates on the world map when running the network simulator
demo. See <aclass="reference internal"href="network-simulator.html"><spanclass="doc">Network Simulator</span></a>.</p>
<trclass="field-even field"><td> </td><tdclass="field-body"><pclass="first">The password to unlock the KeyStore file (<codeclass="docutils literal"><spanclass="pre"><workspace>/certificates/sslkeystore.jks</span></code>) containing the
node certificate and private key.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">This is the non-secret value for the development certificates automatically generated during the first node run.
Longer term these keys will be managed in secure hardware devices.</p>
<trclass="field-odd field"><td> </td><tdclass="field-body"><pclass="first">The password to unlock the Trust store file (<codeclass="docutils literal"><spanclass="pre"><workspace>/certificates/truststore.jks</span></code>) containing
the Corda network root certificate. This is the non-secret value for the development certificates automatically
<trclass="field-even field"><td> </td><tdclass="field-body"><pclass="first">This section is used to configure the jdbc connection and database driver used for the nodes persistence.
Currently the defaults in <codeclass="docutils literal"><spanclass="pre">/node/src/main/resources/reference.conf</span></code> are as shown in the first example. This is currently
the only configuration that has been tested, although in the future full support for other storage layers will be validated.</p>
<trclass="field-odd field"><thclass="field-name">artemisAddress:</th><tdclass="field-body"><pclass="first">The host and port on which the node is available for protocol operations over ArtemisMQ.</p>
<trclass="field-even field"><td> </td><tdclass="field-body"><pclass="first">The address of the ArtemisMQ broker instance. If not provided the node will run one locally.</p>
</td>
</tr>
<trclass="field-odd field"><thclass="field-name">webAddress:</th><tdclass="field-body"><pclass="first">The host and port on which the node is available for web operations.</p>
<pclass="last">If HTTPS is enabled then the browser security checks will require that the accessing url host name is one
of either the machine name, fully qualified machine name, or server IP address to line up with the Subject Alternative
Names contained within the development certificates. This is addition to requiring the <codeclass="docutils literal"><spanclass="pre">/config/dev/corda_dev_ca.cer</span></code>
root certificate be installed as a Trusted CA.</p>
<trclass="field-even field"><td> </td><tdclass="field-body"><pclass="first">A list of ServiceType id strings to be advertised to the NetworkMapService and thus be available
when other nodes query the NetworkMapCache for supporting nodes. This can also include plugin services loaded from .jar
files in the plugins folder. Optionally, a custom advertised service name can be provided by appending it to the service
type id: <codeclass="docutils literal"><spanclass="pre">"corda.notary.validating|Notary</span><spanclass="pre">A"</span></code></p>
<trclass="field-odd field"><td> </td><tdclass="field-body"><pclass="first">The host and port to which to bind the embedded Raft server. Required only when running a distributed
notary service. A group of Corda nodes can run a distributed notary service by each running an embedded Raft server and
joining them to the same cluster to replicate the committed state log. Note that the Raft cluster uses a separate transport</p>
<blockquote>
<div><p>layer for communication that does not integrate with ArtemisMQ messaging services.</p>
<trclass="field-even field"><td> </td><tdclass="field-body"><pclass="first">List of Raft cluster member addresses used to join the cluster. At least one of the specified
members must be active and be able to communicate with the cluster leader for joining. If empty, a new cluster will be
bootstrapped. Required only when running a distributed notary service.</p>
<trclass="field-odd field"><td> </td><tdclass="field-body"><pclass="first">If <cite>null</cite>, or missing the node is declaring itself as the NetworkMapService host. Otherwise this is
a config object with the details of the network map service:</p>
<trclass="field-odd field"><thclass="field-name">address:</th><tdclass="field-body">Host and port string of the ArtemisMQ broker hosting the network map node</td>
</tr>
<trclass="field-even field"><thclass="field-name">legalName:</th><tdclass="field-body">Legal name of the node. This is required as part of the TLS host verification process. The node will
reject the connection to the network map service if it provides a TLS common name which doesn’t match with this value.</td>
<trclass="field-odd field"><thclass="field-name">useHTTPS:</th><tdclass="field-body"><pclass="first">If false the node’s web server will be plain HTTP. If true the node will use the same certificate and private
key from the <codeclass="docutils literal"><spanclass="pre"><workspace>/certificates/sslkeystore.jks</span></code> file as the ArtemisMQ port for HTTPS. If HTTPS is enabled
then unencrypted HTTP traffic to the node’s <strong>webAddress</strong> port is not supported.</p>
<trclass="field-even field"><thclass="field-name">rpcUsers:</th><tdclass="field-body"><pclass="first">A list of users who are authorised to access the RPC system. Each user in the list is a config object with the
<trclass="field-odd field"><thclass="field-name">user:</th><tdclass="field-body">Username consisting only of word characters (a-z, A-Z, 0-9 and _)</td>
<trclass="field-odd field"><thclass="field-name">permissions:</th><tdclass="field-body">A list of permission strings which RPC methods can use to control access</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>If this field is absent or an empty list then RPC is effectively locked down.</p>
<trclass="field-even field"><thclass="field-name">devMode:</th><tdclass="field-body"><pclass="first">This flag indicate if the node is running in development mode. On startup, if the keystore <codeclass="docutils literal"><spanclass="pre"><workspace>/certificates/sslkeystore.jks</span></code>
does not exist, a developer keystore will be used if <codeclass="docutils literal"><spanclass="pre">devMode</span></code> is true. The node will exit if <codeclass="docutils literal"><spanclass="pre">devMode</span></code> is false
<trclass="field-odd field"><td> </td><tdclass="field-body"><pclass="first last">Certificate Signing Server address. It is used by the certificate signing request utility to
obtain SSL certificate. (See <aclass="reference internal"href="permissioning.html"><spanclass="doc">Network permissioning</span></a> for more information.)</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.