CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 #include <unordered_set>
27 namespace catapult {
namespace ionet {
109 friend std::ostream&
operator<<(std::ostream& out,
const Node& node);
128 using NodeSet = std::unordered_set<Node, NodeHasher>;
A node's publicly accessible endpoint.
Definition: Node.h:35
DEFINE_STATEFUL_VALIDATOR(EligibleHarvester, [](const auto ¬ification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;})
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
NewBlockSink m_newBlockSink
Definition: NewBlockConsumer.cpp:66
TransactionInfo MakeTransactionInfo(const std::shared_ptr< const Transaction > &pTransaction, const TransactionElement &transactionElement)
Makes a transaction info by merging pTransaction and transactionElement.
Definition: Elements.cpp:103
constexpr disruptor::ConsumerResult CompleteSuccess()
Creates a completed success consumer result.
Definition: ConsumerResultFactory.h:39
size_t operator()(const Node &node) const
Hashes node.
Definition: Node.h:122
def debug(*args)
Definition: Parser.py:46
static std::vector< std::shared_ptr< TEntity > > ExtractEntitiesFromRange(EntityRange &&range)
Definition: EntityRange.h:470
InputSource m_sinkSourceMask
Definition: NewBlockConsumer.cpp:67
const Key & identityKey() const
Gets the unique identifier (a public key).
Definition: Node.cpp:60
NewTransactionsSink m_newTransactionsSink
Definition: NewTransactionsConsumer.cpp:75
InputSource
Possible consumer input sources.
Definition: InputSource.h:42
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
Node()
Creates a default node.
Definition: Node.cpp:48
bool operator==(const Node &rhs) const
Returns true if this node is equal to rhs.
Definition: Node.cpp:72
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
disruptor::DisruptorConsumer CreateNewBlockConsumer(const NewBlockSink &newBlockSink, disruptor::InputSource sinkSourceMask)
Hasher object for a node.
Definition: Node.h:120
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto ¬ification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))
Definition: NamespaceNameValidator.cpp:36
std::string m_printableName
Definition: Node.h:116
std::unordered_set< Node, NodeHasher > NodeSet
A set of nodes.
Definition: Node.h:128
bool operator!=(const Node &rhs) const
Returns true if this node is not equal to rhs.
Definition: Node.cpp:76
consumer< TransactionInfos && > NewTransactionsSink
Prototype for a function that is called with new transactions.
Definition: TransactionConsumers.h:55
NodeRoles
A node's role.
Definition: NodeRoles.h:28
boost::asio::ip::tcp::endpoint m_endpoint
Definition: PacketSocket.cpp:480
Key m_identityKey
Definition: Node.h:112
std::vector< model::TransactionInfo > TransactionInfos
Container for transactions infos.
Definition: InputUtils.h:48
Address PublicKeyToAddress(const Key &publicKey, NetworkIdentifier networkIdentifier)
Creates an address from a public key (publicKey) for the network identified by networkIdentifier.
Definition: Address.cpp:50
std::string AddressToString(const Address &address)
Creates an encoded address from an address.
Definition: Address.cpp:38
friend std::ostream & operator<<(std::ostream &out, const Node &node)
Insertion operator for outputting node to out.
Definition: Node.cpp:80
constexpr disruptor::ConsumerResult Abort(validators::ValidationResult validationResult)
Creates an aborted consumer result around validationResult.
Definition: ConsumerResultFactory.h:34
std::ostream & operator<<(std::ostream &out, ConnectionSecurityMode value)
Insertion operator for outputting value to out.
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
NodeEndpoint m_endpoint
Definition: Node.h:113
const NodeEndpoint & endpoint() const
Gets the endpoint.
Definition: Node.cpp:64
const NodeMetadata & metadata() const
Gets tne metadata.
Definition: Node.cpp:68
Validation result is failure.
std::string Host
Host.
Definition: Node.h:37
Account is a remote harvester eligible account that is unlinked.
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
Definition: AddressExtractionExtension.cpp:28
disruptor::DisruptorConsumer CreateNewTransactionsConsumer(const NewTransactionsSink &newTransactionsSink)
Definition: NewTransactionsConsumer.cpp:79
constexpr disruptor::ConsumerResult CompleteNeutral()
Creates a completed neutral consumer result.
Definition: ConsumerResultFactory.h:44
Notification of use of an account address.
Definition: Notifications.h:57
consumer< const std::shared_ptr< const model::Block > & > NewBlockSink
Prototype for a function that is called with a new block.
Definition: BlockConsumers.h:84
NodeMetadata m_metadata
Definition: Node.h:114
DisruptorConsumerT< ConsumerInput > DisruptorConsumer
A disruptor consumer function.
Definition: DisruptorConsumer.h:32
A node in the catapult network.
Definition: Node.h:82
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
unsigned short Port
Port.
Definition: Node.h:40
constexpr disruptor::ConsumerResult Continue()
Creates a continuation consumer result.
Definition: ConsumerResultFactory.h:29