@DoNotImplement public DriverDSL
Underlying interface for the driver DSL. Do not instantiate directly, instead use the driver
function.
driver
@NotNull java.util.List<net.corda.testing.driver.NotaryHandle> getNotaryHandles()
Returns a list of class NotaryHandle
s matching the list of class NotarySpec
s passed into driver
.
class NotaryHandle
,
class NotarySpec
,
driver
@NotNull NotaryHandle getDefaultNotaryHandle()
Returns the class NotaryHandle
for the single notary on the network. Throws if there are none or more than one.
class NotaryHandle
,
notaryHandles
@NotNull Party getDefaultNotaryIdentity()
Returns the identity of the single notary on the network. Throws if there are none or more than one.
defaultNotaryHandle
@NotNull CordaFuture<net.corda.testing.driver.NodeHandle> getDefaultNotaryNode()
Returns a interface CordaFuture
on the interface NodeHandle
for the single-node notary on the network. Throws if there
are no notaries or more than one, or if the notary is a distributed cluster.
@NotNull CordaFuture<net.corda.testing.driver.NodeHandle> startNode()
Start a node using the default values of class NodeParameters
.
interface CordaFuture
on the interface NodeHandle
to the node. The future will complete when the node is available and
it sees all previously started nodes, including the notaries.class NodeParameters
@NotNull CordaFuture<net.corda.testing.driver.NodeHandle> startNode(@NotNull NodeParameters parameters)
Start a node using the parameter values of the given class NodeParameters
.
parameters
- The node parameters.interface CordaFuture
on the interface NodeHandle
to the node. The future will complete when the node is available and
it sees all previously started nodes, including the notaries.class NodeParameters
@NotNull CordaFuture<net.corda.testing.driver.NodeHandle> startNode(@NotNull NodeParameters defaultParameters, @Nullable CordaX500Name providedName, @NotNull java.util.List<net.corda.testing.node.User> rpcUsers, @NotNull VerifierType verifierType, @NotNull java.util.Map<java.lang.String,? extends java.lang.Object> customOverrides, @Nullable java.lang.Boolean startInSameProcess, @NotNull java.lang.String maximumHeapSize, @Nullable java.lang.String logLevelOverride)
Start a node.
NOTE: This method does not provide all the node parameters that are available and only exists for backwards compatibility. It is
recommended you use class NodeParameters
.
defaultParameters
- The default parameters for the node. If any of the remaining parameters to this method are specified thentheir values are taken instead of the corresponding value in defaultParameters
.providedName
- Optional name of the node, which will be its legal name in class Party
. Defaults to something random. Note that this must be unique as the driver uses it as a primary key!rpcUsers
- List of users who are authorised to use the RPC system. Defaults to empty list.verifierType
- The type of transaction verifier to use. See: enum VerifierType
.customOverrides
- A map of custom node configuration overrides.startInSameProcess
- Determines if the node should be started inside the same process the Driver is running in. If null the Driver-level value will be used.maximumHeapSize
- The maximum JVM heap size to use for the node as a String. By default a number is interpreted as being in bytes. Append the letter 'k' or 'K' to the value to indicate Kilobytes, 'm' or 'M' to indicate megabytes, and 'g' or 'G' to indicate gigabytes. The default value is "512m" = 512 megabytes.logLevelOverride
- log4j log level used to override the default value of info.interface CordaFuture
on the interface NodeHandle
to the node. The future will complete when the node is available and
it sees all previously started nodes, including the notaries.class NodeParameters
@NotNull CordaFuture<net.corda.testing.driver.NodeHandle> startNode(@NotNull NodeParameters defaultParameters, @Nullable CordaX500Name providedName, @NotNull java.util.List<net.corda.testing.node.User> rpcUsers, @NotNull VerifierType verifierType, @NotNull java.util.Map<java.lang.String,? extends java.lang.Object> customOverrides, @Nullable java.lang.Boolean startInSameProcess, @NotNull java.lang.String maximumHeapSize)
Start a node.
NOTE: This method does not provide all the node parameters that are available and only exists for backwards compatibility. It is
recommended you use class NodeParameters
.
defaultParameters
- The default parameters for the node. If any of the remaining parameters to this method are specified thentheir values are taken instead of the corresponding value in defaultParameters
.providedName
- Optional name of the node, which will be its legal name in class Party
. Defaults to something random. Note that this must be unique as the driver uses it as a primary key!rpcUsers
- List of users who are authorised to use the RPC system. Defaults to empty list.verifierType
- The type of transaction verifier to use. See: enum VerifierType
.customOverrides
- A map of custom node configuration overrides.startInSameProcess
- Determines if the node should be started inside the same process the Driver is running in. If null the Driver-level value will be used.maximumHeapSize
- The maximum JVM heap size to use for the node as a String. By default a number is interpreted as being in bytes. Append the letter 'k' or 'K' to the value to indicate Kilobytes, 'm' or 'M' to indicate megabytes, and 'g' or 'G' to indicate gigabytes. The default value is "512m" = 512 megabytes.interface CordaFuture
on the interface NodeHandle
to the node. The future will complete when the node is available and
it sees all previously started nodes, including the notaries.class NodeParameters
@NotNull CordaFuture<net.corda.testing.driver.WebserverHandle> startWebserver(@NotNull NodeHandle handle)
Call startWebserver
with a default maximumHeapSize.
startWebserver
@NotNull CordaFuture<net.corda.testing.driver.WebserverHandle> startWebserver(@NotNull NodeHandle handle, @NotNull java.lang.String maximumHeapSize)
Starts a web server for a node
handle
- The handle for the node that this webserver connects to via RPC.maximumHeapSize
- Argument for JVM -Xmx option e.g. "200m".@NotNull java.nio.file.Path baseDirectory(@NotNull CordaX500Name nodeName)
Returns the base directory for a node with the given class CordaX500Name
. This method is useful if the base directory
is needed before the node is started.
class CordaX500Name
int nextPort()
Returns the next port to use when instantiating test processes that must not conflict on the same machine