DriverDSL
Keywords: net.corda.testing.driver.DriverDSL interface
Date: 2023-09-18

net.corda.testing.driver

## Interface DriverDSL

-     @DoNotImplement
      public DriverDSL

  Underlying interface for the driver DSL. Do not instantiate directly, instead use the `driver` function.

  See Also:
    `driver`

- - ### Constructor Detail

    - #### DriverDSL

          public DriverDSL()

  - ### Method Detail

    - #### getNotaryHandles

          @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`.

      See Also:
        `class NotaryHandle`, `class NotarySpec`, `driver`

    - #### getDefaultNotaryHandle

          @NotNull
          NotaryHandle getDefaultNotaryHandle()

      Returns the `class NotaryHandle` for the single notary on the network. Throws if there are none or more than one.

      See Also:
        `class NotaryHandle`, `notaryHandles`

    - #### getDefaultNotaryIdentity

          @NotNull
          Party getDefaultNotaryIdentity()

      Returns the identity of the single notary on the network. Throws if there are none or more than one.

      See Also:
        `defaultNotaryHandle`

    - #### getDefaultNotaryNode

          @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.

      See Also:
        `interface CordaFuture`, `interface NodeHandle`, `defaultNotaryHandle`, `notaryHandles`

    - #### startNode

          @NotNull
          CordaFuture<net.corda.testing.driver.NodeHandle> startNode()

      Start a node using the default values of `class NodeParameters`.

      Returns:
        A `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.
      See Also:
        `class NodeParameters`

    - #### startNode

          @NotNull
          CordaFuture<net.corda.testing.driver.NodeHandle> startNode(@NotNull
                                                                              NodeParameters parameters)

      Start a node using the parameter values of the given `class NodeParameters`.

      Parameters:
        `parameters` - The node parameters.
      Returns:
        A `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.
      See Also:
        `class NodeParameters`

    - #### startNode

          @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`.

      Parameters:
        `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.
      Returns:
        A `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.
      See Also:
        `class NodeParameters`

    - #### startNode

          @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`.

      Parameters:
        `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.
      Returns:
        A `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.
      See Also:
        `class NodeParameters`

    - #### startWebserver

          @NotNull
          CordaFuture<net.corda.testing.driver.WebserverHandle> startWebserver(@NotNull
                                                                                        NodeHandle handle)

      Call `startWebserver` with a default maximumHeapSize.

      See Also:
        `startWebserver`

    - #### startWebserver

          @NotNull
          CordaFuture<net.corda.testing.driver.WebserverHandle> startWebserver(@NotNull
                                                                                        NodeHandle handle,
                                                                                        @NotNull
                                                                                        java.lang.String maximumHeapSize)

      Starts a web server for a node

      Parameters:
        `handle` - The handle for the node that this webserver connects to via RPC.
        `maximumHeapSize` - Argument for JVM -Xmx option e.g. "200m".

    - #### baseDirectory

          @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.

      See Also:
        `class CordaX500Name`

    - #### nextPort

          int nextPort()

      Returns the next port to use when instantiating test processes that must not conflict on the same machine