Running nodes locally ===================== .. 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 a Corda node using DemoBench ------------------------------------- See the instructions in :doc:`demobench`. .. _starting-an-individual-corda-node: Starting a Corda node from the command line ------------------------------------------- Run a node by opening a terminal window in the node's folder and running: .. code-block:: shell java -jar corda.jar 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 java -Xmx2048m -jar corda.jar You should do this if you receive an ``OutOfMemoryError`` exception when interacting with the node. Optionally run the node's webserver as well by opening a terminal window in the node's folder and running: .. code-block:: shell java -jar corda-webserver.jar .. warning:: The node webserver is for testing purposes only and will be removed soon. Command-line options ~~~~~~~~~~~~~~~~~~~~ The node can optionally be started with the following command-line options: * ``--base-directory``, ``-b``: The node working directory where all the files are kept (default: ``.``). * ``--bootstrap-raft-cluster``: Bootstraps Raft cluster. The node forms a single node cluster (ignoring otherwise configured peer addresses), acting as a seed for other nodes to join the cluster. * ``--clear-network-map-cache``, ``-c``: Clears local copy of network map, on node startup it will be restored from server or file system. * ``--config-file``, ``-f``: The path to the config file. Defaults to ``node.conf``. * ``--dev-mode``, ``-d``: Runs the node in developer mode. Unsafe in production. Defaults to true on MacOS and desktop versions of Windows. False otherwise. * ``--help``, ``-h``: Displays the help message and exits. * ``--initial-registration``: Start initial node registration with Corda network to obtain certificate from the permissioning server. * ``--install-shell-extensions``: Installs an alias and auto-completion for users of ``bash`` or ``zsh``. See below for more information. * ``--just-generate-node-info``: Perform the node start-up task necessary to generate its nodeInfo, save it to disk, then quit. * ``--just-generate-rpc-ssl-settings``: Generate the ssl keystore and truststore for a secure RPC connection. * ``--log-to-console``, ``--verbose``, ``-v``: If set, prints logging to the console as well as to a file. * ``--logging-level <[ERROR,WARN,INFO,DEBUG,TRACE]>``: Enable logging at this level and higher. Defaults to INFO. * ``--network-root-truststore``, ``-t``: Network root trust store obtained from network operator. * ``--network-root-truststore-password``, ``-p``: Network root trust store password obtained from network operator. * ``--no-local-shell``, ``-n``: Do not start the embedded shell locally. * ``--on-unknown-config-keys <[FAIL,WARN,INFO]>``: How to behave on unknown node configuration. Defaults to FAIL. * ``--sshd``: Enables SSH server for node administration. * ``--sshd-port``: Sets the port for the SSH server. If not supplied and SSH server is enabled, the port defaults to 2222. * ``--version``, ``-V``: Prints the version and exits. .. _installing-shell-extensions: Installing shell extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Users of ``bash`` or ``zsh`` can install an alias and command line completion for Corda. Run: .. code-block:: shell java -jar corda.jar --install-shell-extensions Then, either restart your shell, or for ``bash`` users run: .. code-block:: shell . ~/.bashrc Or, for ``zsh`` run: .. code-block:: shell . ~/.zshrc You will now be able to run a Corda node from anywhere by running the following: .. code-block:: shell corda --