veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
config.h
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef VERIBLOCK_POP_CPP_C_CONFIG_H
7#define VERIBLOCK_POP_CPP_C_CONFIG_H
8
9#include "veriblock/pop/c/array.h"
10#include "veriblock/pop/c/entities/altblock.h"
11#include "veriblock/pop/c/entities/btcblock.h"
12#include "veriblock/pop/c/entities/vbkblock.h"
13#include "veriblock/pop/c/type_helpers.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19POP_DECLARE_ENTITY(config);
20
21POP_ENTITY_NEW_FUNCTION(config);
22
24POP_ENTITY_CUSTOM_FUNCTION(config,
25 void,
26 select_vbk_params,
27 // "main\0", "test\0", "regtest\0", "alpha\0"
28 POP_ARRAY_NAME(string) net,
29 int start_height,
30 // example: hex,hex,hex
31 POP_ARRAY_NAME(string) blocks);
32
34POP_ENTITY_CUSTOM_FUNCTION(config,
35 void,
36 select_btc_params,
37 // "main\0", "test\0", "regtest\0", "alpha\0"
38 POP_ARRAY_NAME(string) net,
39 int start_height,
40 // example: hex,hex,hex
41 POP_ARRAY_NAME(string) blocks);
42
43POP_ENTITY_SETTER_FUNCTION(config, double, start_of_slope);
44POP_ENTITY_SETTER_FUNCTION(config, double, slope_normal);
45POP_ENTITY_SETTER_FUNCTION(config, double, slope_keystone);
46POP_ENTITY_SETTER_FUNCTION(config, uint32_t, keystone_round);
47POP_ENTITY_SETTER_FUNCTION(config, uint32_t, flat_score_round);
48POP_ENTITY_SETTER_FUNCTION(config, bool, use_flat_score_round);
49POP_ENTITY_SETTER_FUNCTION(config, double, max_score_threshold_normal);
50POP_ENTITY_SETTER_FUNCTION(config, double, max_score_threshold_keystone);
51POP_ENTITY_SETTER_FUNCTION(config, uint32_t, difficulty_averaging_interval);
52POP_ENTITY_SETTER_FUNCTION(config, POP_ARRAY_NAME(double), round_ratios);
53POP_ENTITY_SETTER_FUNCTION(config,
54 POP_ARRAY_NAME(double),
55 pop_rewards_lookup_table);
56POP_ENTITY_SETTER_FUNCTION(config, uint32_t, max_future_block_time);
57POP_ENTITY_SETTER_FUNCTION(config, uint32_t, keystone_interval);
58POP_ENTITY_SETTER_FUNCTION(config, uint32_t, vbk_finality_delay);
59POP_ENTITY_SETTER_FUNCTION(config, uint32_t, endorsement_settlement_interval);
60POP_ENTITY_SETTER_FUNCTION(config, uint32_t, max_pop_data_size);
61POP_ENTITY_SETTER_FUNCTION(config,
62 POP_ARRAY_NAME(u32),
63 fork_resolution_lookup_table);
64POP_ENTITY_SETTER_FUNCTION(config, uint32_t, pop_payout_delay);
65POP_ENTITY_SETTER_FUNCTION(config, uint32_t, max_reorg_distance);
66
67POP_ENTITY_GETTER_FUNCTION(config, double, start_of_slope);
68POP_ENTITY_GETTER_FUNCTION(config, double, slope_normal);
69POP_ENTITY_GETTER_FUNCTION(config, double, slope_keystone);
70POP_ENTITY_GETTER_FUNCTION(config, uint32_t, keystone_round);
71POP_ENTITY_GETTER_FUNCTION(config, uint32_t, flat_score_round);
72POP_ENTITY_GETTER_FUNCTION(config, bool, use_flat_score_round);
73POP_ENTITY_GETTER_FUNCTION(config, double, max_score_threshold_normal);
74POP_ENTITY_GETTER_FUNCTION(config, double, max_score_threshold_keystone);
75POP_ENTITY_GETTER_FUNCTION(config, uint32_t, difficulty_averaging_interval);
76POP_ENTITY_GETTER_FUNCTION(config, POP_ARRAY_NAME(double), round_ratios);
77POP_ENTITY_GETTER_FUNCTION(config,
78 POP_ARRAY_NAME(double),
79 pop_rewards_lookup_table);
80POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_future_block_time);
81POP_ENTITY_GETTER_FUNCTION(config, uint32_t, keystone_interval);
82POP_ENTITY_GETTER_FUNCTION(config, uint32_t, vbk_finality_delay);
83POP_ENTITY_GETTER_FUNCTION(config, uint32_t, endorsement_settlement_interval);
84POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_pop_data_size);
85POP_ENTITY_GETTER_FUNCTION(config,
86 POP_ARRAY_NAME(u32),
87 fork_resolution_lookup_table);
88POP_ENTITY_GETTER_FUNCTION(config, uint32_t, pop_payout_delay);
89POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_reorg_distance);
90POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_vbk_blocks_in_alt_block);
91POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_vtbs_in_alt_block);
92POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_atvs_in_alt_block);
93POP_ENTITY_GETTER_FUNCTION(config, uint32_t, finality_delay);
94POP_ENTITY_GETTER_FUNCTION(config, uint32_t, max_altchain_future_block_time);
95POP_ENTITY_GETTER_FUNCTION(config,
96 POP_ENTITY_NAME(alt_block) *,
97 alt_bootstrap_block);
98POP_ENTITY_GETTER_FUNCTION(config, POP_ARRAY_NAME(string), vbk_network_name);
99POP_ENTITY_GETTER_FUNCTION(config, POP_ARRAY_NAME(string), btc_network_name);
100
101#ifdef __cplusplus
102} // end of extern "C"
103#endif
104
105#endif