mirror of
https://github.com/corda/corda.git
synced 2025-05-31 06:31:08 +00:00
[CORDA-1948]: Demobench profile load fails with stack dump -- for Corda OS 3.3 -- branch release-V3 (fix) (#3992)
This commit is contained in:
parent
df343379d2
commit
4822638533
@ -41,7 +41,7 @@ class Explorer internal constructor(private val explorerController: ExplorerCont
|
|||||||
val user = config.nodeConfig.rpcUsers[0]
|
val user = config.nodeConfig.rpcUsers[0]
|
||||||
val p = explorerController.process(
|
val p = explorerController.process(
|
||||||
"--host=localhost",
|
"--host=localhost",
|
||||||
"--port=${config.nodeConfig.rpcAddress.port}",
|
"--port=${config.nodeConfig.rpcSettings.address.port}",
|
||||||
"--username=${user.username}",
|
"--username=${user.username}",
|
||||||
"--password=${user.password}")
|
"--password=${user.password}")
|
||||||
.directory(explorerDir.toFile())
|
.directory(explorerDir.toFile())
|
||||||
|
@ -20,7 +20,7 @@ class InstallFactory : Controller() {
|
|||||||
|
|
||||||
val nodeConfig = config.parseAs<NodeConfig>()
|
val nodeConfig = config.parseAs<NodeConfig>()
|
||||||
nodeConfig.p2pAddress.checkPort()
|
nodeConfig.p2pAddress.checkPort()
|
||||||
nodeConfig.rpcAddress.checkPort()
|
nodeConfig.rpcSettings.address.checkPort()
|
||||||
nodeConfig.webAddress.checkPort()
|
nodeConfig.webAddress.checkPort()
|
||||||
|
|
||||||
val tempDir = Files.createTempDirectory(baseDir, ".node")
|
val tempDir = Files.createTempDirectory(baseDir, ".node")
|
||||||
|
@ -21,8 +21,7 @@ import java.nio.file.StandardCopyOption
|
|||||||
data class NodeConfig(
|
data class NodeConfig(
|
||||||
val myLegalName: CordaX500Name,
|
val myLegalName: CordaX500Name,
|
||||||
val p2pAddress: NetworkHostAndPort,
|
val p2pAddress: NetworkHostAndPort,
|
||||||
val rpcAddress: NetworkHostAndPort,
|
val rpcSettings: NodeRpcSettings,
|
||||||
val rpcAdminAddress: NetworkHostAndPort,
|
|
||||||
/** This is not used by the node but by the webserver which looks at node.conf. */
|
/** This is not used by the node but by the webserver which looks at node.conf. */
|
||||||
val webAddress: NetworkHostAndPort,
|
val webAddress: NetworkHostAndPort,
|
||||||
val notary: NotaryService?,
|
val notary: NotaryService?,
|
||||||
@ -46,8 +45,8 @@ data class NodeConfig(
|
|||||||
|
|
||||||
val config = toConfig()
|
val config = toConfig()
|
||||||
val rpcSettings = empty()
|
val rpcSettings = empty()
|
||||||
.withValue("address", ConfigValueFactory.fromAnyRef(rpcAddress.toString()))
|
.withValue("address", ConfigValueFactory.fromAnyRef(rpcSettings.address.toString()))
|
||||||
.withValue("adminAddress", ConfigValueFactory.fromAnyRef(rpcAdminAddress.toString()))
|
.withValue("adminAddress", ConfigValueFactory.fromAnyRef(rpcSettings.adminAddress.toString()))
|
||||||
.root()
|
.root()
|
||||||
return config.withoutPath("rpcAddress").withoutPath("rpcAdminAddress").withValue("rpcSettings", rpcSettings)
|
return config.withoutPath("rpcAddress").withoutPath("rpcAdminAddress").withValue("rpcSettings", rpcSettings)
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,10 @@ class NodeController(check: atRuntime = ::checkExists) : Controller() {
|
|||||||
country = location.countryCode
|
country = location.countryCode
|
||||||
),
|
),
|
||||||
p2pAddress = nodeData.p2pPort.toLocalAddress(),
|
p2pAddress = nodeData.p2pPort.toLocalAddress(),
|
||||||
rpcAddress = nodeData.rpcPort.toLocalAddress(),
|
rpcSettings = NodeRpcSettings(
|
||||||
rpcAdminAddress = nodeData.rpcAdminPort.toLocalAddress(),
|
address = nodeData.rpcPort.toLocalAddress(),
|
||||||
|
adminAddress = nodeData.rpcAdminPort.toLocalAddress()
|
||||||
|
),
|
||||||
webAddress = nodeData.webPort.toLocalAddress(),
|
webAddress = nodeData.webPort.toLocalAddress(),
|
||||||
notary = notary,
|
notary = notary,
|
||||||
h2port = nodeData.h2Port.value,
|
h2port = nodeData.h2Port.value,
|
||||||
@ -204,7 +206,7 @@ class NodeController(check: atRuntime = ::checkExists) : Controller() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updatePort(config: NodeConfig) {
|
private fun updatePort(config: NodeConfig) {
|
||||||
val nextPort = 1 + arrayOf(config.p2pAddress.port, config.rpcAddress.port, config.webAddress.port, config.h2port).max() as Int
|
val nextPort = 1 + arrayOf(config.p2pAddress.port, config.rpcSettings.address.port, config.webAddress.port, config.h2port).max() as Int
|
||||||
port.getAndUpdate { Math.max(nextPort, it) }
|
port.getAndUpdate { Math.max(nextPort, it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
package net.corda.demobench.model
|
||||||
|
|
||||||
|
import net.corda.core.utilities.NetworkHostAndPort
|
||||||
|
|
||||||
|
data class NodeRpcSettings(
|
||||||
|
val address: NetworkHostAndPort,
|
||||||
|
val adminAddress: NetworkHostAndPort
|
||||||
|
)
|
@ -15,7 +15,7 @@ class NodeRPC(config: NodeConfigWrapper, start: (NodeConfigWrapper, CordaRPCOps)
|
|||||||
val oneSecond = SECONDS.toMillis(1)
|
val oneSecond = SECONDS.toMillis(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val rpcClient = CordaRPCClient(NetworkHostAndPort("localhost", config.nodeConfig.rpcAddress.port))
|
private val rpcClient = CordaRPCClient(NetworkHostAndPort("localhost", config.nodeConfig.rpcSettings.address.port))
|
||||||
private var rpcConnection: CordaRPCConnection? = null
|
private var rpcConnection: CordaRPCConnection? = null
|
||||||
private val timer = Timer()
|
private val timer = Timer()
|
||||||
|
|
||||||
|
@ -88,8 +88,10 @@ class NodeConfigTest {
|
|||||||
return NodeConfig(
|
return NodeConfig(
|
||||||
myLegalName = legalName,
|
myLegalName = legalName,
|
||||||
p2pAddress = localPort(p2pPort),
|
p2pAddress = localPort(p2pPort),
|
||||||
rpcAddress = localPort(rpcPort),
|
rpcSettings = NodeRpcSettings(
|
||||||
rpcAdminAddress = localPort(rpcAdminPort),
|
address = localPort(rpcPort),
|
||||||
|
adminAddress = localPort(rpcAdminPort)
|
||||||
|
),
|
||||||
webAddress = localPort(webPort),
|
webAddress = localPort(webPort),
|
||||||
h2port = h2port,
|
h2port = h2port,
|
||||||
notary = notary,
|
notary = notary,
|
||||||
|
@ -163,8 +163,10 @@ class NodeControllerTest {
|
|||||||
country = "US"
|
country = "US"
|
||||||
),
|
),
|
||||||
p2pAddress = localPort(p2pPort),
|
p2pAddress = localPort(p2pPort),
|
||||||
rpcAddress = localPort(rpcPort),
|
rpcSettings = NodeRpcSettings(
|
||||||
rpcAdminAddress = localPort(rpcAdminPort),
|
address = localPort(rpcPort),
|
||||||
|
adminAddress = localPort(rpcAdminPort)
|
||||||
|
),
|
||||||
webAddress = localPort(webPort),
|
webAddress = localPort(webPort),
|
||||||
h2port = h2port,
|
h2port = h2port,
|
||||||
notary = notary,
|
notary = notary,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user