mirror of
https://github.com/corda/corda.git
synced 2025-06-22 17:09:00 +00:00
Permissioning server: added new node properties in node config for certificate signing request
This commit is contained in:
@ -31,9 +31,12 @@ interface NodeSSLConfiguration {
|
|||||||
|
|
||||||
interface NodeConfiguration : NodeSSLConfiguration {
|
interface NodeConfiguration : NodeSSLConfiguration {
|
||||||
val myLegalName: String
|
val myLegalName: String
|
||||||
val exportJMXto: String
|
|
||||||
val nearestCity: String
|
val nearestCity: String
|
||||||
|
val emailAddress: String
|
||||||
|
val exportJMXto: String
|
||||||
val dataSourceProperties: Properties get() = Properties()
|
val dataSourceProperties: Properties get() = Properties()
|
||||||
|
val devMode: Boolean
|
||||||
|
val certificateSigningService: HostAndPort
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val log = LoggerFactory.getLogger("NodeConfiguration")
|
val log = LoggerFactory.getLogger("NodeConfiguration")
|
||||||
@ -74,6 +77,19 @@ operator fun <T> Config.getValue(receiver: Any, metadata: KProperty<*>): T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper class for optional configurations
|
||||||
|
*/
|
||||||
|
class OptionalConfig<out T>(val conf: Config, val lambda: () -> T) {
|
||||||
|
operator fun getValue(receiver: Any, metadata: KProperty<*>): T {
|
||||||
|
return if (conf.hasPath(metadata.name)) conf.getValue(receiver, metadata) else lambda()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> Config.getOrElse(lambda: () -> T): OptionalConfig<T> {
|
||||||
|
return OptionalConfig(this, lambda)
|
||||||
|
}
|
||||||
|
|
||||||
fun Config.getProperties(path: String): Properties {
|
fun Config.getProperties(path: String): Properties {
|
||||||
val obj = this.getObject(path)
|
val obj = this.getObject(path)
|
||||||
val props = Properties()
|
val props = Properties()
|
||||||
@ -85,21 +101,27 @@ fun Config.getProperties(path: String): Properties {
|
|||||||
|
|
||||||
class NodeConfigurationFromConfig(val config: Config = ConfigFactory.load()) : NodeConfiguration {
|
class NodeConfigurationFromConfig(val config: Config = ConfigFactory.load()) : NodeConfiguration {
|
||||||
override val myLegalName: String by config
|
override val myLegalName: String by config
|
||||||
override val exportJMXto: String by config
|
|
||||||
override val nearestCity: String by config
|
override val nearestCity: String by config
|
||||||
|
override val emailAddress: String by config
|
||||||
|
override val exportJMXto: String by config
|
||||||
override val keyStorePassword: String by config
|
override val keyStorePassword: String by config
|
||||||
override val trustStorePassword: String by config
|
override val trustStorePassword: String by config
|
||||||
override val dataSourceProperties: Properties by config
|
override val dataSourceProperties: Properties by config
|
||||||
|
override val devMode: Boolean by config.getOrElse { false }
|
||||||
|
override val certificateSigningService: HostAndPort by config
|
||||||
}
|
}
|
||||||
|
|
||||||
class FullNodeConfiguration(conf: Config) : NodeConfiguration {
|
class FullNodeConfiguration(conf: Config) : NodeConfiguration {
|
||||||
val basedir: Path by conf
|
val basedir: Path by conf
|
||||||
override val myLegalName: String by conf
|
override val myLegalName: String by conf
|
||||||
override val nearestCity: String by conf
|
override val nearestCity: String by conf
|
||||||
|
override val emailAddress: String by conf
|
||||||
override val exportJMXto: String = "http"
|
override val exportJMXto: String = "http"
|
||||||
override val keyStorePassword: String by conf
|
override val keyStorePassword: String by conf
|
||||||
override val trustStorePassword: String by conf
|
override val trustStorePassword: String by conf
|
||||||
override val dataSourceProperties: Properties by conf
|
override val dataSourceProperties: Properties by conf
|
||||||
|
override val devMode: Boolean by conf.getOrElse { false }
|
||||||
|
override val certificateSigningService: HostAndPort by conf
|
||||||
val useHTTPS: Boolean by conf
|
val useHTTPS: Boolean by conf
|
||||||
val artemisAddress: HostAndPort by conf
|
val artemisAddress: HostAndPort by conf
|
||||||
val webAddress: HostAndPort by conf
|
val webAddress: HostAndPort by conf
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
myLegalName = "Vast Global MegaCorp, Ltd"
|
myLegalName = "Vast Global MegaCorp, Ltd"
|
||||||
exportJMXto = "http"
|
|
||||||
nearestCity = "The Moon"
|
nearestCity = "The Moon"
|
||||||
|
emailAddress = "admin@company.com"
|
||||||
|
exportJMXto = "http"
|
||||||
keyStorePassword = "cordacadevpass"
|
keyStorePassword = "cordacadevpass"
|
||||||
trustStorePassword = "trustpass"
|
trustStorePassword = "trustpass"
|
||||||
dataSourceProperties = {
|
dataSourceProperties = {
|
||||||
@ -9,4 +10,6 @@ dataSourceProperties = {
|
|||||||
"dataSource.user" = sa
|
"dataSource.user" = sa
|
||||||
"dataSource.password" = ""
|
"dataSource.password" = ""
|
||||||
}
|
}
|
||||||
|
devMode = true
|
||||||
|
certificateSigningService = "localhost:0"
|
||||||
useHTTPS = false
|
useHTTPS = false
|
@ -28,12 +28,19 @@ class ArtemisMessagingTests {
|
|||||||
val hostAndPort = freeLocalHostAndPort()
|
val hostAndPort = freeLocalHostAndPort()
|
||||||
val topic = "platform.self"
|
val topic = "platform.self"
|
||||||
val identity = generateKeyPair()
|
val identity = generateKeyPair()
|
||||||
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
val config = object : NodeConfiguration {
|
val config = object : NodeConfiguration {
|
||||||
|
|
||||||
override val myLegalName: String = "me"
|
override val myLegalName: String = "me"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "London"
|
override val nearestCity: String = "London"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "testpass"
|
override val keyStorePassword: String = "testpass"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var messagingClient: NodeMessagingClient? = null
|
var messagingClient: NodeMessagingClient? = null
|
||||||
|
@ -58,13 +58,20 @@ fun main(args: Array<String>) {
|
|||||||
// Bring up node.
|
// Bring up node.
|
||||||
val advertisedServices: Set<ServiceType> = emptySet()
|
val advertisedServices: Set<ServiceType> = emptySet()
|
||||||
val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg))
|
val myNetAddr = HostAndPort.fromString(options.valueOf(networkAddressArg))
|
||||||
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
val config = object : NodeConfiguration {
|
val config = object : NodeConfiguration {
|
||||||
|
|
||||||
override val myLegalName: String = "Rate fix demo node"
|
override val myLegalName: String = "Rate fix demo node"
|
||||||
override val exportJMXto: String = "http"
|
|
||||||
override val nearestCity: String = "Atlantis"
|
override val nearestCity: String = "Atlantis"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = "http"
|
||||||
override val keyStorePassword: String = "cordacadevpass"
|
override val keyStorePassword: String = "cordacadevpass"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
override val dataSourceProperties: Properties = makeTestDataSourceProperties()
|
override val dataSourceProperties: Properties = makeTestDataSourceProperties()
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val apiAddr = HostAndPort.fromParts(myNetAddr.hostText, myNetAddr.port + 1)
|
val apiAddr = HostAndPort.fromParts(myNetAddr.hostText, myNetAddr.port + 1)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package com.r3corda.simulation
|
package com.r3corda.simulation
|
||||||
|
|
||||||
|
import com.google.common.net.HostAndPort
|
||||||
import com.google.common.util.concurrent.Futures
|
import com.google.common.util.concurrent.Futures
|
||||||
import com.google.common.util.concurrent.ListenableFuture
|
import com.google.common.util.concurrent.ListenableFuture
|
||||||
import com.r3corda.core.messaging.SingleMessageRecipient
|
import com.r3corda.core.messaging.SingleMessageRecipient
|
||||||
import com.r3corda.core.node.CityDatabase
|
import com.r3corda.core.node.CityDatabase
|
||||||
import com.r3corda.core.node.NodeInfo
|
|
||||||
import com.r3corda.core.node.PhysicalLocation
|
import com.r3corda.core.node.PhysicalLocation
|
||||||
import com.r3corda.core.node.services.ServiceType
|
import com.r3corda.core.node.services.ServiceType
|
||||||
import com.r3corda.core.protocols.ProtocolLogic
|
import com.r3corda.core.protocols.ProtocolLogic
|
||||||
@ -14,7 +14,6 @@ import com.r3corda.demos.api.NodeInterestRates
|
|||||||
import com.r3corda.node.services.config.NodeConfiguration
|
import com.r3corda.node.services.config.NodeConfiguration
|
||||||
import com.r3corda.node.services.network.NetworkMapService
|
import com.r3corda.node.services.network.NetworkMapService
|
||||||
import com.r3corda.node.services.transactions.SimpleNotaryService
|
import com.r3corda.node.services.transactions.SimpleNotaryService
|
||||||
import com.r3corda.node.utilities.AddOrRemove
|
|
||||||
import com.r3corda.testing.node.InMemoryMessagingNetwork
|
import com.r3corda.testing.node.InMemoryMessagingNetwork
|
||||||
import com.r3corda.testing.node.MockNetwork
|
import com.r3corda.testing.node.MockNetwork
|
||||||
import com.r3corda.testing.node.TestClock
|
import com.r3corda.testing.node.TestClock
|
||||||
@ -58,13 +57,19 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean,
|
|||||||
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
||||||
val letter = 'A' + counter
|
val letter = 'A' + counter
|
||||||
val city = bankLocations[counter++ % bankLocations.size]
|
val city = bankLocations[counter++ % bankLocations.size]
|
||||||
val cfg = object : com.r3corda.node.services.config.NodeConfiguration {
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
|
val cfg = object : NodeConfiguration {
|
||||||
|
|
||||||
// TODO: Set this back to "Bank of $city" after video day.
|
// TODO: Set this back to "Bank of $city" after video day.
|
||||||
override val myLegalName: String = "Bank $letter"
|
override val myLegalName: String = "Bank $letter"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = city
|
override val nearestCity: String = city
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
return SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair)
|
return SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair)
|
||||||
}
|
}
|
||||||
@ -76,15 +81,20 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean,
|
|||||||
val bankFactory = BankFactory()
|
val bankFactory = BankFactory()
|
||||||
|
|
||||||
object NetworkMapNodeFactory : MockNetwork.Factory {
|
object NetworkMapNodeFactory : MockNetwork.Factory {
|
||||||
override fun create(dir: Path, config: com.r3corda.node.services.config.NodeConfiguration, network: MockNetwork,
|
override fun create(dir: Path, config: NodeConfiguration, network: MockNetwork,
|
||||||
networkMapAddr: SingleMessageRecipient?, advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
networkMapAddr: SingleMessageRecipient?, advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
||||||
require(advertisedServices.contains(com.r3corda.node.services.network.NetworkMapService.Type))
|
require(advertisedServices.contains(NetworkMapService.Type))
|
||||||
val cfg = object : com.r3corda.node.services.config.NodeConfiguration {
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
|
val cfg = object : NodeConfiguration {
|
||||||
override val myLegalName: String = "Network coordination center"
|
override val myLegalName: String = "Network coordination center"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "Amsterdam"
|
override val nearestCity: String = "Amsterdam"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
return object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {}
|
return object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {}
|
||||||
@ -92,30 +102,40 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean,
|
|||||||
}
|
}
|
||||||
|
|
||||||
object NotaryNodeFactory : MockNetwork.Factory {
|
object NotaryNodeFactory : MockNetwork.Factory {
|
||||||
override fun create(dir: Path, config: com.r3corda.node.services.config.NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
override fun create(dir: Path, config: NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
||||||
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
||||||
require(advertisedServices.contains(com.r3corda.node.services.transactions.SimpleNotaryService.Type))
|
require(advertisedServices.contains(SimpleNotaryService.Type))
|
||||||
val cfg = object : com.r3corda.node.services.config.NodeConfiguration {
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
|
val cfg = object : NodeConfiguration {
|
||||||
override val myLegalName: String = "Notary Service"
|
override val myLegalName: String = "Notary Service"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "Zurich"
|
override val nearestCity: String = "Zurich"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
return SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair)
|
return SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object RatesOracleFactory : MockNetwork.Factory {
|
object RatesOracleFactory : MockNetwork.Factory {
|
||||||
override fun create(dir: Path, config: com.r3corda.node.services.config.NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
override fun create(dir: Path, config: NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
||||||
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
||||||
require(advertisedServices.contains(NodeInterestRates.Type))
|
require(advertisedServices.contains(NodeInterestRates.Type))
|
||||||
val cfg = object : com.r3corda.node.services.config.NodeConfiguration {
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
|
val cfg = object : NodeConfiguration {
|
||||||
override val myLegalName: String = "Rates Service Provider"
|
override val myLegalName: String = "Rates Service Provider"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "Madrid"
|
override val nearestCity: String = "Madrid"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
return object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {
|
return object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {
|
||||||
@ -129,14 +149,19 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean,
|
|||||||
}
|
}
|
||||||
|
|
||||||
object RegulatorFactory : MockNetwork.Factory {
|
object RegulatorFactory : MockNetwork.Factory {
|
||||||
override fun create(dir: Path, config: com.r3corda.node.services.config.NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
override fun create(dir: Path, config: NodeConfiguration, network: MockNetwork, networkMapAddr: SingleMessageRecipient?,
|
||||||
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
advertisedServices: Set<ServiceType>, id: Int, keyPair: KeyPair?): MockNetwork.MockNode {
|
||||||
val cfg = object : com.r3corda.node.services.config.NodeConfiguration {
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
|
val cfg = object : NodeConfiguration {
|
||||||
override val myLegalName: String = "Regulator A"
|
override val myLegalName: String = "Regulator A"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "Paris"
|
override val nearestCity: String = "Paris"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
val n = object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {
|
val n = object : SimulatedNode(dir, cfg, network, networkMapAddr, advertisedServices, id, keyPair) {
|
||||||
@ -151,9 +176,9 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean,
|
|||||||
val network = MockNetwork(networkSendManuallyPumped, runAsync)
|
val network = MockNetwork(networkSendManuallyPumped, runAsync)
|
||||||
// This one must come first.
|
// This one must come first.
|
||||||
val networkMap: SimulatedNode
|
val networkMap: SimulatedNode
|
||||||
= network.createNode(null, nodeFactory = NetworkMapNodeFactory, advertisedServices = com.r3corda.node.services.network.NetworkMapService.Type) as SimulatedNode
|
= network.createNode(null, nodeFactory = NetworkMapNodeFactory, advertisedServices = NetworkMapService.Type) as SimulatedNode
|
||||||
val notary: SimulatedNode
|
val notary: SimulatedNode
|
||||||
= network.createNode(networkMap.info.address, nodeFactory = NotaryNodeFactory, advertisedServices = com.r3corda.node.services.transactions.SimpleNotaryService.Type) as SimulatedNode
|
= network.createNode(networkMap.info.address, nodeFactory = NotaryNodeFactory, advertisedServices = SimpleNotaryService.Type) as SimulatedNode
|
||||||
val regulators: List<SimulatedNode> = listOf(network.createNode(networkMap.info.address, start = false, nodeFactory = RegulatorFactory) as SimulatedNode)
|
val regulators: List<SimulatedNode> = listOf(network.createNode(networkMap.info.address, start = false, nodeFactory = RegulatorFactory) as SimulatedNode)
|
||||||
val ratesOracle: SimulatedNode
|
val ratesOracle: SimulatedNode
|
||||||
= network.createNode(networkMap.info.address, start = false, nodeFactory = RatesOracleFactory, advertisedServices = NodeInterestRates.Type) as SimulatedNode
|
= network.createNode(networkMap.info.address, start = false, nodeFactory = RatesOracleFactory, advertisedServices = NodeInterestRates.Type) as SimulatedNode
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.r3corda.testing.node
|
package com.r3corda.testing.node
|
||||||
|
|
||||||
import com.google.common.jimfs.Jimfs
|
import com.google.common.jimfs.Jimfs
|
||||||
|
import com.google.common.net.HostAndPort
|
||||||
import com.google.common.util.concurrent.Futures
|
import com.google.common.util.concurrent.Futures
|
||||||
import com.google.common.util.concurrent.ListenableFuture
|
import com.google.common.util.concurrent.ListenableFuture
|
||||||
import com.google.common.util.concurrent.SettableFuture
|
import com.google.common.util.concurrent.SettableFuture
|
||||||
@ -168,13 +169,19 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,
|
|||||||
val path = filesystem.getPath("/nodes/$id")
|
val path = filesystem.getPath("/nodes/$id")
|
||||||
if (newNode)
|
if (newNode)
|
||||||
Files.createDirectories(path.resolve("attachments"))
|
Files.createDirectories(path.resolve("attachments"))
|
||||||
|
|
||||||
|
// TODO: create a base class that provides a default implementation
|
||||||
val config = object : NodeConfiguration {
|
val config = object : NodeConfiguration {
|
||||||
|
|
||||||
override val myLegalName: String = legalName ?: "Mock Company $id"
|
override val myLegalName: String = legalName ?: "Mock Company $id"
|
||||||
override val exportJMXto: String = ""
|
|
||||||
override val nearestCity: String = "Atlantis"
|
override val nearestCity: String = "Atlantis"
|
||||||
|
override val emailAddress: String = ""
|
||||||
|
override val devMode: Boolean = true
|
||||||
|
override val exportJMXto: String = ""
|
||||||
override val keyStorePassword: String = "dummy"
|
override val keyStorePassword: String = "dummy"
|
||||||
override val trustStorePassword: String = "trustpass"
|
override val trustStorePassword: String = "trustpass"
|
||||||
override val dataSourceProperties: Properties get() = if (databasePersistence) makeTestDataSourceProperties("node_$id") else Properties()
|
override val dataSourceProperties: Properties get() = if (databasePersistence) makeTestDataSourceProperties("node_$id") else Properties()
|
||||||
|
override val certificateSigningService: HostAndPort = HostAndPort.fromParts("localhost", 0)
|
||||||
}
|
}
|
||||||
val node = nodeFactory.create(path, config, this, networkMapAddress, advertisedServices.toSet(), id, keyPair)
|
val node = nodeFactory.create(path, config, this, networkMapAddress, advertisedServices.toSet(), id, keyPair)
|
||||||
if (start) {
|
if (start) {
|
||||||
|
Reference in New Issue
Block a user