2016-11-28 18:00:03 +00:00
Node configuration
==================
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
.. contents ::
2016-11-28 18:00:03 +00:00
File location
-------------
2018-02-26 14:53:13 +00:00
When starting a node, the `` corda.jar `` file defaults to reading the node's configuration from a `` node.conf `` file in
the directory from which the command to launch Corda is executed. There are two command-line options to override this
behaviour:
* The `` --config-file `` command line option allows you to specify a configuration file with a different name, or at
different file location. Paths are relative to the current working directory
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
* The `` --base-directory `` command line option allows you to specify the node's workspace location. A `` node.conf ``
configuration file is then expected in the root of this workspace
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
If you specify both command line arguments at the same time, the node will fail to start.
2016-08-31 08:48:19 +00:00
2016-11-25 14:29:13 +00:00
Format
------
2018-02-26 14:53:13 +00:00
The Corda configuration file uses the HOCON format which is superset of JSON. Please visit
`<https://github.com/typesafehub/config/blob/master/HOCON.md>`_ for further details.
2016-08-31 08:48:19 +00:00
2018-03-28 16:09:42 +00:00
Please do NOT use double quotes (`` " `` ) in configuration keys.
2018-03-28 21:41:37 +00:00
Node setup will log `Config files should not contain \" in property names. Please fix: [key]` as error
2018-03-28 16:09:42 +00:00
when it founds double quotes around keys.
This prevents configuration errors when mixing keys containing `` . `` wrapped with double quotes and without them
e.g.:
The property `"dataSourceProperties.dataSourceClassName" = "val"` in `` reference.conf ``
would be not overwritten by the property `dataSourceProperties.dataSourceClassName = "val2"` in `` node.conf `` .
2018-03-28 14:54:58 +00:00
2018-02-26 14:53:13 +00:00
Defaults
2016-11-25 14:29:13 +00:00
--------
2018-02-26 14:53:13 +00:00
A set of default configuration options are loaded from the built-in resource file `` /node/src/main/resources/reference.conf `` .
This file can be found in the `` :node `` gradle module of the `Corda repository <https://github.com/corda/corda> `_ . Any
options you do not specify in your own `` node.conf `` file will use these defaults.
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
Here are the contents of the `` reference.conf `` file:
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
.. literalinclude :: ../../node/src/main/resources/reference.conf
2016-11-28 18:00:03 +00:00
:language: javascript
2016-08-31 08:48:19 +00:00
2016-11-25 14:29:13 +00:00
Fields
------
2018-02-26 14:53:13 +00:00
The available config fields are listed below. `` baseDirectory `` is available as a substitution value and contains the
absolute path to the node's base directory.
2016-08-31 08:48:19 +00:00
2018-02-26 14:53:13 +00:00
:myLegalName: The legal identity of the node. This acts as a human-readable alias to the node's public key and can be used with
the network map to look up the node's info. This is the name that is used in the node's certificates (either when requesting them
from the doorman, or when auto-generating them in dev mode). At runtime, Corda checks whether this name matches the
name in the node's certificates.
2016-08-31 08:48:19 +00:00
2016-12-22 14:48:27 +00:00
:keyStorePassword: The password to unlock the KeyStore file (``<workspace>/certificates/sslkeystore.jks``) containing the
node certificate and private key.
2016-08-31 08:48:19 +00:00
2016-12-22 14:48:27 +00:00
.. note :: 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.
2016-08-31 08:48:19 +00:00
2016-12-22 14:48:27 +00:00
:trustStorePassword: The password to unlock the Trust store file (``<workspace>/certificates/truststore.jks``) containing
the Corda network root certificate. This is the non-secret value for the development certificates automatically
generated during the first node run.
2016-08-31 08:48:19 +00:00
2016-09-23 09:55:40 +00:00
.. note :: Longer term these keys will be managed in secure hardware devices.
2016-08-31 08:48:19 +00:00
2017-11-25 15:55:31 +00:00
:database: Database configuration:
:serverNameTablePrefix: Prefix string to apply to all the database tables. The default is no prefix.
:transactionIsolationLevel: Transaction isolation level as defined by the ``TRANSACTION_`` constants in
`` java.sql.Connection `` , but without the "TRANSACTION_" prefix. Defaults to REPEATABLE_READ.
2017-12-08 16:27:12 +00:00
:exportHibernateJMXStatistics: Whether to export Hibernate JMX statistics (caution: expensive run-time overhead)
2017-11-25 15:55:31 +00:00
2016-12-22 14:48:27 +00:00
:dataSourceProperties: This section is used to configure the jdbc connection and database driver used for the nodes persistence.
Currently the defaults in `` /node/src/main/resources/reference.conf `` 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.
2016-08-31 08:48:19 +00:00
2018-04-25 08:38:59 +00:00
:h2port: A number that's used to pick the H2 JDBC server port. If not set a randomly chosen port will be used.
2017-03-17 10:32:14 +00:00
:messagingServerAddress: The address of the ArtemisMQ broker instance. If not provided the node will run one locally.
:p2pAddress: The host and port on which the node is available for protocol operations over ArtemisMQ.
2016-08-31 08:48:19 +00:00
2016-12-22 14:48:27 +00:00
.. note :: In practice the ArtemisMQ messaging services bind to all local addresses on the specified port. However,
2018-03-01 21:24:10 +00:00
note that the host is the included as the advertised entry in the network map. As a result the value listed
2017-05-12 13:09:02 +00:00
here must be externally accessible when running nodes across a cluster of machines. If the provided host is unreachable,
the node will try to auto-discover its public one.
2016-08-31 08:48:19 +00:00
2018-04-26 12:58:41 +00:00
:p2pMessagingRetry: Only used for notarisation requests. When the response doesn't arrive in time, the message is
resent to a different notary-replica round-robin in case of clustered notaries.
:messageRedeliveryDelay: The initial retry delay, e.g. `30 seconds`.
:maxRetryCount: How many retries to attempt.
:backoffBase: The base of the exponential backoff, :math:`t_{wait} = messageRedeliveryDelay * backoffBase^{retryCount}`.
2018-01-23 16:23:37 +00:00
:rpcAddress: The address of the RPC system on which RPC requests can be made to the node. If not provided then the node will run without RPC. This is now deprecated in favour of the ``rpcSettings`` block.
:rpcSettings: Options for the RPC server.
:useSsl: (optional) boolean, indicates whether the node should require clients to use SSL for RPC connections, defaulted to ``false``.
:standAloneBroker: (optional) boolean, indicates whether the node will connect to a standalone broker for RPC, defaulted to ``false``.
:address: (optional) host and port for the RPC server binding, if any.
:adminAddress: (optional) host and port for the RPC admin binding (only required when ``useSsl`` is ``false``, because the node connects to Artemis using SSL to ensure admin privileges are not accessible outside the node).
:ssl: (optional) SSL settings for the RPC server.
:keyStorePassword: password for the key store.
:trustStorePassword: password for the trust store.
:certificatesDirectory: directory in which the stores will be searched, unless absolute paths are provided.
:sslKeystore: absolute path to the ssl key store, defaulted to ``certificatesDirectory / "sslkeystore.jks"``.
:trustStoreFile: absolute path to the trust store, defaulted to ``certificatesDirectory / "truststore.jks"``.
2016-10-05 15:38:57 +00:00
2017-12-13 17:09:09 +00:00
:security: Contains various nested fields controlling user authentication/authorization, in particular for RPC accesses. See
:doc: `clientrpc` for details.
2017-10-13 09:36:25 +00:00
:notary: Optional configuration object which if present configures the node to run as a notary. If part of a Raft or BFT SMaRt
2017-10-05 11:27:45 +00:00
cluster then specify `` raft `` or `` bftSMaRt `` respectively as described below. If a single node notary then omit both.
2016-08-31 08:48:19 +00:00
2017-11-29 17:07:13 +00:00
:validating: Boolean to determine whether the notary is a validating or non-validating one.
2016-10-25 15:45:08 +00:00
2017-11-29 17:07:13 +00:00
:raft: If part of a distributed Raft cluster specify this config object, with the following settings:
2017-10-05 11:27:45 +00:00
2017-11-29 17:07:13 +00:00
:nodeAddress: The host and port to which to bind the embedded Raft server. Note that the Raft cluster uses a
separate transport layer for communication that does not integrate with ArtemisMQ messaging services.
2017-10-05 11:27:45 +00:00
2017-11-29 17:07:13 +00:00
:clusterAddresses: Must list the addresses of all the members in the cluster. At least one of the members must
be active and be able to communicate with the cluster leader for the node to join the cluster. If empty, a
new cluster will be bootstrapped.
2017-10-05 11:27:45 +00:00
2017-11-29 17:07:13 +00:00
:bftSMaRt: If part of a distributed BFT-SMaRt cluster specify this config object, with the following settings:
2017-10-05 11:27:45 +00:00
2017-11-29 17:07:13 +00:00
:replicaId: The zero-based index of the current replica. All replicas must specify a unique replica id.
2017-10-05 11:27:45 +00:00
2017-11-29 17:07:13 +00:00
:clusterAddresses: Must list the addresses of all the members in the cluster. At least one of the members must
be active and be able to communicate with the cluster leader for the node to join the cluster. If empty, a
new cluster will be bootstrapped.
2017-10-13 09:36:25 +00:00
2017-11-29 17:07:13 +00:00
:custom: If `true`, will load and install a notary service from a CorDapp. See :doc:`tutorial-custom-notary`.
2017-10-13 09:36:25 +00:00
Only one of `` raft `` , `` bftSMaRt `` or `` custom `` configuration values may be specified.
2016-10-25 15:45:08 +00:00
2016-12-22 14:48:27 +00:00
:rpcUsers: A list of users who are authorised to access the RPC system. Each user in the list is a config object with the
2016-11-11 15:59:37 +00:00
following fields:
2016-08-31 08:48:19 +00:00
2017-11-29 17:07:13 +00:00
:username: Username consisting only of word characters (a-z, A-Z, 0-9 and _)
:password: The password
:permissions: A list of permissions for starting flows via RPC. To give the user the permission to start the flow
`` foo.bar.FlowClass `` , add the string `` StartFlow.foo.bar.FlowClass `` to the list. If the list
contains the string `` ALL `` , the user can start any flow via RPC. This value is intended for administrator
users and for development.
2016-11-28 18:00:03 +00:00
2017-07-04 11:12:50 +00:00
:devMode: This flag sets the node to run in development mode. On startup, if the keystore ``<workspace>/certificates/sslkeystore.jks``
2016-12-22 14:48:27 +00:00
does not exist, a developer keystore will be used if `` devMode `` is true. The node will exit if `` devMode `` is false
2017-07-04 11:12:50 +00:00
and the keystore does not exist. `` devMode `` also turns on background checking of flow checkpoints to shake out any
2017-11-28 17:33:02 +00:00
bugs in the checkpointing process. Also, if `` devMode `` is true, Hibernate will try to automatically create the schema required by Corda
or update an existing schema in the SQL database; if `` devMode `` is false, Hibernate will simply validate an existing schema
failing on node start if this schema is either not present or not compatible.
2016-11-28 18:00:03 +00:00
2017-06-23 10:42:55 +00:00
:detectPublicIp: This flag toggles the auto IP detection behaviour, it is enabled by default. On startup the node will
attempt to discover its externally visible IP address first by looking for any public addresses on its network
interfaces, and then by sending an IP discovery request to the network map service. Set to `` false `` to disable.
2017-11-14 11:37:50 +00:00
:compatibilityZoneURL: The root address of Corda compatibility zone network management services, it is used by the Corda node to register with the network and
obtain Corda node certificate, (See :doc: `permissioning` for more information.) and also used by the node to obtain network map information.
2017-10-24 15:49:47 +00:00
:jvmArgs: An optional list of JVM args, as strings, which replace those inherited from the command line when launching via ``corda.jar``
only. e.g. `` jvmArgs = [ "-Xmx220m", "-Xms220m", "-XX:+UseG1GC" ] ``
:systemProperties: An optional map of additional system properties to be set when launching via ``corda.jar`` only. Keys and values
of the map should be strings. e.g. `` systemProperties = { visualvm.display.name = FooBar } ``
:jarDirs: An optional list of file system directories containing JARs to include in the classpath when launching via ``corda.jar`` only.
Each should be a string. Only the JARs in the directories are added, not the directories themselves. This is useful
2017-10-30 11:45:52 +00:00
for including JDBC drivers and the like. e.g. `` jarDirs = [ 'lib' ] ``
2017-11-20 17:41:38 +00:00
2017-12-08 16:27:12 +00:00
:sshd: If provided, node will start internal SSH server which will provide a management shell. It uses the same credentials and permissions as RPC subsystem. It has one required parameter.
2017-11-20 17:41:38 +00:00
2017-11-29 17:07:13 +00:00
:port: The port to start SSH server on
2017-12-08 16:27:12 +00:00
2018-02-15 17:10:07 +00:00
:jmxMonitoringHttpPort: If set, will enable JMX metrics reporting via the Jolokia HTTP/JSON agent on the corresponding port.
Default Jolokia access url is http://127.0.0.1:port/jolokia/
2017-12-15 17:48:33 +00:00
2018-01-22 13:41:06 +00:00
:transactionCacheSizeMegaBytes: Optionally specify how much memory should be used for caching of ledger transactions in memory.
Otherwise defaults to 8MB plus 5% of all heap memory above 300MB.
:attachmentContentCacheSizeMegaBytes: Optionally specify how much memory should be used to cache attachment contents in memory.
Otherwise defaults to 10MB
:attachmentCacheBound: Optionally specify how many attachments should be cached locally. Note that this includes only the key and
2018-02-26 14:53:13 +00:00
metadata, the content is cached separately and can be loaded lazily. Defaults to 1024.
2018-04-26 13:26:37 +00:00
:extraNetworkMapKeys: An optional list of private network map UUIDs. Your node will fetch the public network and private network maps based on
these keys. Private network UUID should be provided by network operator and lets you see nodes not visible on public network.
.. note :: This is temporary feature for onboarding network participants that limits their visibility for privacy reasons.
2018-03-01 14:57:36 +00:00
2018-02-26 14:53:13 +00:00
Examples
--------
General node configuration file for hosting the IRSDemo services:
.. literalinclude :: example-code/src/main/resources/example-node.conf
2018-03-01 14:57:36 +00:00
:language: javascript
2018-02-26 14:53:13 +00:00
2018-03-01 14:57:36 +00:00
Simple notary configuration file:
2018-02-26 14:53:13 +00:00
.. parsed-literal ::
myLegalName : "O=Notary Service,OU=corda,L=London,C=GB"
keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
p2pAddress : "localhost:12345"
rpcSettings = {
useSsl = false
standAloneBroker = false
address : "my-corda-node:10003"
adminAddress : "my-corda-node:10004"
}
notary : {
validating : false
}
devMode : true
2018-03-01 14:57:36 +00:00
compatibilityZoneURL : "https://cz.corda.net"
An example `` web-server.conf `` file is as follow:
.. parsed-literal ::
myLegalName : "O=Notary Service,OU=corda,L=London,C=GB"
keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
rpcSettings = {
useSsl = false
standAloneBroker = false
address : "my-corda-node:10003"
adminAddress : "my-corda-node:10004"
}
webAddress : "localhost:12347",
rpcUsers : [{ username=user1, password=letmein, permissions=[ StartFlow.net.corda.protocols.CashProtocol ] }]
Fields
------
The available config fields are listed below. `` baseDirectory `` is available as a substitution value, containing the absolute
path to the node's base directory.
:myLegalName: The legal identity of the node acts as a human readable alias to the node's public key and several demos use
this to lookup the NodeInfo.
:keyStorePassword: The password to unlock the KeyStore file (``<workspace>/certificates/sslkeystore.jks``) containing the
node certificate and private key.
.. note :: 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.
:trustStorePassword: The password to unlock the Trust store file (``<workspace>/certificates/truststore.jks``) containing
the Corda network root certificate. This is the non-secret value for the development certificates automatically
generated during the first node run.
.. note :: Longer term these keys will be managed in secure hardware devices.
:rpcSettings: Options for the RPC server.
:useSsl: (optional) boolean, indicates whether the node should require clients to use SSL for RPC connections, defaulted to ``false``.
:standAloneBroker: (optional) boolean, indicates whether the node will connect to a standalone broker for RPC, defaulted to ``false``.
:address: (optional) host and port for the RPC server binding, if any.
:adminAddress: (optional) host and port for the RPC admin binding (only required when ``useSsl`` is ``false``, because the node connects to Artemis using SSL to ensure admin privileges are not accessible outside the node).
:ssl: (optional) SSL settings for the RPC client.
:keyStorePassword: password for the key store.
:trustStorePassword: password for the trust store.
:certificatesDirectory: directory in which the stores will be searched, unless absolute paths are provided.
:sslKeystore: absolute path to the ssl key store, defaulted to ``certificatesDirectory / "sslkeystore.jks"``.
:trustStoreFile: absolute path to the trust store, defaulted to ``certificatesDirectory / "truststore.jks"``.
:trustStoreFile: absolute path to the trust store, defaulted to ``certificatesDirectory / "truststore.jks"``.
:webAddress: The host and port on which the webserver will listen if it is started. This is not used by the node itself.
:rpcUsers: A list of users who are authorised to access the RPC system. Each user in the list is a config object with the
following fields:
:username: Username consisting only of word characters (a-z, A-Z, 0-9 and _)
:password: The password
:permissions: A list of permissions for starting flows via RPC. To give the user the permission to start the flow
`` foo.bar.FlowClass `` , add the string `` StartFlow.foo.bar.FlowClass `` to the list. If the list
contains the string `` ALL `` , the user can start any flow via RPC. This value is intended for administrator
2018-03-28 21:41:37 +00:00
users and for development.