CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 #include <unordered_map>
30 namespace catapult {
namespace model {
100 std::unordered_map<std::string, utils::ConfigurationBag>
Plugins;
131 auto iter = config.
Plugins.find(pluginName);
132 if (config.
Plugins.cend() == iter)
135 return T::LoadFromBag(iter->second);
#define LOAD_NETWORK_PROPERTY(NAME)
T LoadPluginConfiguration(const BlockChainConfiguration &config, const std::string &pluginName)
Loads plugin configuration for plugin named pluginName from config.
Definition: BlockChainConfiguration.h:130
void VerifyBagSizeLte(const ConfigurationBag &bag, size_t expectedSize)
Verifies that the number of properties in bag is no greater than expectedSize.
Definition: utils/ConfigurationUtils.cpp:38
bool ShouldEnableVerifiableReceipts
true if block chain should calculate receipts so that state changes are fully verifiable at each bloc...
Definition: BlockChainConfiguration.h:42
static BlockChainConfiguration Uninitialized()
Creates an uninitialized block chain configuration.
Definition: BlockChainConfiguration.cpp:36
utils::TimeSpan CalculateTransactionCacheDuration(const BlockChainConfiguration &config)
Calculates the duration of time that expired transactions should be cached for the block chain descri...
Definition: BlockChainConfiguration.cpp:120
Block chain configuration settings.
Definition: BlockChainConfiguration.h:33
uint32_t BlockTimeSmoothingFactor
Definition: BlockChainConfiguration.h:57
uint8_t HarvestBeneficiaryPercentage
Percentage of the harvested fee that is collected by the beneficiary account.
Definition: BlockChainConfiguration.h:91
disruptor::ConstBlockConsumer CreateBlockChainCheckConsumer(uint32_t maxChainSize, const utils::TimeSpan &maxBlockFutureTime, const chain::TimeSupplier &timeSupplier)
Definition: BlockChainCheckConsumer.cpp:91
utils::TimeSpan MaxBlockFutureTime
Maximum future time of a block that can be accepted.
Definition: BlockChainConfiguration.h:76
Information about a network.
Definition: NetworkInfo.h:54
bool ShouldEnableVerifiableState
true if block chain should calculate state hashes so that state is fully verifiable at each block.
Definition: BlockChainConfiguration.h:39
UnresolvedMosaicId GetUnresolvedCurrencyMosaicId(const BlockChainConfiguration &config)
Gets unresolved currency mosaic id from config.
Definition: BlockChainConfiguration.cpp:105
DisruptorConsumerT< const BlockElements > ConstBlockConsumer
A const block disruptor consumer function.
Definition: DisruptorConsumer.h:41
static constexpr TimeSpan FromMilliseconds(uint64_t milliseconds)
Creates a time span from the given number of milliseconds.
Definition: TimeSpan.h:59
uint32_t m_maxChainSize
Definition: BlockChainCheckConsumer.cpp:85
Amount MinHarvesterBalance
Minimum number of harvesting mosaic atomic units needed for an account to be eligible for harvesting.
Definition: BlockChainConfiguration.h:88
utils::BaseValue< uint64_t, UnresolvedMosaicId_tag > UnresolvedMosaicId
Definition: src/catapult/types.h:82
BlockChainConfiguration()=default
Represents a time duration.
Definition: TimeSpan.h:30
ConfigurationBag ExtractSectionAsBag(const ConfigurationBag &bag, const char *section)
Extracts all section properties from bag into a new bag with a single section with a default (empty s...
Definition: utils/ConfigurationUtils.cpp:43
A simple bag of properties.
Definition: ConfigurationBag.h:57
NetworkInfo Network
Block chain network.
Definition: BlockChainConfiguration.h:36
constexpr ValueType unwrap() const
Unwraps this value and returns the underlying raw value.
Definition: BaseValue.h:53
Importance TotalChainImportance
Total whole importance units available in the network.
Definition: BlockChainConfiguration.h:85
uint32_t MaxDifficultyBlocks
Maximum number of blocks to use in a difficulty calculation.
Definition: BlockChainConfiguration.h:70
std::unordered_set< std::string > sections() const
Gets the names of all sections in this bag.
Definition: ConfigurationBag.h:104
uint32_t BlockPruneInterval
Number of blocks between cache pruning.
Definition: BlockChainConfiguration.h:94
utils::TimeSpan BlockGenerationTargetTime
Targeted time between blocks.
Definition: BlockChainConfiguration.h:51
utils::TimeSpan MaxTransactionLifetime
Maximum lifetime a transaction can have before it expires.
Definition: BlockChainConfiguration.h:73
static constexpr TimeSpan FromHours(uint64_t hours)
Creates a time span from the given number of hours.
Definition: TimeSpan.h:44
uint64_t ImportanceGrouping
Definition: BlockChainConfiguration.h:61
MosaicId CurrencyMosaicId
Mosaic id used as primary chain currency.
Definition: BlockChainConfiguration.h:45
std::unordered_map< std::string, utils::ConfigurationBag > Plugins
Unparsed map of plugin configuration.
Definition: BlockChainConfiguration.h:100
utils::TimeSpan m_maxBlockFutureTime
Definition: BlockChainCheckConsumer.cpp:86
utils::TimeSpan CalculateRollbackVariabilityBufferDuration(const BlockChainConfiguration &config)
Calculates the duration of the rollback variability buffer for the block chain described by config.
Definition: BlockChainConfiguration.cpp:113
Key PublicKey
Definition: PacketReaders.cpp:36
#define CATAPULT_THROW_AND_LOG_1(TYPE, MESSAGE, PARAM1)
Macro used to throw a catapult exception with one parameter.
Definition: exceptions.h:152
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
uint32_t MaxTransactionsPerBlock
Maximum number of transactions per block.
Definition: BlockChainConfiguration.h:97
constexpr disruptor::ConsumerResult Abort(validators::ValidationResult validationResult)
Creates an aborted consumer result around validationResult.
Definition: ConsumerResultFactory.h:34
uint32_t MaxRollbackBlocks
Maximum number of blocks that can be rolled back.
Definition: BlockChainConfiguration.h:67
constexpr uint64_t millis() const
Returns the number of milliseconds.
Definition: TimeSpan.h:91
std::vector< model::BlockElement > BlockElements
A container of BlockElement.
Definition: DisruptorTypes.h:132
#define LOAD_CHAIN_PROPERTY(NAME)
Amount MaxMosaicAtomicUnits
Maximum atomic units (total-supply * 10 ^ divisibility) of a mosaic allowed in the network.
Definition: BlockChainConfiguration.h:82
Exception class that is thrown when a required configuration property is missing.
Definition: ConfigurationBag.h:32
supplier< Timestamp > TimeSupplier
Supplies a timestamp.
Definition: ChainFunctions.h:39
bool IsChainLink(const model::Block &parent, const Hash256 &parentHash, const model::Block &child)
Determines if parent with hash parentHash and child form a chain link.
Definition: ChainUtils.cpp:30
Amount InitialCurrencyAtomicUnits
Initial currency atomic units available in the network.
Definition: BlockChainConfiguration.h:79
utils::BaseValue< uint64_t, Timestamp_tag > Timestamp
Definition: src/catapult/types.h:73
Definition: AddressExtractionExtension.cpp:28
uint8_t ImportanceActivityPercentage
Percentage of importance resulting from fee generation and beneficiary usage.
Definition: BlockChainConfiguration.h:64
utils::TimeSpan CalculateFullRollbackDuration(const BlockChainConfiguration &config)
Calculates the duration of a full rollback for the block chain described by config.
Definition: BlockChainConfiguration.cpp:109
ArrayPointerSet< Hash256 > HashPointerSet
A hash pointer set.
Definition: ArraySet.h:70
uint64_t CalculateDifficultyHistorySize(const BlockChainConfiguration &config)
Calculates the number of historical difficulties to cache in memory for the block chain described by ...
Definition: BlockChainConfiguration.cpp:126
static BlockChainConfiguration LoadFromBag(const utils::ConfigurationBag &bag)
Loads a block chain configuration from bag.
Definition: BlockChainConfiguration.cpp:40
MosaicId HarvestingMosaicId
Mosaic id used to provide harvesting ability.
Definition: BlockChainConfiguration.h:48
constexpr disruptor::ConsumerResult Continue()
Creates a continuation consumer result.
Definition: ConsumerResultFactory.h:29
chain::TimeSupplier m_timeSupplier
Definition: BlockChainCheckConsumer.cpp:87