CatapultServer  v0.5.0.1 (Elephant)
BlockGenerator.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/model/Block.h"
24 #include <memory>
25 
26 namespace catapult {
27  namespace tools {
28  namespace nemgen {
29  struct NemesisConfiguration;
30  struct NemesisExecutionHashesDescriptor;
31  }
32  }
33 }
34 
35 namespace catapult { namespace tools { namespace nemgen {
36 
38  std::unique_ptr<model::Block> CreateNemesisBlock(const NemesisConfiguration& config);
39 
42  const NemesisConfiguration& config,
43  model::Block& block,
44  NemesisExecutionHashesDescriptor& executionHashesDescriptor);
45 
47  model::BlockElement CreateNemesisBlockElement(const NemesisConfiguration& config, const model::Block& block);
48 }}}
Block.h
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
catapult::builders::MosaicAliasBuilder
Builder for a mosaic alias transaction.
Definition: MosaicAliasBuilder.h:28
catapult::model::CreateBlock
std::unique_ptr< Block > CreateBlock(const PreviousBlockContext &context, NetworkIdentifier networkIdentifier, const Key &signerPublicKey, const Transactions &transactions)
Definition: BlockUtils.cpp:138
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::utils::HexFormat
constexpr void HexFormat(const ByteArray< N, TTag > &)
Parser.debug
def debug(*args)
Definition: Parser.py:46
catapult::state::Namespace
A catapult namespace.
Definition: Namespace.h:30
BlockGenerator.h
m_transactions
model::Transactions m_transactions
Definition: BlockGenerator.cpp:168
catapult::model::BlockHeader::BlockReceiptsHash
Hash256 BlockReceiptsHash
Aggregate hash of a block's receipts.
Definition: Block.h:59
catapult::model::PreviousBlockContext
Context passed when creating new block.
Definition: BlockUtils.h:74
catapult::extensions::BlockExtensions::signFullBlock
void signFullBlock(const crypto::KeyPair &signer, model::Block &block) const
Cryptographically signs a full block with signer.
Definition: BlockExtensions.cpp:68
catapult::tools::nemgen::CreateTransactionRegistry
model::TransactionRegistry CreateTransactionRegistry()
Creates a transaction registry that has basic transaction types registered.
Definition: TransactionRegistryFactory.cpp:30
catapult::builders::MosaicDefinitionBuilder
Builder for a mosaic definition transaction.
Definition: MosaicDefinitionBuilder.h:29
catapult::BlockDuration
utils::BaseValue< uint64_t, BlockDuration_tag > BlockDuration
Definition: src/catapult/types.h:88
catapult::tools::nemgen::NemesisConfiguration
Nemesis configuration.
Definition: NemesisConfiguration.h:56
NemesisConfiguration.h
catapult::UnresolvedMosaicId
utils::BaseValue< uint64_t, UnresolvedMosaicId_tag > UnresolvedMosaicId
Definition: src/catapult/types.h:82
catapult::model::Transactions
std::vector< std::shared_ptr< const Transaction > > Transactions
Container of transactions.
Definition: BlockUtils.h:71
catapult::tools::nemgen::NemesisExecutionHashesDescriptor::StateHash
Hash256 StateHash
State hash.
Definition: NemesisExecutionHasher.h:47
TransactionRegistryFactory.h
m_networkIdentifier
model::NetworkIdentifier m_networkIdentifier
Definition: BlockGenerator.cpp:165
catapult::tools::nemgen::NemesisConfiguration::NetworkIdentifier
model::NetworkIdentifier NetworkIdentifier
Block chain network identifier.
Definition: NemesisConfiguration.h:59
catapult::model::MosaicProperties::duration
BlockDuration duration() const
Gets mosaic duration.
Definition: MosaicProperties.h:103
KeyPair.h
catapult::Eternal_Artifact_Duration
constexpr BlockDuration Eternal_Artifact_Duration(0)
Duration of eternal artifact.
catapult::model::MosaicProperties::is
bool is(MosaicFlags testedFlag) const
Returns true if mosaic flags contain testedFlag.
Definition: MosaicProperties.h:93
catapult::tools::nemgen::NemesisConfiguration::RootNamespaces
NamespaceIdToRootNamespaceMap RootNamespaces
Map containing all root namespaces.
Definition: NemesisConfiguration.h:80
Elements.h
catapult::utils::BaseValue< uint64_t, BlockDuration_tag >
catapult::model::MosaicFlags
MosaicFlags
Mosaic property flags.
Definition: MosaicProperty.h:50
m_signer
const crypto::KeyPair & m_signer
Definition: BlockGenerator.cpp:167
m_generationHash
const GenerationHash & m_generationHash
Definition: BlockGenerator.cpp:166
catapult::builders::RegisterNamespaceBuilder
Builder for a register namespace transaction.
Definition: RegisterNamespaceBuilder.h:28
catapult::builders::TransferBuilder::setRecipient
void setRecipient(const UnresolvedAddress &recipient)
Sets the transaction recipient to recipient.
Definition: TransferBuilder.cpp:32
catapult::extensions::TransactionExtensions
Extensions for working with transactions.
Definition: TransactionExtensions.h:27
catapult::tools::nemgen::NemesisConfiguration::NemesisAddressToMosaicSeeds
AddressToMosaicSeedsMap NemesisAddressToMosaicSeeds
Map of nemesis account addresses to mosaic seeds.
Definition: NemesisConfiguration.h:86
catapult::tools::nemgen::NemesisConfiguration::NamespaceNames
NamespaceIdToNameMap NamespaceNames
Map containing all namespace names.
Definition: NemesisConfiguration.h:77
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
catapult::model::MosaicFlags::Supply_Mutable
Mosaic supply is mutable.
catapult::extensions::BlockExtensions::convertBlockToBlockElement
model::BlockElement convertBlockToBlockElement(const model::Block &block, const GenerationHash &generationHash) const
Definition: BlockExtensions.cpp:97
catapult::model::MosaicSupplyChangeDirection::Increase
Increases the supply.
catapult::tools::nemgen::NemesisConfiguration::NemesisSignerPrivateKey
std::string NemesisSignerPrivateKey
Nemesis signer private key.
Definition: NemesisConfiguration.h:65
Address.h
catapult::builders::MosaicDefinitionBuilder::setMosaicNonce
void setMosaicNonce(MosaicNonce mosaicNonce)
Sets the mosaic nonce to mosaicNonce.
Definition: MosaicDefinitionBuilder.cpp:35
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
catapult::MosaicNonce
utils::BaseValue< uint32_t, MosaicNonce_tag > MosaicNonce
Definition: plugins/txes/mosaic/src/types.h:28
catapult::builders::TransferBuilder
Builder for a transfer transaction.
Definition: TransferBuilder.h:29
KeyUtils.h
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
catapult::model::BlockElement
Processing element for a block composed of a block and metadata.
Definition: Elements.h:55
catapult::extensions::CopyToUnresolvedAddress
UnresolvedAddress CopyToUnresolvedAddress(const Address &address)
Copies address to an unresolved address.
Definition: ConversionExtensions.cpp:43
catapult::model::Block
Binary layout for a block.
Definition: Block.h:69
catapult::model::StringToAddress
Address StringToAddress(const std::string &str)
Creates an address from an encoded address (encoded).
Definition: Address.cpp:31
catapult::extensions::BlockExtensions
Extensions for working with blocks.
Definition: BlockExtensions.h:44
catapult::Timestamp
utils::BaseValue< uint64_t, Timestamp_tag > Timestamp
Definition: src/catapult/types.h:73
catapult::builders::RegisterNamespaceBuilder::setName
void setName(const RawBuffer &name)
Sets the namespace name to name.
Definition: RegisterNamespaceBuilder.cpp:45
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::GenerationHash
utils::ByteArray< Hash256_Size, GenerationHash_tag > GenerationHash
Definition: src/catapult/types.h:53
catapult::model::BlockHeader::StateHash
Hash256 StateHash
Hash of the global chain state at this block.
Definition: Block.h:62
catapult::builders::MosaicSupplyChangeBuilder
Builder for a mosaic supply change transaction.
Definition: MosaicSupplyChangeBuilder.h:28
EntityHasher.h
catapult::extensions::TransactionExtensions::sign
void sign(const crypto::KeyPair &signer, model::Transaction &transaction) const
Signs the transaction using signer private key.
Definition: TransactionExtensions.cpp:39
catapult::tools::nemgen::NemesisConfiguration::MosaicEntries
MosaicNameToMosaicEntryMap MosaicEntries
Map containing all mosaic entries.
Definition: NemesisConfiguration.h:83
catapult::model::MosaicProperties::divisibility
uint8_t divisibility() const
Gets mosaic divisibility.
Definition: MosaicProperties.h:98
catapult::crypto::KeyPair::FromString
static auto FromString(const std::string &privateKey)
Creates a key pair from privateKey.
Definition: KeyPair.h:46
NemesisExecutionHasher.h
catapult::utils::ByteArray< Hash256_Size, GenerationHash_tag >
HexParser.h
catapult::tools::nemgen::UpdateNemesisBlock
Hash256 UpdateNemesisBlock(const NemesisConfiguration &config, model::Block &block, NemesisExecutionHashesDescriptor &executionHashesDescriptor)
Updates nemesis block according to config with executionHashesDescriptor.
Definition: BlockGenerator.cpp:234
catapult::tools::nemgen::NemesisExecutionHashesDescriptor
Nemesis block execution dependent hashes information.
Definition: NemesisExecutionHasher.h:42
catapult::builders::MosaicAliasBuilder::setNamespaceId
void setNamespaceId(NamespaceId namespaceId)
Sets the id of a namespace that will become an alias to namespaceId.
Definition: MosaicAliasBuilder.cpp:36
catapult::model::MosaicProperties
Container for mosaic properties.
Definition: MosaicProperties.h:46
catapult::model::MosaicFlags::Transferable
Mosaic is transferable.
catapult::tools::nemgen::CreateNemesisBlockElement
model::BlockElement CreateNemesisBlockElement(const NemesisConfiguration &config, const model::Block &block)
Wraps a block element around block according to config.
Definition: BlockGenerator.cpp:246
catapult::tools::nemgen::NemesisConfiguration::NemesisGenerationHash
GenerationHash NemesisGenerationHash
Nemesis generation hash.
Definition: NemesisConfiguration.h:62
catapult::tools::nemgen::NemesisExecutionHashesDescriptor::ReceiptsHash
Hash256 ReceiptsHash
Receipts hash.
Definition: NemesisExecutionHasher.h:44
catapult::builders::MosaicSupplyChangeBuilder::setMosaicId
void setMosaicId(UnresolvedMosaicId mosaicId)
Sets the id of the affected mosaic to mosaicId.
Definition: MosaicSupplyChangeBuilder.cpp:32
BlockUtils.h
catapult::model::MosaicFlags::None
No flags present.
catapult::extensions::GenerateNamespacePath
NamespacePath GenerateNamespacePath(const RawString &name)
Parses a unified namespace name into a path.
Definition: IdGenerator.cpp:75
catapult::tools::nemgen::CreateNemesisBlock
std::unique_ptr< model::Block > CreateNemesisBlock(const NemesisConfiguration &config)
Creates a nemesis block according to config.
Definition: BlockGenerator.cpp:172