Corda手动生成节点信息(--just-generate-node-info)强制主机查找

时间:2018-08-08 15:06:15

标签: corda

我正在尝试为我们的云中运行的几个节点生成节点信息文件。我将这些节点放在单独的容器中。我尝试过Corda 3.1和3.2

我使用以下命令:

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

结果是(在节点的日志文件中):

*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:?]*

使用network-bootstapper-corda-3.0.jar,这是正确的,如下所示: https://medium.com/coinmonks/running-corda-dlt-with-kubernetes-3f21c15d4dd8

是否有解决方法,还是应该使用其他方法生成这些文件。

2 个答案:

答案 0 :(得分:0)

我在Windows上工作。我对create NodeInfo manually的解决方法是修改"C:\Windows\System32\drivers\etc"map the hostname to 127.0.0.1

中的主机文件

答案 1 :(得分:0)

感谢乔尔(Joel)指出了有答案的懈怠话题。

只需添加选项: detectPublicIp = false

node.conf中的

阻止IP查找