CatapultServer  v0.5.0.1 (Elephant)
catapult::local Namespace Reference

Classes

class  BlockChainLoader
 
class  Broker
 Represents a broker. More...
 
class  CatapultSystemState
 Catapult system state. More...
 
class  LocalNode
 Represents a local node. More...
 
class  LocalNodeCounterValue
 
class  NemesisBlockNotifier
 Raises nemesis block notifications. More...
 
class  ProcessHost
 Catapult process host. More...
 
class  RecoveryOrchestrator
 Represents a recovery orchestrator. More...
 

Typedefs

using NotificationObserverFactory = supplier< std::unique_ptr< const observers::NotificationObserver > >
 A notification observer factory. More...
 
using BlockDependentNotificationObserverFactory = std::function< std::unique_ptr< const observers::NotificationObserver >(const model::Block &)>
 A block dependent notification observer factory. More...
 
using CacheChangesStorages = std::vector< std::unique_ptr< const cache::CacheChangesStorage > >
 Vector of cache changes storage unique pointers. More...
 
using LocalNodeCounterValues = std::vector< LocalNodeCounterValue >
 Container of local node counter values. More...
 

Functions

std::unique_ptr< BrokerCreateBroker (std::unique_ptr< extensions::ProcessBootstrapper > &&pBootstrapper)
 Creates and boots a broker around the specified bootstrapper (pBootstrapper). More...
 
std::vector< plugins::PluginModuleLoadAllPlugins (extensions::ProcessBootstrapper &bootstrapper)
 Loads all plugins using bootstrapper. More...
 
template<typename THost , typename... TArgs>
std::unique_ptr< THost > CreateAndBootHost (TArgs &&... args)
 Creates and boots a host with args. More...
 
BlockDependentNotificationObserverFactory CreateBlockDependentNotificationObserverFactory (const model::Block &lastBlock, const model::BlockChainConfiguration &config, const NotificationObserverFactory &transientObserverFactory, const NotificationObserverFactory &permanentObserverFactory)
 
model::ChainScore LoadBlockChain (const BlockDependentNotificationObserverFactory &observerFactory, const plugins::PluginManager &pluginManager, const extensions::LocalNodeStateRef &stateRef, Height startHeight)
 
std::unique_ptr< RecoveryOrchestratorCreateRecoveryOrchestrator (std::unique_ptr< extensions::ProcessBootstrapper > &&pBootstrapper)
 Creates and boots a recovery orchestrator around the specified bootstrapper (pBootstrapper). More...
 
std::unique_ptr< io::BlockStorageCreateReadOnlyStorageAdapter (const io::BlockStorage &storage)
 Creates non-owning read-only storage around storage. More...
 
void RepairSpooling (const config::CatapultDataDirectory &dataDirectory, consumers::CommitOperationStep commitStep)
 Repairs catapult spooling folders inside dataDirectory given last server commit operation step that succeeded (commitStep). More...
 
void RepairState (const config::CatapultDirectory &stateChangeDirectory, const cache::CatapultCache &catapultCache, subscribers::StateChangeSubscriber &registeredSubscriber, subscribers::StateChangeSubscriber &repairSubscriber)
 
std::unique_ptr< subscribers::StateChangeSubscriberCreateStateChangeRepairingSubscriber (cache::CatapultCache &cache, extensions::LocalNodeChainScore &localNodeScore)
 Creates state change repairing subscriber around cache and localNodeScore. More...
 
Height FindStartHeight (const io::BlockStorage &storage)
 Returns starting height of storage. More...
 
std::unique_ptr< subscribers::StateChangeSubscriberCreateFileStateChangeStorage (std::unique_ptr< io::OutputStream > &&pOutputStream, const supplier< CacheChangesStorages > &cacheChangesStoragesSupplier)
 
std::unique_ptr< LocalNodeCreateLocalNode (const crypto::KeyPair &keyPair, std::unique_ptr< extensions::ProcessBootstrapper > &&pBootstrapper)
 Creates and boots a local node around the specified key pair (keyPair) and bootstrapper (pBootstrapper). More...
 
void AddMemoryCounters (std::vector< utils::DiagnosticCounter > &counters)
 Adds process memory counters to counters. More...
 
void SeedNodeContainer (ionet::NodeContainer &nodes, const extensions::ProcessBootstrapper &bootstrapper)
 Seeds nodes with node information from bootstrapper. More...
 
std::unique_ptr< subscribers::NodeSubscriberCreateNodeContainerSubscriberAdapter (ionet::NodeContainer &nodes)
 Adapts nodes to a node subscriber. More...
 

Typedef Documentation

◆ BlockDependentNotificationObserverFactory

A block dependent notification observer factory.

◆ CacheChangesStorages

using catapult::local::CacheChangesStorages = typedef std::vector<std::unique_ptr<const cache::CacheChangesStorage> >

Vector of cache changes storage unique pointers.

◆ LocalNodeCounterValues

Container of local node counter values.

◆ NotificationObserverFactory

A notification observer factory.

Function Documentation

◆ AddMemoryCounters()

void catapult::local::AddMemoryCounters ( std::vector< utils::DiagnosticCounter > &  counters)

Adds process memory counters to counters.

◆ CreateAndBootHost()

template<typename THost , typename... TArgs>
std::unique_ptr<THost> catapult::local::CreateAndBootHost ( TArgs &&...  args)

Creates and boots a host with args.

◆ CreateBlockDependentNotificationObserverFactory()

BlockDependentNotificationObserverFactory catapult::local::CreateBlockDependentNotificationObserverFactory ( const model::Block lastBlock,
const model::BlockChainConfiguration config,
const NotificationObserverFactory transientObserverFactory,
const NotificationObserverFactory permanentObserverFactory 
)

Creates a block dependent notification observer factory that calculates an inflection point from lastBlock and config. Prior to the inflection point, an observer created by permanentObserverFactory is returned. At and after the inflection point, an observer created by transientObserverFactory is returned.

◆ CreateBroker()

std::unique_ptr< Broker > catapult::local::CreateBroker ( std::unique_ptr< extensions::ProcessBootstrapper > &&  pBootstrapper)

Creates and boots a broker around the specified bootstrapper (pBootstrapper).

Here is the caller graph for this function:

◆ CreateFileStateChangeStorage()

std::unique_ptr< subscribers::StateChangeSubscriber > catapult::local::CreateFileStateChangeStorage ( std::unique_ptr< io::OutputStream > &&  pOutputStream,
const supplier< CacheChangesStorages > &  cacheChangesStoragesSupplier 
)

Creates a state change storage around pOutputStream using cacheChangesStoragesSupplier for creating storages used for serialization.

Note
Supplier is used because cache changes storages are not available when this storage is created.

◆ CreateLocalNode()

std::unique_ptr< LocalNode > catapult::local::CreateLocalNode ( const crypto::KeyPair keyPair,
std::unique_ptr< extensions::ProcessBootstrapper > &&  pBootstrapper 
)

Creates and boots a local node around the specified key pair (keyPair) and bootstrapper (pBootstrapper).

Here is the caller graph for this function:

◆ CreateNodeContainerSubscriberAdapter()

std::unique_ptr< subscribers::NodeSubscriber > catapult::local::CreateNodeContainerSubscriberAdapter ( ionet::NodeContainer nodes)

Adapts nodes to a node subscriber.

◆ CreateReadOnlyStorageAdapter()

std::unique_ptr< io::BlockStorage > catapult::local::CreateReadOnlyStorageAdapter ( const io::BlockStorage storage)

Creates non-owning read-only storage around storage.

◆ CreateRecoveryOrchestrator()

std::unique_ptr< RecoveryOrchestrator > catapult::local::CreateRecoveryOrchestrator ( std::unique_ptr< extensions::ProcessBootstrapper > &&  pBootstrapper)

Creates and boots a recovery orchestrator around the specified bootstrapper (pBootstrapper).

Here is the caller graph for this function:

◆ CreateStateChangeRepairingSubscriber()

std::unique_ptr< subscribers::StateChangeSubscriber > catapult::local::CreateStateChangeRepairingSubscriber ( cache::CatapultCache cache,
extensions::LocalNodeChainScore localNodeScore 
)

Creates state change repairing subscriber around cache and localNodeScore.

◆ FindStartHeight()

Height catapult::local::FindStartHeight ( const io::BlockStorage storage)

Returns starting height of storage.

Here is the call graph for this function:

◆ LoadAllPlugins()

std::vector< plugins::PluginModule > catapult::local::LoadAllPlugins ( extensions::ProcessBootstrapper bootstrapper)

Loads all plugins using bootstrapper.

◆ LoadBlockChain()

model::ChainScore catapult::local::LoadBlockChain ( const BlockDependentNotificationObserverFactory observerFactory,
const plugins::PluginManager pluginManager,
const extensions::LocalNodeStateRef stateRef,
Height  startHeight 
)

Loads a block chain from storage using the supplied observer factory (observerFactory) and plugin manager (pluginManager) and updating stateRef starting with the block at startHeight.

◆ RepairSpooling()

void catapult::local::RepairSpooling ( const config::CatapultDataDirectory dataDirectory,
consumers::CommitOperationStep  commitStep 
)

Repairs catapult spooling folders inside dataDirectory given last server commit operation step that succeeded (commitStep).

◆ RepairState()

void catapult::local::RepairState ( const config::CatapultDirectory stateChangeDirectory,
const cache::CatapultCache catapultCache,
subscribers::StateChangeSubscriber registeredSubscriber,
subscribers::StateChangeSubscriber repairSubscriber 
)

Repairs state in stateChangeDirectory using catapultCache given registered subscriber (registeredSubscriber) and repair subscriber (repairSubscriber).

◆ SeedNodeContainer()

void catapult::local::SeedNodeContainer ( ionet::NodeContainer nodes,
const extensions::ProcessBootstrapper bootstrapper 
)

Seeds nodes with node information from bootstrapper.

Here is the call graph for this function: