diff --git a/docs/source/corda-configuration-file.rst b/docs/source/corda-configuration-file.rst index 3a2c462a42..0b8e0061bf 100644 --- a/docs/source/corda-configuration-file.rst +++ b/docs/source/corda-configuration-file.rst @@ -85,7 +85,9 @@ absolute path to the node's base directory. 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. -:h2port: A number that's used to pick the H2 JDBC server port. If not set a randomly chosen port will be used. +:h2Port: Deprecated. Use ``h2Settings`` instead. + +:h2Settings: Sets the H2 JDBC server port. See :doc:`node-database-access-h2`. :messagingServerAddress: The address of the ArtemisMQ broker instance. If not provided the node will run one locally. diff --git a/docs/source/node-database-access-h2.rst b/docs/source/node-database-access-h2.rst index a7f2ee40c7..220f24c4ac 100644 --- a/docs/source/node-database-access-h2.rst +++ b/docs/source/node-database-access-h2.rst @@ -13,9 +13,10 @@ Any database browsing tool that supports JDBC can be used, but if you have Intel a tool integrated with your IDE. Just open the database window and add an H2 data source with the above details. You will now be able to browse the tables and row data within them. -By default the node will expose its database on the localhost network interface. This behaviour can be -overridden by specifying the full network address (interface and port), using the new h2Settings -syntax in the node configuration: +By default, the node's H2 database is not exposed. This behaviour can be overridden by specifying the full network +address (interface and port), using the new ``h2Settings`` syntax in the node configuration. + +The configuration below will restrict the H2 service to run on ``localhost``: .. sourcecode:: groovy @@ -23,9 +24,21 @@ syntax in the node configuration: address: "localhost:12345" } -The configuration above will restrict the H2 service to run on localhost. If remote access is required, the address -can be changed to 0.0.0.0. However it is recommended to change the default username and password -before doing so. +If you want H2 to auto-select a port (mimicking the old ``h2Port`` behaviour), you can use: + +.. sourcecode:: groovy + + h2Settings { + address: "localhost:0" + } + +If remote access is required, the address can be changed to ``0.0.0.0``. However it is recommended to change the default username and password before doing so. + +.. sourcecode:: groovy + + h2Settings { + address: "0.0.0.0:12345" + } The previous ``h2Port`` syntax is now deprecated. ``h2Port`` will continue to work but the database -will only be accessible on localhost. \ No newline at end of file +will only be accessible on localhost.