2017-11-29 17:07:13 +00:00
|
|
|
Running nodes locally
|
|
|
|
=====================
|
2016-08-23 09:25:06 +00:00
|
|
|
|
2017-11-29 17:07:13 +00:00
|
|
|
.. contents::
|
|
|
|
|
|
|
|
.. note:: You should already have generated your node(s) with their CorDapps installed by following the instructions in
|
|
|
|
:doc:`generating-a-node`.
|
|
|
|
|
|
|
|
There are several ways to run a Corda node locally for testing purposes.
|
|
|
|
|
|
|
|
Starting all nodes at once
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
.. note:: ``runnodes`` is a shell script (or batch file on Windows) that is generated by ``deployNodes`` to allow you
|
|
|
|
to quickly start up all nodes and their webservers. ``runnodes`` should only be used for testing purposes.
|
|
|
|
|
|
|
|
Start the nodes with ``runnodes`` by running the following command from the root of the project:
|
|
|
|
|
|
|
|
* Linux/macOS: ``build/nodes/runnodes``
|
|
|
|
* Windows: ``call build\nodes\runnodes.bat``
|
|
|
|
|
|
|
|
.. warn:: On macOS, do not click/change focus until all the node terminal windows have opened, or some processes may
|
|
|
|
fail to start.
|
|
|
|
|
2017-11-30 10:38:06 +00:00
|
|
|
If you receive an ``OutOfMemoryError`` exception when interacting with the nodes, you need to increase the amount of
|
|
|
|
Java heap memory available to them, which you can do when running them individually. See
|
|
|
|
:ref:`starting-an-individual-corda-node`.
|
|
|
|
|
|
|
|
.. _starting-an-individual-corda-node:
|
|
|
|
|
2017-11-29 17:07:13 +00:00
|
|
|
Starting an individual Corda node
|
|
|
|
---------------------------------
|
|
|
|
Run the node by opening a terminal window in the node's folder and running:
|
2016-08-23 09:25:06 +00:00
|
|
|
|
2017-03-21 13:45:18 +00:00
|
|
|
.. code-block:: shell
|
|
|
|
|
2017-07-25 08:26:35 +00:00
|
|
|
java -jar corda.jar
|
2016-08-23 09:25:06 +00:00
|
|
|
|
2017-11-30 10:38:06 +00:00
|
|
|
By default, the node will look for a configuration file called ``node.conf`` and a CorDapps folder called ``cordapps``
|
|
|
|
in the current working directory. You can override the configuration file and workspace paths on the command line (e.g.
|
|
|
|
``./corda.jar --config-file=test.conf --base-directory=/opt/corda/nodes/test``).
|
|
|
|
|
|
|
|
You can increase the amount of Java heap memory available to the node using the ``-Xmx`` command line argument. For
|
|
|
|
example, the following would run the node with a heap size of 2048MB:
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2017-11-30 11:13:16 +00:00
|
|
|
java -Xmx2048m -jar corda.jar
|
2017-11-30 10:38:06 +00:00
|
|
|
|
|
|
|
You should do this if you receive an ``OutOfMemoryError`` exception when interacting with the node.
|
2016-08-23 09:25:06 +00:00
|
|
|
|
2017-11-29 17:07:13 +00:00
|
|
|
Optionally run the node's webserver as well by opening a terminal window in the node's folder and running:
|
|
|
|
|
|
|
|
.. code-block:: shell
|
2016-08-31 08:48:19 +00:00
|
|
|
|
2017-11-29 17:07:13 +00:00
|
|
|
java -jar corda-webserver.jar
|
2016-08-31 08:48:19 +00:00
|
|
|
|
2017-11-29 17:07:13 +00:00
|
|
|
.. warning:: The node webserver is for testing purposes only and will be removed soon.
|
2016-08-31 08:48:19 +00:00
|
|
|
|
2018-07-23 13:49:19 +00:00
|
|
|
.. _enabling-remote-debugging:
|
|
|
|
|
|
|
|
Enabling remote debugging
|
|
|
|
-------------------------
|
|
|
|
To enable remote debugging of the node, run the node with the following JVM arguments:
|
2016-08-31 08:48:19 +00:00
|
|
|
|
|
|
|
``java -Dcapsule.jvm.args="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" -jar corda.jar``
|
|
|
|
|
2018-07-23 13:49:19 +00:00
|
|
|
This will allow you to attach a debugger to your node on port 5005.
|