Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerForm task generates invalid corda nodeInfo objects? #400

Open
davidawad opened this issue Mar 17, 2021 · 2 comments
Open

dockerForm task generates invalid corda nodeInfo objects? #400

davidawad opened this issue Mar 17, 2021 · 2 comments

Comments

@davidawad
Copy link

I have a config for Party C (in this case) that I'm running through the dockerForm task.

node {
   name "O=PartyC,L=New York,C=US"
   p2pPort 10004
   p2pAddress "34.239.158.190"
   rpcSettings {
       address("0.0.0.0:10014")
       adminAddress("0.0.0.0:10044")
   }
   sshdPort 2224
   rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}

When I used this config on my local machine to generate a config to be run on ANOTHER machine, I noticed that the the node-info file generated expects all docker containers to be on the same machine.

If we look at the additional node info struct on the other side we get something like this which contains the invalid hostname of partyc, but in fact if this node config folder was copied onto another machine it can't resolve.

$java -jar corda-tools-blob-inspector-4.7.jar additional-node-infos/nodeInfo-2D1CA190724B008EF2466321520ABFD47CE0A9EC94FE17B034DE975A056082F3
net.corda.nodeapi.internal.SignedNodeInfo
---
raw:
  class: "net.corda.core.node.NodeInfo"
  deserialized:
    addresses:
    - "partyc:10004"
    legalIdentitiesAndCerts:
    - "O=PartyC, L=New York, C=US"
    platformVersion: 8
    serial: 1616002976601
signatures:
- !!binary |-
  P3VG+gyQ4909whdsoENUwaAhwiYt+mqJE+5PK+7aE9wOlIoFWUy9GMoMVjATLLLQeFNDVGi7tJT2\nNijpDYkQAw==

note that there's a partyc as the hostname and not the actual IP I provided in the p2pAddress.

@davidawad davidawad changed the title dockerForm task generates an invalid corda nodeInfo objects? dockerForm task generates invalid corda nodeInfo objects? Mar 25, 2021
@chrisr3
Copy link
Contributor

chrisr3 commented Apr 4, 2021

This seems to be a deliberate consequence of the following lines in Node.installDockerConfig():

val dockerConf = config
        .withValue("p2pAddress", ConfigValueFactory.fromAnyRef("$containerName:$p2pPort"))
        .withValue("rpcSettings.address", ConfigValueFactory.fromAnyRef("$containerName:${rpcSettings.port}"))
        .withValue("rpcSettings.adminAddress", ConfigValueFactory.fromAnyRef("$containerName:${rpcSettings.adminPort}"))
        ...

so partyc is the container name and not the hostname.

@palade
Copy link
Contributor

palade commented Apr 6, 2021

docker-compose relies on aliases to map the containers to IP addresses internally (https://docs.docker.com/compose/networking/). However you should still be able to run the nodes using their generated Dockerform configuration on another machine. The host paths need to be updated in docker-compose.yml file because absolute file paths are used to map content from host to the container. Other than this update the configuration should be same. Make sure that the nodes is the same as on the machine where it was generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants