CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
36 namespace catapult {
namespace plugins {
63 template<
typename TUnresolved,
typename TResolved>
68 template<
typename TUnresolved,
typename TResolved>
112 template<
typename TStorageTraits,
typename TCache>
118 void addCacheSupport(std::unique_ptr<cache::SubCachePlugin>&& pSubCachePlugin);
void addHandlers(ionet::ServerPacketHandlers &handlers, const cache::CatapultCache &cache) const
Adds all (non-diagnostic) handlers to handlers given cache.
Definition: PluginManager.cpp:106
void addDiagnosticCounters(std::vector< utils::DiagnosticCounter > &counters, const cache::CatapultCache &cache) const
Adds all diagnostic counters to counters given cache.
Definition: PluginManager.cpp:126
consumer< observers::DemuxObserverBuilder & > ObserverHook
Definition: PluginManager.h:57
model::ResolverContext createResolverContext(const cache::ReadOnlyCatapultCache &cache) const
Creates a resolver context given cache.
Definition: PluginManager.cpp:210
void addTransactionSupport(std::unique_ptr< model::TransactionPlugin > &&pTransactionPlugin)
Adds support for a transaction described by pTransactionPlugin.
Definition: PluginManager.cpp:63
Block chain configuration settings.
Definition: BlockChainConfiguration.h:33
std::vector< CounterHook > m_diagnosticCounterHooks
Definition: PluginManager.h:218
std::vector< ObserverHook > m_transientObserverHooks
Definition: PluginManager.h:222
consumer< ionet::ServerPacketHandlers &, const cache::CatapultCache & > HandlerHook
Definition: PluginManager.h:53
Additional storage configuration.
Definition: PluginManager.h:39
Inflation configuration settings.
Definition: InflationConfiguration.h:29
Patricia tree storage should be enabled.
void addDiagnosticHandlerHook(const HandlerHook &hook)
Adds a diagnostic handler hook.
Definition: PluginManager.cpp:114
void addDiagnosticHandlers(ionet::ServerPacketHandlers &handlers, const cache::CatapultCache &cache) const
Adds all diagnostic handlers to handlers given cache.
Definition: PluginManager.cpp:122
observers::AggregateNotificationObserverPointerT< model::Notification > ObserverPointer
Definition: PluginManager.h:61
ObserverPointer createObserver() const
Creates an observer.
Definition: PluginManager.cpp:172
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
PluginManager(const model::BlockChainConfiguration &config, const StorageConfiguration &storageConfig, const config::InflationConfiguration &inflationConfig)
Creates a new plugin manager around config, storageConfig and inflationConfig.
Definition: PluginManager.cpp:26
const model::BlockChainConfiguration & config() const
Gets the block chain configuration.
Definition: PluginManager.cpp:37
MosaicId resolve(UnresolvedMosaicId mosaicId) const
Resolves mosaic id (mosaicId).
Definition: ResolverContext.cpp:41
model::BlockChainConfiguration m_config
Definition: PluginManager.h:210
bool ShouldEnableVerifiableState
true if block chain should calculate state hashes so that state is fully verifiable at each block.
Definition: BlockChainConfiguration.h:39
std::vector< HandlerHook > m_diagnosticHandlerHooks
Definition: PluginManager.h:217
Context used to resolve unresolved types.
Definition: ResolverContext.h:28
UnresolvedMosaicId GetUnresolvedCurrencyMosaicId(const BlockChainConfiguration &config)
Gets unresolved currency mosaic id from config.
Definition: BlockChainConfiguration.cpp:105
std::vector< StatefulValidatorHook > m_statefulValidatorHooks
Definition: PluginManager.h:220
StatefulValidatorPointer createStatefulValidator() const
Creates a stateful validator with no suppressed failures.
Definition: PluginManager.cpp:156
Resolver< UnresolvedMosaicId, MosaicId > MosaicResolver
Definition: PluginManager.h:65
StatelessValidatorPointer createStatelessValidator() const
Creates a stateless validator with no suppressed failures.
Definition: PluginManager.cpp:147
A manager for registering plugins.
Definition: PluginManager.h:51
predicate< const cache::ReadOnlyCatapultCache &, const TUnresolved &, TResolved & > Resolver
Definition: PluginManager.h:64
cache::CacheConfiguration cacheConfig(const std::string &name) const
Gets the cache configuration for cache with name.
Definition: PluginManager.cpp:49
void addAddressResolver(const AddressResolver &resolver)
Adds an address resolver.
Definition: PluginManager.cpp:191
bool PreferCacheDatabase
Prefer using a database for cache storage.
Definition: PluginManager.h:41
model::TransactionRegistry m_transactionRegistry
Definition: PluginManager.h:213
std::vector< AddressResolver > m_addressResolvers
Definition: PluginManager.h:225
std::vector< MosaicResolver > m_mosaicResolvers
Definition: PluginManager.h:224
Builder for creating a catapult cache around sub caches.
Definition: CatapultCacheBuilder.h:29
config::InflationConfiguration m_inflationConfig
Definition: PluginManager.h:212
std::vector< ObserverHook > m_observerHooks
Definition: PluginManager.h:221
#define PLUGIN_API
Definition: plugins.h:30
std::unique_ptr< model::NotificationPublisher > PublisherPointer
Definition: PluginManager.h:73
PLUGIN_API void RegisterSubsystem(catapult::plugins::PluginManager &manager)
Entry point for registering a dynamic module with manager.
Definition: MemoryHashCacheSystem.cpp:63
std::unique_ptr< const validators::stateless::AggregateNotificationValidator > StatelessValidatorPointer
Definition: PluginManager.h:59
cache::CatapultCache createCache()
Creates a catapult cache.
Definition: PluginManager.cpp:79
std::unique_ptr< const AggregateNotificationObserverT< TNotification > > AggregateNotificationObserverPointerT
An aggregate notification observer (unique) pointer.
Definition: ObserverTypes.h:41
const config::InflationConfiguration & inflationConfig() const
Gets the inflation configuration.
Definition: PluginManager.cpp:45
StorageConfiguration m_storageConfig
Definition: PluginManager.h:211
void addCacheSupport(std::unique_ptr< TCache > &&pSubCache)
Adds support for a sub cache described by pSubCache.
Definition: PluginManager.h:113
Resolver< UnresolvedAddress, Address > AddressResolver
Definition: PluginManager.h:66
Central cache holding all sub caches.
Definition: CatapultCache.h:40
std::function< TResolved(const cache::ReadOnlyCatapultCache &, const TUnresolved &)> AggregateResolver
Definition: PluginManager.h:69
Represents a file size.
Definition: FileSize.h:29
std::string CacheDatabaseDirectory
Base directory to use for storing cache database.
Definition: PluginManager.h:44
AggregateResolver< UnresolvedAddress, Address > AggregateAddressResolver
Definition: PluginManager.h:71
HarvestingConfiguration m_config
Definition: HarvestingService.cpp:126
void addTransientObserverHook(const ObserverHook &hook)
Adds a (transient) observer hook.
Definition: PluginManager.cpp:168
utils::FileSize MaxCacheDatabaseWriteBatchSize
Maximum cache database write batch size.
Definition: PluginManager.h:47
predicate< ValidationResult > ValidationResultPredicate
Validation result predicate.
Definition: ValidatorTypes.h:42
PublisherPointer createNotificationPublisher(model::PublicationMode mode=model::PublicationMode::All) const
Creates a notification publisher for the specified mode.
Definition: PluginManager.cpp:225
AggregateNotificationObserverPointerT< model::Notification > build()
Builds a demultiplexing observer.
Definition: DemuxObserverBuilder.h:46
void addMosaicResolver(const MosaicResolver &resolver)
Adds a mosaic resolver.
Definition: PluginManager.cpp:187
Cache configuration.
Definition: CacheConfiguration.h:37
std::vector< HandlerHook > m_nonDiagnosticHandlerHooks
Definition: PluginManager.h:216
const StorageConfiguration & storageConfig() const
Gets the storage configuration.
Definition: PluginManager.cpp:41
consumer< validators::stateful::DemuxValidatorBuilder & > StatefulValidatorHook
Definition: PluginManager.h:56
std::vector< StatelessValidatorHook > m_statelessValidatorHooks
Definition: PluginManager.h:219
void addDiagnosticCounterHook(const CounterHook &hook)
Adds a diagnostic counter hook.
Definition: PluginManager.cpp:118
Patricia tree storage should be disabled.
consumer< validators::stateless::DemuxValidatorBuilder & > StatelessValidatorHook
Definition: PluginManager.h:55
Definition: AddressExtractionExtension.cpp:28
void addObserverHook(const ObserverHook &hook)
Adds an observer hook.
Definition: PluginManager.cpp:164
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
std::unique_ptr< NotificationPublisher > CreateNotificationPublisher(const TransactionRegistry &transactionRegistry, UnresolvedMosaicId feeMosaicId, PublicationMode mode)
Definition: NotificationPublisher.cpp:191
void add(std::unique_ptr< TCache > &&pSubCache)
Adds pSubCache to the builder with the specified storage traits.
Definition: CatapultCacheBuilder.h:33
PublicationMode
Publication modes.
Definition: NotificationPublisher.h:34
const model::TransactionRegistry & transactionRegistry() const
Gets the transaction registry.
Definition: PluginManager.cpp:67
std::unique_ptr< const validators::stateful::AggregateNotificationValidator > StatefulValidatorPointer
Definition: PluginManager.h:60
ObserverPointer createPermanentObserver() const
Creates an observer that only observes permanent state changes.
Definition: PluginManager.cpp:179
CatapultCache build()
Builds a catapult cache.
Definition: CatapultCacheBuilder.h:49
void registerPlugin(std::unique_ptr< const TPlugin > &&pPlugin)
Registers pPlugin with the registry.
Definition: PluginRegistry.h:48
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
cache::CatapultCacheBuilder m_cacheBuilder
Definition: PluginManager.h:214
A collection of packet handlers where there is at most one handler per packet type.
Definition: PacketHandlers.h:62
void addStatefulValidatorHook(const StatefulValidatorHook &hook)
Adds a stateful validator hook.
Definition: PluginManager.cpp:138
consumer< std::vector< utils::DiagnosticCounter > &, const cache::CatapultCache & > CounterHook
Definition: PluginManager.h:54
A demultiplexing observer builder.
Definition: DemuxObserverBuilder.h:30
AggregateResolver< UnresolvedMosaicId, MosaicId > AggregateMosaicResolver
Definition: PluginManager.h:70
A read-only overlay on top of a catapult cache.
Definition: ReadOnlyCatapultCache.h:27
void addStatelessValidatorHook(const StatelessValidatorHook &hook)
Adds a stateless validator hook.
Definition: PluginManager.cpp:134
void addHandlerHook(const HandlerHook &hook)
Adds a (non-diagnostic) handler hook.
Definition: PluginManager.cpp:102