corda generating node info manually (--just-generate-node-info) forces host lookup

懵懂的女人 提交于 2019-12-25 02:24:11

问题


I am trying to generating node-info files for a few nodes running in our cloud. I bring up these nodes within separate containers. I have tried corda 3.1 and 3.2

I use the command:

java -jar corda.jar --just-generate-node-info

The result is (in the log file of the node):

*java.net.UnknownHostException: controllercontainer
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_172]
        at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source) ~[?:1.8.0_172]
        at java.net.InetAddress.getAddressesFromNameService(Unknown Source) ~[?:1.8.0_172]
        at java.net.InetAddress.getAllByName0(Unknown Source) ~[?:1.8.0_172]
        at java.net.InetAddress.getAllByName(Unknown Source) ~[?:1.8.0_172]
        at java.net.InetAddress.getAllByName(Unknown Source) ~[?:1.8.0_172]
        at java.net.InetAddress.getByName(Unknown Source) ~[?:1.8.0_172]
        at net.corda.node.utilities.AddressUtils.isPublic(AddressUtils.kt:29) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.Node.tryDetectIfNotPublicHost(Node.kt:265) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.Node.getAdvertisedAddress(Node.kt:251) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.Node.myAddresses(Node.kt:246) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode.updateNodeInfo(AbstractNode.kt:316) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode.access$updateNodeInfo(AbstractNode.kt:105) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode$generateAndSaveNodeInfo$2.invoke(AbstractNode.kt:183) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode$generateAndSaveNodeInfo$2.invoke(AbstractNode.kt:105) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode$initialiseDatabasePersistence$2.invoke(AbstractNode.kt:685) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode$initialiseDatabasePersistence$2.invoke(AbstractNode.kt:105) ~[corda-node-3.2-corda.jar:?]
        at net.corda.nodeapi.internal.persistence.CordaPersistence.inTopLevelTransaction(CordaPersistence.kt:152) ~[corda-node-api-3.2-corda.jar:?]
        at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:138) ~[corda-node-api-3.2-corda.jar:?]
        at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:124) ~[corda-node-api-3.2-corda.jar:?]
        at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:131) ~[corda-node-api-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode.initialiseDatabasePersistence(AbstractNode.kt:684) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.Node.initialiseDatabasePersistence(Node.kt:345) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.AbstractNode.generateAndSaveNodeInfo(AbstractNode.kt:179) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.Node.generateAndSaveNodeInfo(Node.kt:353) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.NodeStartup.startNode(NodeStartup.kt:142) ~[corda-node-3.2-corda.jar:?]
        at net.corda.node.internal.NodeStartup.run(NodeStartup.kt:115) [corda-node-3.2-corda.jar:?]
        at net.corda.node.Corda.main(Corda.kt:13) [corda-node-3.2-corda.jar:?]*

This is true using the network-bootstapper-corda-3.0.jar as outlined here: https://medium.com/coinmonks/running-corda-dlt-with-kubernetes-3f21c15d4dd8

Is there a way around this, or am I supposed to generate these files using a different method.


回答1:


I was working on Windows. My workaround to create NodeInfo manually is modifying hosts file in "C:\Windows\System32\drivers\etc" and map the hostname to 127.0.0.1




回答2:


Thanks to Joel for pointing to the slack thread that had the answer.

Simply adding the option: detectPublicIp=false

in the node.conf prevents IP lookup



来源:https://stackoverflow.com/questions/51750001/corda-generating-node-info-manually-just-generate-node-info-forces-host-look

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!