Three Step Guide To Deploy a Local Corda Cluster

Corda Mar 28 2023 By: Sneha Damle




Sneha Damle
Sneha Damle Senior Developer Evangelist
Share this post:

This blog post will show how to deploy a local Corda cluster for day-to-day development and testing. For this, we will use an All-In-One combined worker cluster. It will help if you read the previous article about Next-Gen Corda’s basic architecture as a prerequisite.

Diagram of a static network with all-in-one worker
Figure 1: Static Network with All In One Worker

The Corda cluster is of no use until we deploy an application network by uploading CPIs and unless we create virtual nodes. Next-Gen Corda supports two types of application networks – static and dynamic. Static networks are meant to be used for development and testing. You do not need to set up an MGM for onboarding identities to such a network.

This blog post will use an all-in-one worker to set up a Corda cluster locally and deploy a static network. Next-Gen Corda also provides CSDE, a Corda Standard Development Environment, that defines some convenient Gradle tasks that automates starting the cluster and deploying the CorDapp onto your cluster.

Let’s start an all-in-one Corda cluster and deploy a CorDapp onto it.

Step 1: Clone CSDE

Clone the CSDE sample. The CSDE provides a ready-set-up CorDapp project which you can use as a starting point to develop your prototypes. It consists of a set of Gradle helper tasks which speed up and simplify the development and deployment process.

As a prerequisite to CSDE, you need the Corda CLI installed on your system. CSDE also requires Docker to be installed to run the combined worker cluster.

Step 2: Start the All-in-one-combined worker cluster

startCorda task can be used to start a local Corda cluster

Start the startCorda Gradle task. It downloads the combined worker from the Artifactory and JDBC Postgres driver to your home directory and starts a local JVM combined worker process. You can also check if the combined worker has started by running a ps grep command. The startCorda task starts an instance of Docker Postgres, which will be used as a database by the combined worker cluster.

Screenshot of ps grep command
ps -ef | grep corda-combined-worker

Next, we will use Kafka as a message bus for production-grade cluster deployment. But the combined-worker uses the Postgres database as the emulated message bus for development and testing. You can test if the cluster is started by hitting the swagger API at localhost:8888/api/v1/swagger#/

Screenshot of localhost:8888

Step 3: Click the quickdeploy Gradle task 

As a next step, we will run the quickdeploy Gradle task, which combines specific Gradle tasks, and lets you deploy your CorDapp in minutes. Let’s understand what happens when you run the quickDeploy task.

A group policy file is created

For a static network, we will be using a static GroupPolicy file. This is generated internally using the Corda CLI tool. The GroupPolicy file consists of a staticNetwork field that lets you start a static network in your local Corda cluster deployment.

Screenshot of a group policy file for a static network
A group policy file for a static network

A CPI file is created

The workflow and contract classes are bundled into a .CPK file and ultimately bundled into a .CPI file.

Screenshot of a .CPI file ready to be uploaded to the static network
.CPI file ready to be uploaded to the static network

Upload the .CPI file to the local cluster

We have created a CorDapp bundle(.CPI file), and associated it with a particular group/network. Now as a next step, we will upload this .CPI file to the Corda cluster. The CPI is uploaded to the network by calling the HTTP REST API /cpi. This returns a CPI checksum, which will be used in the next step. Uploading the CPI makes it available by the identities/virtual nodes when required. 

Let’s run the listCpi Gradle task, and you should see the list of available CPI’s.

listCpi task can be used to list the CPI’s uploaded to the cluster

Create virtual nodes

The CorDapps are of no use until someone uses them. We will use the HTTP REST API to create a virtual node by passing in the x500 name of the identity and the CPI checksum returned in the previous step. This associates an identity to a CorDapp and to a specific application network.

listVNodes can be used to list the virtual nodes created in the cluster

Register a virtual node to an MGM

But it’s still not useful until everyone on the network knows this virtual node is available for interaction. For a static network, the membership is automatically approved. We will talk more in the next blog post about how to setup a dynamic network, and how MGM approves the membership request made by the virtual node for a dynamic network.

So the Corda cluster is set up, a CorDapp and the network information (CPI) have been uploaded to the cluster, and virtual nodes have been created for Alice,Bob and Charlie.


To reset your cluster by following the below-mentioned steps.

  1. Click the stopCorda Gradle task
  2. Delete the /workspace directory from your CSDE project.
  3. Delete the /home/.corda/corda5 directory.
  4. Confirm if any corda-worker-combined process is still alive using the below grep command and kill the process using process-id.

ps -ef | grep corda-combined-worker

Next Steps

How to write a Next-Gen Corda CorDapp?

You can look at these steps about how to write a Next-Gen CorDapp.

How do we use the HTTP RPC API to hit a flow?

You can look at these steps, which discuss triggering a flow.

In the next article, we will explore how to set up a local static network with individual worker nodes.

Sneha Damle
Sneha Damle Sneha Damle is a Developer Evangelist at R3, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform.

Leave a Reply

Subscribe to our newsletter to stay up to date on the latest developer news, tools, and articles.