core.node / 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).
`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 = Clock.systemUTC())` 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

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`
configuration | `val configuration: NodeConfiguration`
dir | `val dir: Path`
identity | `lateinit var identity: IdentityService`
inNodeNetworkMapService | `var inNodeNetworkMapService: NetworkMapService?`
inNodeTimestampingService | `var inNodeTimestampingService: NodeTimestamperService?`
info | `val info: NodeInfo`
initialNetworkMapAddress | `val initialNetworkMapAddress: NodeInfo?`
interestRatesService | `lateinit var interestRatesService: Service`
keyManagement | `lateinit var keyManagement: E2ETestKeyManagementService`
net | `lateinit var net: MessagingService`
networkMapSeq | `var networkMapSeq: Long` Sequence number of changes sent to the network map service, when registering/de-registering this node
networkMapServiceCallTimeout | `val networkMapServiceCallTimeout: Duration`
platformClock | `val platformClock: Clock`
services | `val services: ServiceHub`
servicesThatAcceptUploads | `val servicesThatAcceptUploads: List<AcceptsFileUpload>`
smm | `lateinit var smm: StateMachineManager`
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, checkpointStorage: CheckpointStorage, keypair: KeyPair, identity: Party): StorageServiceImpl`
findMyLocation | `open fun findMyLocation(): PhysicalLocation?`
initialiseStorageService | `open fun initialiseStorageService(dir: Path): StorageService`
makeIdentityService | `open fun makeIdentityService(): IdentityService`
makeInterestRatesOracleService | `open fun makeInterestRatesOracleService(): Unit`
makeNetworkMapService | `open fun makeNetworkMapService(): Unit`
makeTimestampingService | `open fun makeTimestampingService(): Unit`

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