CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
30 namespace extensions {
class ServiceState; }
32 struct TimeSynchronizationConfiguration;
33 class TimeSynchronizationState;
34 class TimeSynchronizer;
38 namespace catapult {
namespace timesync {
supplier< Timestamp > NetworkTimeSupplier
Supplier that returns the network time.
Definition: ExtensionManager.h:36
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
void update(TimeOffset offset)
Updates the current offset using offset.
Definition: TimeSynchronizationState.cpp:54
auto & cache() const
Gets the cache.
Definition: ServiceState.h:99
def debug(*args)
Definition: Parser.py:46
utils::BaseValue< uint32_t, ServiceIdentifier_tag > ServiceIdentifier
Definition: NodeInfo.h:56
A time synchronizer that synchronizes local time with the network.
Definition: TimeSynchronizer.h:36
NodeSelectionResult SelectNodes(const ionet::NodeContainer &nodes, const NodeSelectionConfiguration &config, const ImportanceRetriever &importanceRetriever)
Definition: NodeSelector.cpp:175
def warning(*args)
Definition: colorPrint.py:10
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
utils::BaseValue< uint64_t, Importance_tag > Importance
Definition: src/catapult/types.h:102
auto & storage() const
Gets the storage.
Definition: ServiceState.h:109
future< std::vector< future< T > > > when_all(std::vector< future< T >> &&allFutures)
Returns a future that is signaled when all futures in allFutures complete.
Definition: FutureUtils.h:31
const auto & config() const
Gets the config.
Definition: ServiceState.h:89
constexpr double Required_Minimum_Importance
Definition: extensions/timesync/src/constants.h:44
Task CreateNamedTask(const std::string &name, const TaskCallback &callback)
Creates an unscheduled task with name and callback.
Definition: Task.cpp:52
Represents a sample in the time synchronization process.
Definition: TimeSynchronizationSample.h:30
std::unordered_set< Node, NodeHasher > NodeSet
A set of nodes.
Definition: Node.h:128
Provides a way to access the result of an asynchronous operation.
Definition: Future.h:29
def info(*args)
Definition: forwardsValidation.py:12
std::set< TimeSynchronizationSample > TimeSynchronizationSamples
A set of time synchronization samples.
Definition: TimeSynchronizationSample.h:83
std::pair< net::NodeRequestResult, CommunicationTimestamps > TimeSyncRequestResultPair
Time synchronization request result pair.
Definition: TimeSynchronizationUtils.h:41
NodeAge nodeAge() const
Gets the node age.
Definition: TimeSynchronizationState.cpp:46
std::vector< TimeSynchronizationSample > Samples
Definition: TimeSynchronizationUtils.cpp:56
State that is used as part of service registration.
Definition: ServiceState.h:51
std::atomic< size_t > NumValidSamples
Definition: TimeSynchronizationUtils.cpp:57
auto & nodes() const
Gets the nodes.
Definition: ServiceState.h:94
Synchronized cache composed of stateful account information.
Definition: AccountStateCache.h:72
TimeOffset calculateTimeOffset(const cache::AccountStateCacheView &accountStateCacheView, Height height, TimeSynchronizationSamples &&samples, NodeAge nodeAge)
Calculates a time offset from samples using accountStateCacheView, height and nodeAge.
Definition: TimeSynchronizer.cpp:51
Time synchronization state.
Definition: TimeSynchronizationState.h:37
Time synchronization configuration settings.
Definition: TimeSynchronizationConfiguration.h:30
Definition: AddressExtractionExtension.cpp:28
std::function< thread::future< TimeSyncRequestResultPair >(const ionet::Node &)> TimeSyncResultSupplier
Prototype for a time synchronization result supplier.
Definition: TimeSynchronizationUtils.h:44
A node in the catapult network.
Definition: Node.h:82
thread::future< TimeSynchronizationSamples > RetrieveSamples(const ionet::NodeSet &nodes, const TimeSyncResultSupplier &requestResultFutureSupplier, const NetworkTimeSupplier &networkTimeSupplier)
Definition: TimeSynchronizationUtils.cpp:73
A task that can be dispatched to the scheduler.
Definition: Task.h:45
thread::Task CreateTimeSyncTask(TimeSynchronizer &timeSynchronizer, const TimeSynchronizationConfiguration &timeSyncConfig, const TimeSyncResultSupplier &resultSupplier, const extensions::ServiceState &state, TimeSynchronizationState &timeSyncState, const NetworkTimeSupplier &networkTimeSupplier)
Definition: TimeSynchronizationUtils.cpp:112