public class AbstractNode
extends SingletonSerializeAsToken
A base node implementation that can be customised either for production (with real implementations that do real I/O), or a mock implementation suitable for unit test environments.
Marked as SingletonSerializeAsToken to prevent the invisible reference to AbstractNode in the ServiceHub accidentally sweeping up the Node into the Kryo checkpoint serialization via any flows holding a reference to ServiceHub.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractNode.Companion |
Modifier and Type | Field and Description |
---|---|
static AbstractNode.Companion |
Companion |
APIServer |
api |
CheckpointStorage |
checkpointStorage |
org.jetbrains.exposed.sql.Database |
database |
FlowLogicRefFactory |
flowLogicFactory |
IdentityService |
identity |
NodeInfo |
info |
KeyManagementService |
keyManagement |
MessagingServiceInternal |
net |
NetworkMapCache |
netMapCache |
NodeSchedulerService |
scheduler |
SchemaService |
schemas |
StateMachineManager |
smm |
TxWritableStorageService |
storage |
VaultService |
vault |
Constructor and Description |
---|
AbstractNode(NodeConfiguration configuration,
java.util.Set<net.corda.core.node.services.ServiceInfo> advertisedServices,
java.time.Clock platformClock,
org.apache.activemq.artemis.utils.ReusableLatch busyNodeLatch)
A base node implementation that can be customised either for production (with real implementations that do real
I/O), or a mock implementation suitable for unit test environments.
|
Modifier and Type | Method and Description |
---|---|
int |
acceptableLiveFiberCountOnStop() |
StorageServiceImpl |
constructStorageService(NodeAttachmentService attachments,
TransactionStorage transactionStorage,
StateMachineRecordedTransactionMappingStorage stateMachineRecordedTransactionMappingStorage) |
void |
createNodeDir() |
PhysicalLocation |
findMyLocation() |
java.security.KeyPair |
generateKeyPair() |
java.util.Set<net.corda.core.node.services.ServiceInfo> |
getAdvertisedServices() |
APIServer |
getApi() |
org.apache.activemq.artemis.utils.ReusableLatch |
getBusyNodeLatch() |
CheckpointStorage |
getCheckpointStorage() |
NodeConfiguration |
getConfiguration() |
java.util.ArrayList<java.lang.Object> |
getCustomServices() |
org.jetbrains.exposed.sql.Database |
getDatabase() |
java.lang.Runnable |
getDbCloser() |
FlowLogicRefFactory |
getFlowLogicFactory() |
IdentityService |
getIdentity() |
NetworkMapService |
getInNodeNetworkMapService() |
NotaryService |
getInNodeNotaryService() |
NodeInfo |
getInfo() |
KeyManagementService |
getKeyManagement() |
org.slf4j.Logger |
getLog() |
MessagingServiceInternal |
getNet() |
NetworkMapCache |
getNetMapCache() |
SingleMessageRecipient |
getNetworkMapAddress() |
com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> |
getNetworkMapRegistrationFuture()
Completes once the node has successfully registered with the network map service
|
long |
getNetworkMapSeq()
Sequence number of changes sent to the network map service, when registering/de-registering this node.
|
java.util.Set<java.security.KeyPair> |
getPartyKeys() |
java.time.Clock |
getPlatformClock() |
java.util.List<net.corda.core.node.CordaPluginRegistry> |
getPluginRegistries()
Fetch CordaPluginRegistry classes registered in META-INF/services/net.corda.core.node.CordaPluginRegistry files that exist in the classpath
|
java.util.ArrayList<java.lang.Runnable> |
getRunOnStop() |
NodeSchedulerService |
getScheduler() |
SchemaService |
getSchemas() |
AffinityExecutor |
getServerThread() |
ServiceHubInternal |
getServices() |
java.util.List<net.corda.node.services.api.AcceptsFileUpload> |
getServicesThatAcceptUploads() |
StateMachineManager |
getSmm() |
boolean |
getStarted()
Set to true once
AbstractNode.start has been successfully called. |
TxWritableStorageService |
getStorage() |
UniquenessProvider |
getUniquenessProvider() |
VaultService |
getVault() |
com.google.common.util.concurrent.SettableFuture<kotlin.Unit> |
get_networkMapRegistrationFuture() |
java.util.ArrayList<net.corda.node.services.api.AcceptsFileUpload> |
get_servicesThatAcceptUploads() |
void |
initialiseDatabasePersistence(kotlin.jvm.functions.Function0<kotlin.Unit> insideTransaction) |
kotlin.Pair<net.corda.core.node.services.TxWritableStorageService,net.corda.node.services.api.CheckpointStorage> |
initialiseStorageService(java.nio.file.Path dir) |
boolean |
isPreviousCheckpointsPresent() |
NodeAttachmentService |
makeAttachmentStorage(java.nio.file.Path dir) |
IdentityService |
makeIdentityService() |
KeyManagementService |
makeKeyManagementService() |
MessagingServiceInternal |
makeMessagingService() |
void |
makeNetworkMapService() |
NotaryService |
makeNotaryService(ServiceType type) |
SchemaService |
makeSchemaService() |
java.util.List<net.corda.core.node.ServiceEntry> |
makeServiceEntries()
A service entry contains the advertised
class ServiceInfo along with the service identity. The identity name is
taken from the configuration or, if non specified, generated by combining the node's legal name and the service id. |
UniquenessProvider |
makeUniquenessProvider(ServiceType type) |
VaultService |
makeVaultService() |
com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> |
noNetworkMapConfigured()
This is overriden by the mock node implementation to enable operation without any network map service
|
Party |
obtainLegalIdentity() |
java.security.KeyPair |
obtainLegalIdentityKey() |
com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> |
registerWithNetworkMap()
Register this node with the network map cache, and load network map from a remote service (and register for
updates) if one has been supplied.
|
void |
setApi(APIServer p) |
void |
setCheckpointStorage(CheckpointStorage p) |
void |
setDatabase(org.jetbrains.exposed.sql.Database p) |
void |
setDbCloser(java.lang.Runnable p) |
void |
setFlowLogicFactory(FlowLogicRefFactory p) |
void |
setIdentity(IdentityService p) |
void |
setInNodeNetworkMapService(NetworkMapService p) |
void |
setInNodeNotaryService(NotaryService p) |
void |
setInfo(NodeInfo p) |
void |
setKeyManagement(KeyManagementService p) |
void |
setNet(MessagingServiceInternal p) |
void |
setNetMapCache(NetworkMapCache p) |
void |
setNetworkMapSeq(long p)
Sequence number of changes sent to the network map service, when registering/de-registering this node.
|
void |
setScheduler(NodeSchedulerService p) |
void |
setSchemas(SchemaService p) |
void |
setSmm(StateMachineManager p) |
void |
setStorage(TxWritableStorageService p) |
void |
setUniquenessProvider(UniquenessProvider p) |
void |
setVault(VaultService p) |
AbstractNode |
setup()
Run any tasks that are needed to ensure the node is in a correct state before running start().
|
AbstractNode |
start() |
void |
startMessagingService(RPCOps rpcOps) |
void |
stop() |
toToken
toToken
public NodeInfo info
public TxWritableStorageService storage
public CheckpointStorage checkpointStorage
public StateMachineManager smm
public VaultService vault
public KeyManagementService keyManagement
public IdentityService identity
public MessagingServiceInternal net
public NetworkMapCache netMapCache
public APIServer api
public NodeSchedulerService scheduler
public FlowLogicRefFactory flowLogicFactory
public SchemaService schemas
public org.jetbrains.exposed.sql.Database database
public static AbstractNode.Companion Companion
public AbstractNode(NodeConfiguration configuration, java.util.Set<net.corda.core.node.services.ServiceInfo> advertisedServices, java.time.Clock platformClock, org.apache.activemq.artemis.utils.ReusableLatch busyNodeLatch)
A base node implementation that can be customised either for production (with real implementations that do real I/O), or a mock implementation suitable for unit test environments.
Marked as SingletonSerializeAsToken to prevent the invisible reference to AbstractNode in the ServiceHub accidentally sweeping up the Node into the Kryo checkpoint serialization via any flows holding a reference to ServiceHub.
public long getNetworkMapSeq()
Sequence number of changes sent to the network map service, when registering/de-registering this node.
public void setNetworkMapSeq(long p)
Sequence number of changes sent to the network map service, when registering/de-registering this node.
public org.slf4j.Logger getLog()
public SingleMessageRecipient getNetworkMapAddress()
public AffinityExecutor getServerThread()
public java.util.ArrayList<net.corda.node.services.api.AcceptsFileUpload> get_servicesThatAcceptUploads()
public java.util.List<net.corda.node.services.api.AcceptsFileUpload> getServicesThatAcceptUploads()
public java.util.Set<java.security.KeyPair> getPartyKeys()
public ServiceHubInternal getServices()
public PhysicalLocation findMyLocation()
public NodeInfo getInfo()
public void setInfo(NodeInfo p)
public TxWritableStorageService getStorage()
public void setStorage(TxWritableStorageService p)
public CheckpointStorage getCheckpointStorage()
public void setCheckpointStorage(CheckpointStorage p)
public StateMachineManager getSmm()
public void setSmm(StateMachineManager p)
public VaultService getVault()
public void setVault(VaultService p)
public KeyManagementService getKeyManagement()
public void setKeyManagement(KeyManagementService p)
public NetworkMapService getInNodeNetworkMapService()
public void setInNodeNetworkMapService(NetworkMapService p)
public NotaryService getInNodeNotaryService()
public void setInNodeNotaryService(NotaryService p)
public UniquenessProvider getUniquenessProvider()
public void setUniquenessProvider(UniquenessProvider p)
public IdentityService getIdentity()
public void setIdentity(IdentityService p)
public MessagingServiceInternal getNet()
public void setNet(MessagingServiceInternal p)
public NetworkMapCache getNetMapCache()
public void setNetMapCache(NetworkMapCache p)
public APIServer getApi()
public void setApi(APIServer p)
public NodeSchedulerService getScheduler()
public void setScheduler(NodeSchedulerService p)
public FlowLogicRefFactory getFlowLogicFactory()
public void setFlowLogicFactory(FlowLogicRefFactory p)
public SchemaService getSchemas()
public void setSchemas(SchemaService p)
public java.util.ArrayList<java.lang.Object> getCustomServices()
public java.util.ArrayList<java.lang.Runnable> getRunOnStop()
public org.jetbrains.exposed.sql.Database getDatabase()
public void setDatabase(org.jetbrains.exposed.sql.Database p)
public java.lang.Runnable getDbCloser()
public void setDbCloser(java.lang.Runnable p)
public boolean isPreviousCheckpointsPresent()
public com.google.common.util.concurrent.SettableFuture<kotlin.Unit> get_networkMapRegistrationFuture()
public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> getNetworkMapRegistrationFuture()
Completes once the node has successfully registered with the network map service
public java.util.List<net.corda.core.node.CordaPluginRegistry> getPluginRegistries()
Fetch CordaPluginRegistry classes registered in META-INF/services/net.corda.core.node.CordaPluginRegistry files that exist in the classpath
public boolean getStarted()
Set to true once AbstractNode.start
has been successfully called.
AbstractNode.start
public AbstractNode start()
public java.util.List<net.corda.core.node.ServiceEntry> makeServiceEntries()
A service entry contains the advertised class ServiceInfo
along with the service identity. The identity name is
taken from the configuration or, if non specified, generated by combining the node's legal name and the service id.
class ServiceInfo
public int acceptableLiveFiberCountOnStop()
public void initialiseDatabasePersistence(kotlin.jvm.functions.Function0<kotlin.Unit> insideTransaction)
public AbstractNode setup()
Run any tasks that are needed to ensure the node is in a correct state before running start().
public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> registerWithNetworkMap()
Register this node with the network map cache, and load network map from a remote service (and register for updates) if one has been supplied.
public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> noNetworkMapConfigured()
This is overriden by the mock node implementation to enable operation without any network map service
public KeyManagementService makeKeyManagementService()
public void makeNetworkMapService()
public NotaryService makeNotaryService(ServiceType type)
public UniquenessProvider makeUniquenessProvider(ServiceType type)
public IdentityService makeIdentityService()
public VaultService makeVaultService()
public SchemaService makeSchemaService()
public void stop()
public MessagingServiceInternal makeMessagingService()
public void startMessagingService(RPCOps rpcOps)
public kotlin.Pair<net.corda.core.node.services.TxWritableStorageService,net.corda.node.services.api.CheckpointStorage> initialiseStorageService(java.nio.file.Path dir)
public StorageServiceImpl constructStorageService(NodeAttachmentService attachments, TransactionStorage transactionStorage, StateMachineRecordedTransactionMappingStorage stateMachineRecordedTransactionMappingStorage)
public Party obtainLegalIdentity()
public java.security.KeyPair obtainLegalIdentityKey()
public java.security.KeyPair generateKeyPair()
public NodeAttachmentService makeAttachmentStorage(java.nio.file.Path dir)
public void createNodeDir()
public NodeConfiguration getConfiguration()
public java.util.Set<net.corda.core.node.services.ServiceInfo> getAdvertisedServices()
public java.time.Clock getPlatformClock()
public org.apache.activemq.artemis.utils.ReusableLatch getBusyNodeLatch()