com.r3corda.node.internal / Node

# Node

`class Node : AbstractNode`

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

### Parameters

`configuration` - This is typically loaded from a TypeSafe HOCON configuration file.
`networkMapAddress` - An external network map service to use. Should only ever be null when creating the first network map service, while bootstrapping a network.
`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 protocols etc.

### Constructors

<init> | `Node(configuration: FullNodeConfiguration, networkMapAddress: SingleMessageRecipient?, advertisedServices: Set<ServiceInfo>, clock: Clock = NodeClock())` A Node manages a standalone server that takes part in the P2P network. It creates the services found in ServiceHub, loads important data off disk and starts listening for connections.

### Properties

configuration | `val configuration: FullNodeConfiguration`
log | `val log: <ERROR CLASS>`
messageBroker | `var messageBroker: ArtemisMessagingServer?`
serverThread | `val serverThread: ServiceAffinityExecutor`
webServer | `lateinit var webServer: <ERROR CLASS>`

### Inherited Properties

_servicesThatAcceptUploads | `val _servicesThatAcceptUploads: ArrayList<AcceptsFileUpload>`
advertisedServices | `val advertisedServices: Set<ServiceInfo>`
api | `lateinit var api: APIServer`
checkpointStorage | `lateinit var checkpointStorage: CheckpointStorage`
customServices | `val customServices: ArrayList<Any>`
database | `lateinit var database: <ERROR CLASS>`
dbCloser | `var dbCloser: Runnable?`
identity | `lateinit var identity: IdentityService`
inNodeNetworkMapService | `var inNodeNetworkMapService: NetworkMapService?`
inNodeNotaryService | `var inNodeNotaryService: NotaryService?`
info | `val info: NodeInfo`
isPreviousCheckpointsPresent | `var isPreviousCheckpointsPresent: Boolean`
keyManagement | `lateinit var keyManagement: KeyManagementService`
net | `lateinit var net: MessagingServiceInternal`
netMapCache | `lateinit var netMapCache: NetworkMapCache`
networkMapRegistrationFuture | `val networkMapRegistrationFuture: <ERROR CLASS><Unit>`
networkMapSeq | `var networkMapSeq: Long` Sequence number of changes sent to the network map service, when registering/de-registering this node.
networkMapService | `val networkMapService: SingleMessageRecipient?`
partyKeys | `val partyKeys: <ERROR CLASS>`
platformClock | `val platformClock: Clock`
pluginRegistries | `val pluginRegistries: List<CordaPluginRegistry>` Fetch CordaPluginRegistry classes registered in META-INF/services/com.r3corda.core.node.CordaPluginRegistry files that exist in the classpath
protocolLogicFactory | `lateinit var protocolLogicFactory: ProtocolLogicRefFactory`
runOnStop | `val runOnStop: ArrayList<Runnable>`
scheduler | `lateinit var scheduler: NodeSchedulerService`
schemas | `lateinit var schemas: SchemaService`
services | `val services: ServiceHubInternal`
servicesThatAcceptUploads | `val servicesThatAcceptUploads: List<AcceptsFileUpload>`
smm | `lateinit var smm: StateMachineManager`
started | `var started: Boolean` Set to true once start has been successfully called.
storage | `lateinit var storage: TxWritableStorageService`
uniquenessProvider | `var uniquenessProvider: UniquenessProvider?`
vault | `lateinit var vault: VaultService`

### Functions

initialiseDatabasePersistence | `fun initialiseDatabasePersistence(insideTransaction: () -> Unit): Unit` 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
makeMessagingService | `fun makeMessagingService(): MessagingServiceInternal`
makeUniquenessProvider | `fun makeUniquenessProvider(): PersistentUniquenessProvider`
run | `fun run(): Unit` Starts a blocking event loop for message dispatch.
setup | `fun setup(): Node` Run any tasks that are needed to ensure the node is in a correct state before running start().
start | `fun start(): Node`
startMessagingService | `fun startMessagingService(rpcOps: RPCOps): Unit`
stop | `fun stop(): Unit`

### Inherited Functions

constructStorageService | `open fun constructStorageService(attachments: NodeAttachmentService, transactionStorage: TransactionStorage, stateMachineRecordedTransactionMappingStorage: StateMachineRecordedTransactionMappingStorage): StorageServiceImpl`
createNodeDir | `fun createNodeDir(): Unit`
findMyLocation | `open fun findMyLocation(): PhysicalLocation?`
findService | `fun <T : Any> findService(): <ERROR CLASS>` Locates and returns a service of the given type if loaded, or throws an exception if not found.
generateKeyPair | `open fun generateKeyPair(): KeyPair`
initialiseStorageService | `open fun initialiseStorageService(dir: Path): <ERROR CLASS><TxWritableStorageService, CheckpointStorage>`
makeAttachmentStorage | `fun makeAttachmentStorage(dir: Path): NodeAttachmentService`
makeIdentityService | `open fun makeIdentityService(): IdentityService`
makeKeyManagementService | `open fun makeKeyManagementService(): KeyManagementService`
makeNetworkMapService | `open fun makeNetworkMapService(): Unit`
makeNotaryService | `open fun makeNotaryService(type: ServiceType): NotaryService`
makeSchemaService | `open fun makeSchemaService(): SchemaService`
makeVaultService | `open fun makeVaultService(): VaultService`
noNetworkMapConfigured | `open fun noNetworkMapConfigured(): <ERROR CLASS><Unit>` This is overriden by the mock node implementation to enable operation without any network map service
obtainLegalIdentity | `fun obtainLegalIdentity(): Party`
obtainLegalIdentityKey | `fun obtainLegalIdentityKey(): KeyPair`

### Companion Object Properties

DEFAULT_PORT | `val DEFAULT_PORT: Int` The port that is used by default if none is specified. As you know, 31337 is the most elite number.