How to setup a Corda Network using CENM tool (Part 2)

karthik Ganti
3 min readJan 23, 2023

--

In the previous article we have seen how to setup a corda network using CENM tool. If you haven’t set it up yet then please go through the first part https://raokarthik83.medium.com/how-to-setup-a-corda-network-using-cenm-tool-55282660d2d0

Now we will be adding new nodes to the network. Let’s first look at our existing network structure.

cenm network staging directory
CENM network staging directory
Network map snapshot from notary

I am using enterprise corda-4.8.jar. If you want to use open source version then you can go with it. You can download the open source version here → https://repo1.maven.org/maven2/net/corda/corda/4.8/

So, we will be adding two new nodes to the network —PartyA and PartyB.

Following are the steps required for the node setup:

  1. Create new staging directory
  2. Place network root trust-store and corda.jar in the staging directory.
  3. Create node.conf
  4. Run initial registration from the staging directory.
  5. Run the node.

Setup PartyA:

  1. Create a staging directory for PartyA.
mkdir PartyA
cd PartyA

2. Copy network root trust-store from pki folder to PartyA staging directory. Also place corda.jar in the staging directory. I am using corda-4.8 enterprise jar.

cp ../pki/trust-stores/network-root-truststore.jks .
PartyA staging directory

3. Create node.conf for PartyA

myLegalName="O=PartyA,L=London,C=GB"

networkServices {
doormanURL="http://localhost:10000"
networkMapURL="http://localhost:20000"
}

devMode = false

sshd {
port = 2226
}

p2pAddress="localhost:7000"
rpcUsers=[
{
user=testuser
password=password
permissions=[
ALL
]
}
]

rpcSettings {
address = "localhost:7001"
adminAddress = "localhost:7002"
}

4. Run initial registration for PartyA

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

5. Run the node

java -jar corda-4.8.jar
Run PartyA Node

Setup PartyB:

  1. Create a staging directory for PartyB
mkdir PartyB
cd PartyB

2. Copy network root trust-store and corda.jar to the staging directory.

cp ../pki/trust-stores/network-root-truststore.jks .

3. Create node.conf for PartyB

myLegalName="O=PartyB,L=London,C=GB"

networkServices {
doormanURL="http://localhost:10000"
networkMapURL="http://localhost:20000"
}

devMode = false

sshd {
port = 2225
}

p2pAddress="localhost:8000"
rpcUsers=[
{
user=testuser
password=password
permissions=[
ALL
]
}
]

rpcSettings {
address = "localhost:8001"
adminAddress = "localhost:8002"
}

4. Run initial registration

java -jar corda-4.8.jar --initial-registration --network-root-truststore-password trustpass --network-root-truststore network-root-truststore.jks
PartyB directory after initial registration

5. Run the node

java -jar corda-4.8.jar
Run PartyB node

Okay so, we have completed the node setup. Let’s confirm the setup by checking the network map snapshot at PartyB.

Login to PartyB crash shell

NOTE: Password is password

ssh -p 2225 localhost -l testuser
Party B Crash shell

This concludes the corda network setup using CENM.

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