Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
events_shard.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <string>
6
7namespace dcn::events
8{
10 {
11 int chain_id = 1;
12 int year = 1970;
13 int month = 1;
14 };
15
17 {
18 public:
19 virtual ~IEventShardRouter() = default;
20
21 virtual EventShardId shardForFinalizedBlockTime(int chain_id, std::int64_t unix_seconds) const = 0;
22 virtual std::filesystem::path filenameFor(const EventShardId & shard_id) const = 0;
23 virtual std::string monthToken(const EventShardId & shard_id) const = 0;
24 };
25
27 {
28 public:
29 explicit MonthlyEventShardRouter(std::filesystem::path archive_root);
30
31 EventShardId shardForFinalizedBlockTime(int chain_id, std::int64_t unix_seconds) const override;
32 std::filesystem::path filenameFor(const EventShardId & shard_id) const override;
33 std::string monthToken(const EventShardId & shard_id) const override;
34
35 private:
36 std::filesystem::path _archive_root;
37 };
38}
Definition events_shard.hpp:17
virtual ~IEventShardRouter()=default
virtual EventShardId shardForFinalizedBlockTime(int chain_id, std::int64_t unix_seconds) const =0
virtual std::filesystem::path filenameFor(const EventShardId &shard_id) const =0
virtual std::string monthToken(const EventShardId &shard_id) const =0
Definition events_shard.hpp:27
EventShardId shardForFinalizedBlockTime(int chain_id, std::int64_t unix_seconds) const override
Definition events_shard.cpp:12
std::filesystem::path filenameFor(const EventShardId &shard_id) const override
Definition events_shard.cpp:28
std::string monthToken(const EventShardId &shard_id) const override
Definition events_shard.cpp:35
Definition decoded_event.hpp:11
Definition events_shard.hpp:10
int month
Definition events_shard.hpp:13
int chain_id
Definition events_shard.hpp:11
int year
Definition events_shard.hpp:12