net.corda.node.internal

## Class Node

- SingletonSerializeAsToken
- - AbstractNode
  - - net.corda.node.internal.Node

- All Implemented Interfaces:
    SerializeAsToken

      public class Node
      extends AbstractNode

  A Node manages a standalone server that takes part in the P2P network. It creates the services found in `interface ServiceHub`, loads important data off disk and starts listening for connections.

  See Also:
    `interface ServiceHub`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.corda.node.internal.AbstractNode

      `AbstractNode.Companion`

  - ### Field Summary

    - ### Fields inherited from class net.corda.node.internal.AbstractNode

      `Companion, checkpointStorage, database, flowLogicFactory, identity, info, keyManagement, net, netMapCache, scheduler, schemas, smm, storage, vault`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Node(FullNodeConfiguration configuration, java.util.Set<net.corda.core.node.services.ServiceInfo> advertisedServices, java.time.Clock clock)` A Node manages a standalone server that takes part in the P2P network. It creates the services found in `interface ServiceHub`, loads important data off disk and starts listening for connections.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FullNodeConfiguration` | `getConfiguration()`
    `org.slf4j.Logger` | `getLog()`
    `ArtemisMessagingServer` | `getMessageBroker()`
    `ArtemisMessagingComponent.NetworkMapAddress` | `getNetworkMapAddress()`
    `AffinityExecutor.ServiceAffinityExecutor` | `getServerThread()`
    `void` | `initialiseDatabasePersistence(kotlin.jvm.functions.Function0<kotlin.Unit> insideTransaction)` If the node is persisting to an embedded H2 database, then expose this via TCP with a JDBC URL of the form: jdbc:h2:tcp://:/node with username and password as per the DataSource connection details. The key element to enabling this support is to ensure that you specify a JDBC connection URL of the form jdbc:h2:file: in the node config and that you include the H2 option AUTO_SERVER_PORT set to the port you desire to use (0 will give a dynamically allocated port number) but exclude the H2 option AUTO_SERVER=TRUE. This is not using the H2 "automatic mixed mode" directly but leans on many of the underpinnings. For more details on H2 URLs and configuration see: http://www.h2database.com/html/features.html#database_url
    `MessagingServiceInternal` | `makeMessagingService()`
    `UniquenessProvider` | `makeUniquenessProvider(ServiceType type)`
    `com.google.common.util.concurrent.ListenableFuture<kotlin.Unit>` | `registerWithNetworkMap()` Insert an initial step in the registration process which will throw an exception if a non-recoverable error is encountered when trying to connect to the network map node.
    `void` | `run()` Starts a blocking event loop for message dispatch.
    `void` | `setMessageBroker(ArtemisMessagingServer p)`
    `Node` | `setup()` Run any tasks that are needed to ensure the node is in a correct state before running start().
    `Node` | `start()`
    `void` | `startMessagingService(RPCOps rpcOps)`
    `void` | `stop()`

    - ### Methods inherited from class net.corda.node.internal.AbstractNode

      `acceptableLiveFiberCountOnStop, constructStorageService, createNodeDir, findMyLocation, generateKeyPair, getAdvertisedServices, getBusyNodeLatch, getCheckpointStorage, getConfiguration, getCustomServices, getDatabase, getDbCloser, getFlowLogicFactory, getIdentity, getInNodeNetworkMapService, getInNodeNotaryService, getInfo, getKeyManagement, getLog, getNet, getNetMapCache, getNetworkMapAddress, getNetworkMapRegistrationFuture, getNetworkMapSeq, getPartyKeys, getPlatformClock, getPluginRegistries, getRunOnStop, getScheduler, getSchemas, getServerThread, getServices, getSmm, getStarted, getStorage, getVault, get_networkMapRegistrationFuture, initialiseDatabasePersistence, initialiseStorageService, isPreviousCheckpointsPresent, makeAttachmentStorage, makeIdentityService, makeKeyManagementService, makeMessagingService, makeNetworkMapService, makeNotaryService, makeSchemaService, makeServiceEntries, makeUniquenessProvider, makeVaultService, noNetworkMapConfigured, obtainLegalIdentity, obtainLegalIdentityKey, registerWithNetworkMap, setCheckpointStorage, setDatabase, setDbCloser, setFlowLogicFactory, setIdentity, setInNodeNetworkMapService, setInNodeNotaryService, setInfo, setKeyManagement, setNet, setNetMapCache, setNetworkMapSeq, setScheduler, setSchemas, setSmm, setStorage, setVault, setup, start, startMessagingService, stop`

    - ### Methods inherited from class net.corda.core.serialization.SingletonSerializeAsToken

      `toToken`

    - ### Methods inherited from interface net.corda.core.serialization.SerializeAsToken

      `toToken`

- - ### Constructor Detail

    - #### Node

          public Node(FullNodeConfiguration configuration,
                      java.util.Set<net.corda.core.node.services.ServiceInfo> advertisedServices,
                      java.time.Clock clock)

      A Node manages a standalone server that takes part in the P2P network. It creates the services found in `interface ServiceHub`, loads important data off disk and starts listening for connections.

      Parameters:
        `configuration` - This is typically loaded from a TypeSafe HOCON configuration file.
        `advertisedServices` - The services this node advertises. This must be a subset of the services it runs, but nodes are not required to advertise services they run (hence subset).
        `clock` - The clock used within the node and by all flows etc.
      See Also:
        `interface ServiceHub`

  - ### Method Detail

    - #### getLog

          public org.slf4j.Logger getLog()

    - #### getNetworkMapAddress

          public ArtemisMessagingComponent.NetworkMapAddress getNetworkMapAddress()

    - #### getServerThread

          public AffinityExecutor.ServiceAffinityExecutor getServerThread()

    - #### getMessageBroker

          public ArtemisMessagingServer getMessageBroker()

    - #### setMessageBroker

          public void setMessageBroker(ArtemisMessagingServer p)

    - #### makeMessagingService

          public MessagingServiceInternal makeMessagingService()

    - #### startMessagingService

          public void startMessagingService(RPCOps rpcOps)

    - #### registerWithNetworkMap

          public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> registerWithNetworkMap()

      Insert an initial step in the registration process which will throw an exception if a non-recoverable error is encountered when trying to connect to the network map node.

    - #### makeUniquenessProvider

          public UniquenessProvider makeUniquenessProvider(ServiceType type)

    - #### initialiseDatabasePersistence

          public void initialiseDatabasePersistence(kotlin.jvm.functions.Function0<kotlin.Unit> insideTransaction)

      If the node is persisting to an embedded H2 database, then expose this via TCP with a JDBC URL of the form: jdbc:h2:tcp://:/node with username and password as per the DataSource connection details. The key element to enabling this support is to ensure that you specify a JDBC connection URL of the form jdbc:h2:file: in the node config and that you include the H2 option AUTO_SERVER_PORT set to the port you desire to use (0 will give a dynamically allocated port number) but exclude the H2 option AUTO_SERVER=TRUE. This is not using the H2 "automatic mixed mode" directly but leans on many of the underpinnings. For more details on H2 URLs and configuration see: http://www.h2database.com/html/features.html#database_url

    - #### start

          public Node start()

    - #### run

          public void run()

      Starts a blocking event loop for message dispatch.

    - #### setup

          public Node setup()

      Run any tasks that are needed to ensure the node is in a correct state before running start().

    - #### stop

          public void stop()

    - #### getConfiguration

          public FullNodeConfiguration getConfiguration()