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.
interface ServiceHub
AbstractNode.Companion
Companion, checkpointStorage, database, flowLogicFactory, identity, info, keyManagement, net, netMapCache, scheduler, schemas, smm, storage, vault
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. |
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() |
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, getUniquenessProvider, 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, setUniquenessProvider, setVault, setup, start, startMessagingService, stop
toToken
toToken
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.
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.interface ServiceHub
public org.slf4j.Logger getLog()
public ArtemisMessagingComponent.NetworkMapAddress getNetworkMapAddress()
public AffinityExecutor.ServiceAffinityExecutor getServerThread()
public ArtemisMessagingServer getMessageBroker()
public void setMessageBroker(ArtemisMessagingServer p)
public MessagingServiceInternal makeMessagingService()
public void startMessagingService(RPCOps rpcOps)
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.
public UniquenessProvider makeUniquenessProvider(ServiceType type)
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
public Node start()
public void run()
Starts a blocking event loop for message dispatch.
public Node setup()
Run any tasks that are needed to ensure the node is in a correct state before running start().
public void stop()
public FullNodeConfiguration getConfiguration()