0

I have developed one sample cordapp. There is a total of 4 nodes(Notary, Dealer, Manufacturer, and HDFC). All the nodes are running successfully apart from the Dealer node. I am getting the below error. I am also sharing the build.gradle file.

error screenshot

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
    nodeDefaults {
        projectCordapp {
            deploy = false
        }
        cordapp project(':contracts')
        cordapp project(':workflows')
    }
    node {
        name "O=Notary,L=London,C=GB"
        notary = [validating : false]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10043")
        }
    }
    node {
        name "O=Dealer,L=London,C=GB"
        p2pPort 10005
        rpcSettings {
            address("localhost:10006")
            adminAddress("localhost:10046")
        }
        rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
    node {
        name "O=Manufacturer,L=New York,C=US"
        p2pPort 10006
        rpcSettings {
            address("localhost:10009")
            adminAddress("localhost:10049")
        }
        rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
    node {
        name "O=HDFC,L=New York,C=US"
        p2pPort 10008
        rpcSettings {
            address("localhost:10012")
            adminAddress("localhost:10052")
        }
        rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
}

2 Answers2

0

You seem to be getting a port binding issue, which means the ports 10046 and 10006 are already in use in your system.

Either change the ports in your node config block in the build.gradle file, or kill the processes running in your port.

Linux

Use below command to find information about process bind to a particular port.

lsof -i :<portNumber>

Use below command to kill the process.

kill <process_id>

Windows

If you are on windows see this SO post to find a kill process on a port: How can you find out which process is listening on a port on Windows?

Wawrzek
  • 462
  • 5
  • 18
Ashutosh Meher
  • 1,650
  • 2
  • 4
  • 14
0
  • Always remember to shutdown your nodes properly by typing bye inside each node terminal (including the notary); otherwise you'll run into your current problem (some Java process is still allocating a port that you require for a certain node).
  • Personally I don't like using runNodes command and its XTerm window; I prefer to do the following:
    1. Browse to a certain node: cd /path-to-project/build/nodes/PartyA
    2. Start the node: java -jar corda.jar
    3. To shutdown the node: bye
Adel Rustum
  • 2,436
  • 2
  • 3
  • 14