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

`dir` - A Path to a location on disk where working files can be found or stored.
`p2pAddr` - The host and port that this server will use. It cant find out its own external hostname, so you have to specify that yourself.
`configuration` - This is typically loaded from a .properties 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).
`clientAPIs` - A list of JAX-RS annotated classes to register which will be used to register any extra client web interfaces the node requires for demos to use. Listed clientAPI classes are assumed to have to take a single APIServer constructor parameter
`clock` - The clock used within the node and by all protocols etc

### Constructors

<init> | `Node(dir: Path, p2pAddr: <ERROR CLASS>, configuration: NodeConfiguration, networkMapAddress: NodeInfo?, advertisedServices: Set<ServiceType>, clock: Clock = NodeClock(), clientAPIs: List<Class<*>> = listOf())` 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

clientAPIs | `val clientAPIs: List<Class<*>>`
log | `val log: <ERROR CLASS>`
p2pAddr | `val p2pAddr: <ERROR CLASS>`
serverThread | `val serverThread: ServiceAffinityExecutor`
webServer | `lateinit var webServer: <ERROR CLASS>`

### Inherited Properties

_servicesThatAcceptUploads | `val _servicesThatAcceptUploads: ArrayList<AcceptsFileUpload>`
advertisedServices | `val advertisedServices: Set<ServiceType>`
api | `lateinit var api: APIServer`
checkpointStorage | `lateinit var checkpointStorage: CheckpointStorage`
configuration | `val configuration: NodeConfiguration`
dir | `val dir: Path`
identity | `lateinit var identity: IdentityService`
inNodeNetworkMapService | `var inNodeNetworkMapService: NetworkMapService?`
inNodeNotaryService | `var inNodeNotaryService: NotaryService?`
info | `val info: NodeInfo`
interestRatesService | `lateinit var interestRatesService: Service`
isPreviousCheckpointsPresent | `var isPreviousCheckpointsPresent: Boolean`
keyManagement | `lateinit var keyManagement: E2ETestKeyManagementService`
net | `lateinit var net: MessagingService`
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: NodeInfo?`
platformClock | `val platformClock: Clock`
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: StorageService`
wallet | `lateinit var wallet: WalletService`

### Functions

makeMessagingService | `fun makeMessagingService(): MessagingService`
start | `fun start(): Node`
startMessagingService | `fun startMessagingService(): Unit`
stop | `fun stop(): Unit`

### Inherited Functions

constructStorageService | `open fun constructStorageService(attachments: NodeAttachmentService, transactionStorage: TransactionStorage, keypair: KeyPair, identity: Party): StorageServiceImpl`
findMyLocation | `open fun findMyLocation(): PhysicalLocation?`
generateKeyPair | `open fun generateKeyPair(): KeyPair`
initialiseStorageService | `open fun initialiseStorageService(dir: Path): <ERROR CLASS><StorageService, CheckpointStorage>`
makeAttachmentStorage | `fun makeAttachmentStorage(dir: Path): NodeAttachmentService`
makeIdentityService | `open fun makeIdentityService(): IdentityService`
makeInterestRatesOracleService | `open fun makeInterestRatesOracleService(): Unit`
makeNetworkMapService | `open fun makeNetworkMapService(): Unit`
makeNotaryService | `open fun makeNotaryService(type: ServiceType): Unit`
noNetworkMapConfigured | `open fun noNetworkMapConfigured(): <ERROR CLASS><Unit>` This is overriden by the mock node implementation to enable operation without any network map service

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