How to setup a Corda Network using CENM tool

karthik Ganti
4 min readSep 19, 2021

--

In this article we will learn how to setup a corda network using CENM tool. CENM (Corda Enterprise Network Manger) is an enterprise tool which is used to build a production corda network. We will be building a test/dev network.

You should have access to a linux OS. I am using ubuntu 16.04.

So, let’s get started :)

Prerequisites:

Create a staging directory:

Create a staging directory for the network.

staging directory

PKI Generation:

Now we need to generate pki for the network. Go to the pki folder and create a file pki-generation.conf and paste the following code.

pki-configuration.conf

Make sure you have all the required binaries in the PKI folder to run the pki generation command. PKI staging directory should have the following binaries:

pki staging directory

Run the following command to generate the PKI :

java -jar pkitool.jar --config-file pki-generation.conf
pki generation output

The above command has generated network root trust store and key stores for identity manager and network map service. We need to place network root trust store and key store files in identity manager and network map service staging folder.

Setup Identity Manager Service :

Copy corda-identity-manager-keys.jks and network-root-truststore.jks to identity manager staging directory. Also, place the required binaries in the identity manager staging directory.

Go to identity manager directory and run the following commands :

cp ../pki/key-stores/corda-identity-manager-keys.jks .
cp ../pki/trust-stores/network-root-truststore.jks .
identity manager staging folder

Create identity-manager.conf file and add the following configuration to the conf file:

Start identity manager service :

Run the following command to start the identity manager service.

java -jar identitymanager.jar --config-file identity-manager.conf
identity manager service

Register Notary with the identity manager service :

You need to register the Notary with the Identity Manager Service before the Network Map Service can be initialized. This is because the list of trusted notaries is stored within the Network Parameters, which should be passed to the Network Map Service during initialization.

Copy the trust-stores/network-root-truststore.jks generated by the PKI tool to the Notary host , along with a valid Corda .jar (e.g. Corda OS 4.5). I am using corda-4.8.jar.

Notary staging directory

Also, create a node.conf for the notary node.

Notary node.conf

Run notary node registration (Initial registration) :

java -jar corda-4.8.jar --initial-registration --network-root-truststore-password trustpass --network-root-truststore network-root-truststore.jks
Notary initial registration

Network Map Service first run :

Copy the corda-network-map-keys.jks and network-root-truststore.jks files over to the Network Map folder, along with the Network Map zip archive which you will need to unpack.

Before starting the Network Map Service, you will need to set initial network parameters. The network parameters are a set of values that every node participating in the zone needs to agree on and use to correctly communicate with each other. Setting the parameters is covered below, after configuration of the service.

Copy the notary nodeInfo to network map service folder

cp ../notary/nodeInfo-EA502E2B986C26F9A584B17C020FA06E3C985977F4CF34FCC9879D26BED4932A .

Create network-map.conf file

network-map.conf

Create network-parameters.conf file

network-parameters.conf

Run the following command to initialize network map:

java -jar networkmap.jar  --config-file network-map.conf  --set-network-parameters network-parameters.conf  --network-truststore network-root-truststore.jks  --truststore-password trustpass  --root-alias cordarootca
Initial run output

Start the network map service :

java -jar networkmap.jar --config-file network-map.conf

Start Notary :

java -jar corda-4.8.jar
Notary service started

Now corda network is up. We can verify the network map configuration from notary crash shell.

Run the following command to access notary crash shell.

ssh -p 2222 localhost -l testuser

Password is password (mentioned in node.conf).

Notary crash shell

We have completed the network setup part but we don’t have any nodes in our network. In the next article, I will show how to add nodes to the existing network. Check the next part here -> https://raokarthik83.medium.com/how-to-setup-a-corda-network-using-cenm-tool-part-2-60d99017346a

I hope this helps :)

Please check my Facebook page for more articles :

https://www.facebook.com/pg/nextledger/posts/

Thanks.

--

--

karthik Ganti
karthik Ganti

Written by karthik Ganti

Hi, I am karthik. Full Stack Developer | Web3 Expert | Micorservices Developer | Exploring Gen AI | ReactJS Developer. https://github.com/hacktronaut

Responses (1)