corda / net.corda.testing.node / MockNodeParameters

MockNodeParameters

data class MockNodeParameters

Immutable builder for configuring a StartedMockNode or an UnstartedMockNode via MockNetwork.createNode and MockNetwork.createUnstartedNode. Kotlin users can also use the named parameters overloads of those methods which are more convenient.

Constructors

<init>

MockNodeParameters(forcedID: Int? = null, legalName: CordaX500Name? = null, entropyRoot: BigInteger = BigInteger.valueOf(random63BitValue()), configOverrides: (NodeConfiguration) -> Any? = {}, extraCordappPackages: List<String> = emptyList())

Immutable builder for configuring a StartedMockNode or an UnstartedMockNode via MockNetwork.createNode and MockNetwork.createUnstartedNode. Kotlin users can also use the named parameters overloads of those methods which are more convenient.

Properties

configOverrides

val configOverrides: (NodeConfiguration) -> Any?

Add/override behaviour of the NodeConfiguration mock object.

entropyRoot

val entropyRoot: BigInteger

the initial entropy value to use when generating keys. Defaults to an (insecure) random value, but can be overridden to cause nodes to have stable or colliding identity/service keys.

extraCordappPackages

val extraCordappPackages: List<String>

Extra CorDapp packages to include for this node.

forcedID

val forcedID: Int?

Override the ID to use for the node. By default node ID's are generated sequentially in a MockNetwork. Specifying the same ID is required if a node is restarted.

legalName

val legalName: CordaX500Name?

The CordaX500Name name to use for the node.

Functions

copy

fun copy(forcedID: Int?, legalName: CordaX500Name?, entropyRoot: BigInteger, configOverrides: (NodeConfiguration) -> Any?): MockNodeParameters

withConfigOverrides

fun withConfigOverrides(configOverrides: (NodeConfiguration) -> Any?): MockNodeParameters

withEntropyRoot

fun withEntropyRoot(entropyRoot: BigInteger): MockNodeParameters

withExtraCordappPackages

fun withExtraCordappPackages(extraCordappPackages: List<String>): MockNodeParameters

withForcedID

fun withForcedID(forcedID: Int?): MockNodeParameters

withLegalName

fun withLegalName(legalName: CordaX500Name?): MockNodeParameters

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.