- Running nodes locally
- Starting a Corda node using DemoBench
- Starting a Corda node from the command line
- Starting a node with JMX monitoring enabled
- Starting all nodes at once from the command line (native)
- Starting all nodes at once from the command line (docker-compose)
- Starting all nodes at once on a remote machine from the command line
- Database migrations
You should already have generated your node(s) with their CorDapps installed by following the instructions in Creating nodes locally.
There are several ways to run a Corda node locally for testing purposes.
Run a node by opening a terminal window in the node’s folder and running:
java -jar corda.jar
By default, the node will look for a configuration file called
node.conf and a CorDapps folder called
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:
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:
java -jar corda-webserver.jar
The node webserver is for testing purposes only and will be removed soon.
The node can optionally be started with the following command-line options:
--base-directory: 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
--config-file: The path to the config file (default:
--initial-registration: Start initial node registration with Corda network to obtain certificate from the permissioning server
--just-generate-node-info: Perform the node start-up task necessary to generate its nodeInfo, save it to disk, then quit
--log-to-console: 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 (default: INFO)
--network-root-truststore: Network root trust store obtained from network operator
--network-root-truststore-password: Network root trust store password obtained from network operator
--no-local-shell: Do not start the embedded shell locally
--sshd: Enables SSHD server for node administration
--version: Print the version and exit
To enable export of JMX metrics over HTTP via Jolokia, run the following from the terminal window:
java -Dcapsule.jvm.args="-javaagent:drivers/jolokia-jvm-1.3.7-agent.jar=port=7005" -jar corda.jar
This command line will start the node with JMX metrics accessible via HTTP on port 7005.
See Monitoring your node for further details.
If you created your nodes using
runnodes shell script (or batch file on Windows) will have been
generated to allow you to quickly start up all nodes and their webservers.
runnodes should only be used for testing
Start the nodes with
runnodes by running the following command from the root of the project:
On macOS, do not click/change focus until all the node terminal windows have opened, or some processes may fail to start.
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
Starting a Corda node from the command line.
If you created your nodes using
docker-compose.yml file and corresponding
nodes has been created and configured appropriately. Navigate to
build/nodes directory and run
command. This will startup nodes inside new, internal network.
After the nodes are started up, you can use
docker ps command to see how the ports are mapped.
Cordform expects the nodes it generates to be run on the same machine where they were generated.
In order to run the nodes remotely, the nodes can be deployed locally and then copied to a remote server.
If after copying the nodes to the remote machine you encounter errors related to
localhost resolution, you will additionally need to follow the steps below.
To create nodes locally and run on a remote machine perform the following steps:
Configure Cordform task and deploy the nodes locally as described in Creating nodes locally.
Copy the generated directory structure to a remote machine using e.g. Secure Copy.
Optionally, add database configuration settings if they weren’t specified in the first step.
This step needs to be performed if the local machine doesn’t have access to the remote database (a database couldn’t be configured in the first step). In each top level
[NODE NAME]_node.confconfiguration file add the database settings and copy the JDBC driver JAR (if required). Edit the top level
[NODE NAME]_node.conffiles only and not the files (
node.conf) inside the node subdirectories.
Optionally, bootstrap the network on the remote machine.
This is optional step when a remote machine doesn’t accept
localhostaddresses, or the generated nodes are configured to run on another host’s IP address.
If required change host addresses in top level configuration files
[NODE NAME]_node.conffor entries
Run the network bootstrapper tool to regenerate the nodes network map (see for more explanation Network Bootstrapper):
java -jar corda-tools-network-bootstrapper-Master.jar --dir <nodes-root-dir>
Run nodes on the remote machine using runnodes command.
The above steps create a test deployment as
deployNodes Gradle task would do on a local machine.