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
ingestion.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <functional>
6#include <filesystem>
7#include <optional>
8#include <string>
9
10#include "native.h"
11#include <asio.hpp>
12#include <nlohmann/json_fwd.hpp>
13
14#include "address.hpp"
15#include "crypto.hpp"
16
17namespace dcn::chain
18{
19 using RpcCall = std::function<std::optional<nlohmann::json>(const std::string & rpc_url, const nlohmann::json & request)>;
20
22 {
23 bool enabled = false;
24
25 std::string rpc_url;
27
28 std::optional<std::uint64_t> start_block;
29 std::uint64_t poll_interval_ms = 5000;
30 std::uint64_t confirmations = 12;
31 std::uint64_t block_batch_size = 500;
32
33 std::filesystem::path storage_path;
34 };
35
37 {
39 std::optional<std::size_t> max_polls = std::nullopt;
40 bool skip_sleep = false;
41 };
42
43 //asio::awaitable<void> runEventIngestion(IngestionConfig cfg, storage::Registry & registry, IngestionRuntimeOptions runtime_options);
44 //asio::awaitable<void> runEventIngestion(IngestionConfig cfg, storage::Registry & registry);
45}
Definition address.hpp:17
evmc::address Address
Definition address.hpp:18
std::function< std::optional< nlohmann::json >(const std::string &rpc_url, const nlohmann::json &request)> RpcCall
Definition ingestion.hpp:19
Definition ingestion.hpp:22
std::uint64_t block_batch_size
Definition ingestion.hpp:31
bool enabled
Definition ingestion.hpp:23
chain::Address registry_address
Definition ingestion.hpp:26
std::uint64_t poll_interval_ms
Definition ingestion.hpp:29
std::optional< std::uint64_t > start_block
Definition ingestion.hpp:28
std::filesystem::path storage_path
Definition ingestion.hpp:33
std::string rpc_url
Definition ingestion.hpp:25
std::uint64_t confirmations
Definition ingestion.hpp:30
Definition ingestion.hpp:37
bool skip_sleep
Definition ingestion.hpp:40
std::optional< std::size_t > max_polls
Definition ingestion.hpp:39
RpcCall rpc_call
Definition ingestion.hpp:38