0
votes

Currently I am working on a corda project with 3+1 (notary node) and spring boot webserver for RPC RESTAPIs on windows. Now I want to deploy these node on a ubuntu VM and the spring boot project as well. As of now I am running deploynode gradle task to generate the nodes. So while deploying the nodes on different machines how do we do? And how do we integrate ans deploy the corresponding spring webserver? Can someone explain with detail description.enter image description here

1
this requires lots of explanation please follow this link docs.corda.net/deploying-a-node.htmlmanish
@SrikanthVarma A how did you deploy the spring serverwandos
@wandos deployment of spring server is as usual the way we do it for normal spring boot web applications. Once you write your nodeRPCconnection class and starter call. Generate .war/.jar (based on your requirement) with the appropriate application.properties. then deploy that .jar/.war file. Hope this helps. Thanks.SrikanthVarma A
@SrikanthVarmaA thank you for your reply, did you deploy it on the node itself or a different server and connects to the node?wandos
@SrikanthVarmaA Were you able to deploy the spring server?laplace

1 Answers

0
votes

There are few methods to install and run Corda nodes in a network on different machines.

Below are some steps on how to setup corda nodes using cordite Network Map service.

Pre-reqs :

  • Node directories in respective machines. So in your case, it is 4 folders including notary in respective machines. (Node directories can be found after ./gradlew clean deploynodes in /build/nodes)

  • Cordite NetworkMap service

Running Cordite nw map service :

Please refer https://gitlab.com/cordite/network-map-service/blob/master/FAQ.md for more details.

  • Docker Method.
    • docker run -p 8080:8080 -e NMS_STORAGE_TYPE=file cordite/network-map

Steps to register and run Nodes :

    1. Get into notary directory
      • 1a. Remove unnecessary folders formed by deploy task

        rm -rf network-parameters nodeInfo-* persistence.mv.db certificates additional-node-infos

      • 1b. Edit node.conf to provide compatability zone (where network app is installed) , add below lines in node.conf assuming that network map is running in 8080 and devMode=true

        compatibilityZoneURL="http://localhost:8080" devModeOptions.allowCompatibilityZone=true

      • 1c . Change p2p adress of node in node.conf to where the node is hosted

        p2pAddress="hostip:port"

      • 1d . Perform an initial registration of node

        java -jar corda.jar --initial-registration --network-root-truststore ~/tmp/network-truststore.jks --network-root-truststore-password trustpass

    1. Designate notary
      • 2a. Change directory to notary node
      • 2b. Get the token to access the api

        TOKEN=`curl -X POST "http://localhost:8080//admin/api/login" -H "accept: text/plain" -H "Content-Type: application/json" -d "{ \"user\": \"sa\", \"password\": \"admin\"}"`

      • 2c. Assign nodeInfo to a variable

        NODEINFO=`ls nodeInfo*`

      • 2d. Inovke the endpoint which designates this node as notary (below is endpoint for non-validating notary)

        curl -X POST -H "Authorization: Bearer $TOKEN" -H "accept: text/plain" -H "Content-Type: application/octet-stream" --data-binary @$NODEINFO http://localhost:8080//admin/api/notaries/validating

      • Stop the notary, execute below in node shell (node will automatically stop if it is 4.0)

        bye

      • Delete the network parameters as it is changed

        rm network-parameters

      • Start the node again

        java -jar corda.jar

    1. Register and start other nodes
      • Repeat steps 1a-1c for each node to register the node.
      • Start the node

        java -jar corda.jar

    1. Check out network map if nodes are registered.
      • In browser open localost:8080/